Comparar commits
1 Commits
| Autor | SHA1 | Data | |
|---|---|---|---|
| f8e258e655 |
+526
-1
@@ -1,6 +1,531 @@
|
||||
CHANGES.txt - 2007-07-27
|
||||
CHANGES.txt - 2008-10-09
|
||||
------------------------
|
||||
|
||||
CHANGES IN CUPS V1.3.9
|
||||
|
||||
- SECURITY: The HP-GL/2 filter did not range check pen numbers
|
||||
(STR #2911)
|
||||
- SECURITY: The SGI image file reader did not range check
|
||||
16-bit run lengths (STR #2918)
|
||||
- SECURITY: The text filter did not range check cpi, lpi, or
|
||||
column values (STR #2919)
|
||||
- Documentation updates (STR #2904, STR #2944)
|
||||
- The French web admin page was never updated (STR #2963)
|
||||
- The IPP backend did not retry print jobs when the printer
|
||||
reported itself as busy or unavailable (STR #2951)
|
||||
- The "Set Allowed Users" web interface did not handle trailing
|
||||
whitespace correctly (STR #2956)
|
||||
- The PostScript filter did not work with Adobe applications
|
||||
using custom page sizes (STR #2968)
|
||||
- The Mac OS X USB backend did not work with some printers
|
||||
that reported a bad 1284 device ID.
|
||||
- The scheduler incorrectly resolved the client connection
|
||||
address when HostNameLookups was set to Off (STR #2946)
|
||||
- The IPP backend incorrectly stopped the local queue if
|
||||
the remote server reported the "paused" state.
|
||||
- The cupsGetDests() function did not catch all types of
|
||||
request errors.
|
||||
- The scheduler did not always log "job queued" messages
|
||||
(STR #2943)
|
||||
- The scheduler did not support destination filtering using
|
||||
the printer-location attribute properly (STR #2945)
|
||||
- The scheduler did not send the server-started,
|
||||
server-restarted, or server-stopped events (STR #2927)
|
||||
- The scheduler no longer enforces configuration file
|
||||
permissions on symlinked files (STR #2937)
|
||||
- CUPS now reinitializes the DNS resolver on failures
|
||||
(STR #2920)
|
||||
- The CUPS desktop menu item was broken (STR #2924)
|
||||
- The PPD parser was too strict about missing keyword
|
||||
values in "relaxed" mode.
|
||||
- The PostScript filter incorrectly mirrored landscape
|
||||
documents.
|
||||
- The scheduler did not correctly update the
|
||||
auth-info-required value(s) if the AuthType was Default.
|
||||
- The scheduler required Kerberos authentication for
|
||||
all operations on remote Kerberized printers instead
|
||||
of just for the operations that needed it.
|
||||
- The socket backend could wait indefinitely for back-
|
||||
channel data with some devices.
|
||||
- PJL panel messages were not reset correctly on older
|
||||
printers (STR #2909)
|
||||
- cupsfilter used the wrong default path (STR #2908)
|
||||
- Fixed address matching for "BrowseAddress @IF(name)"
|
||||
(STR #2910)
|
||||
- Fixed compiles on AIX.
|
||||
- Firefox 3 did not work with the CUPS web interface in SSL
|
||||
mode (STR #2892)
|
||||
- Custom options with multiple parameters were not emitted
|
||||
correctly.
|
||||
- Refined the cupstestppd utility.
|
||||
- ppdEmit*() did not support custom JCL options (STR #2889)
|
||||
- The cupstestppd utility incorrectly reported missing
|
||||
"en" base translations (STR #2887)
|
||||
|
||||
|
||||
CHANGES IN CUPS V1.3.8
|
||||
|
||||
- Documentation updates (STR #2785, STR #2861, STR #2862)
|
||||
- The scheduler did not add the ending job sheet when the
|
||||
job was released.
|
||||
- The IPP backend did not relay marker-* attributes.
|
||||
- The CUPS GNOME/KDE menu item was not localized for
|
||||
Chinese (STR #2880)
|
||||
- The CUPS GNOME/KDE menu item was not localized for
|
||||
Japanese (STR #2876)
|
||||
- The cupstestppd utility reported mixed line endings for
|
||||
Mac OS and Windows PPD files (STR #2874)
|
||||
- The pdftops filter did not print landscape orientation PDF
|
||||
pages correctly on all printers (STR #2850)
|
||||
- The scheduler did not handle expiring of implicit classes
|
||||
or their members properly, leading to a configuration where
|
||||
one of the members would have a short name (STR #2766)
|
||||
- The scheduler and cupstestppd utilities did not support
|
||||
cupsFilter and cupsPreFilter programs with spaces in their
|
||||
names (STR #2866)
|
||||
- Removed unused variables and assignments found by the
|
||||
LLVM "clang" tool.
|
||||
- Added NULL checks recommended by the LLVM "clang" tool.
|
||||
- The scheduler would crash if you started a printer that
|
||||
pointed to a backend that did not exist (STR #2865)
|
||||
- The ppdLocalize functions incorrectly mapped all generic
|
||||
locales to country-specific locales.
|
||||
- The cups-driverd program did not support Simplified Chinese
|
||||
or Traditional Chinese language version strings (STR #2851)
|
||||
- Added an Indonesian translation (STR #2792)
|
||||
- Fixed a timing issue in the backends that could cause data
|
||||
corruption with the CUPS_SC_CMD_DRAIN_OUTPUT side-channel
|
||||
command (STR #2858)
|
||||
- The scheduler did not support "HostNameLookups" with all of
|
||||
the boolean names (STR #2861)
|
||||
- Fixed a compile problem with glibc 2.8 (STR #2860)
|
||||
- The PostScript filter did not support %%IncludeFeature lines
|
||||
in the page setup section of each page (STR #2831)
|
||||
- The scheduler did not generate printer-state events when the
|
||||
default printer was changed (STR #2764)
|
||||
- cupstestppd incorrectly reported a warning about the PPD format
|
||||
version in some locales (STR #2854)
|
||||
- cupsGetPPD() and friends incorrectly returned a PPD file for
|
||||
a class with no printers.
|
||||
- The member-uris values for local printers in a class returned
|
||||
by the scheduler did not reflect the connected hostname or
|
||||
port.
|
||||
- The CUPS PHP extension was not thread-safe (STR #2828)
|
||||
- The scheduler incorrectly added the document-format-default
|
||||
attribute to the list of "common" printer attributes, which
|
||||
over time would slow down the printing system (STR #2755,
|
||||
STR #2836)
|
||||
- The cups-deviced and cups-driverd helper programs did not set
|
||||
the CFProcessPath environment variable on Mac OS X (STR #2837)
|
||||
- "lpstat -p" could report the wrong job as printing (STR #2845)
|
||||
- The scheduler would crash when some cupsd.conf directives
|
||||
were missing values (STR #2849)
|
||||
- The web interface "move jobs" operation redirected users to
|
||||
the wrong URL (STR #2815)
|
||||
- The Polish web interface translation contained errors
|
||||
(STR #2815)
|
||||
- The scheduler did not report PostScript printer PPDs with
|
||||
filters as PostScript devices.
|
||||
- The scheduler did not set the job document-format attribute
|
||||
for jobs submitted using Create-Job and Send-Document.
|
||||
- cupsFileTell() did not work for log files opened in append
|
||||
mode (STR #2810)
|
||||
- The scheduler did not set QUERY_STRING all of the time
|
||||
for CGI scripts (STR #2781, STR #2816)
|
||||
- The scheduler now returns an error for bad job-sheets
|
||||
values (STR #2775)
|
||||
- Authenticated remote printing did not work over domain
|
||||
sockets (STR #2750)
|
||||
- The scheduler incorrectly logged errors for print filters
|
||||
when a job was canceled (STR #2806, #2808)
|
||||
- The scheduler no longer allows multiple RSS subscriptions
|
||||
with the same URI (STR #2789)
|
||||
- The scheduler now supports Kerberized printing with
|
||||
multiple server names (STR #2783)
|
||||
- "Satisfy any" did not work in IPP policies (STR #2782)
|
||||
- The CUPS imaging library would crash with very large
|
||||
images - more than 16Mx16M pixels (STR #2805)
|
||||
- The PNG image loading code would crash with large images
|
||||
(STR #2790)
|
||||
- The scheduler did not limit the total number of filters.
|
||||
- The scheduler now ensures that the RSS directory has
|
||||
the correct permissions.
|
||||
- The RSS notifier did not quote the feed URL in the RSS
|
||||
file it created (STR #2801)
|
||||
- The web interface allowed the creation and cancellation
|
||||
of RSS subscriptions without a username (STR #2774)
|
||||
- Increased the default MaxCopies value on Mac OS X to
|
||||
9999 to match the limit imposed by the print dialog.
|
||||
- The scheduler did not reject requests with an empty
|
||||
Content-Length field (STR #2787)
|
||||
- The scheduler did not log the current date and time and
|
||||
did not escape special characters in request URIs when
|
||||
logging bad requests to the access_log file (STR #2788)
|
||||
|
||||
|
||||
CHANGES IN CUPS V1.3.7
|
||||
|
||||
- CVE-2008-0047: cgiCompileSearch buffer overflow (STR #2729)
|
||||
- CVE-2008-1373: CUPS GIF image filter overflow (STR #2765)
|
||||
- Updated the "make check" tests to do a more thorough
|
||||
automated test.
|
||||
- cups-driverd complained about missing directories (STR
|
||||
#2777)
|
||||
- cupsaddsmb would leave the Samba username and password on
|
||||
disk if no Windows drivers were installed (STR #2779)
|
||||
- The Linux USB backend used 100% CPU when a printer was
|
||||
disconnected (STR #2769)
|
||||
- The sample raster drivers did not properly handle SIGTERM
|
||||
(STR #2770)
|
||||
- The scheduler sent notify_post() messages too often on
|
||||
Mac OS X.
|
||||
- Kerberos access to the web interface did not work
|
||||
(STR #2748)
|
||||
- The scheduler did not support "AuthType Default" in IPP
|
||||
policies (STR #2749)
|
||||
- The scheduler did not support the "HideImplicitMembers"
|
||||
directive as documented (STR #2760)
|
||||
- "make check" didn't return a non-zero exit code on
|
||||
error (STR #2758)
|
||||
- The scheduler incorrectly logged AUTH_foo environment
|
||||
variables in debug mode (STR #2751)
|
||||
- The image filters inverted PBM files (STR #2746)
|
||||
- cupsctl would crash if the scheduler was not running
|
||||
(STR #2741)
|
||||
- The scheduler could crash when printing using a port
|
||||
monitor (STR #2742)
|
||||
- The scheduler would crash if PAM was broken (STR #2734)
|
||||
- The image filters did not work with some CMYK JPEG files
|
||||
produced by Adobe applications (STR #2727)
|
||||
- The Mac OS X USB backend did not work with printers that
|
||||
did not report a make or model.
|
||||
- The job-sheets option was not encoded properly (STR #2715)
|
||||
- The scheduler incorrectly complained about missing LSB
|
||||
PPD directories.
|
||||
|
||||
|
||||
CHANGES IN CUPS V1.3.6
|
||||
|
||||
- Documentation updates (STR #2646, STR #2647, STR #2649)
|
||||
- Fixed a problem with the web interface "Use Kerberos
|
||||
Authentication" check box (STR #2703)
|
||||
- The scheduler unconditionally overwrote the printer-state-
|
||||
message with "process-name failed" when a filter or backend
|
||||
failed, preventing a useful error message from being shown
|
||||
to the user.
|
||||
- Policies on CUPS-Move-Job didn't work as expected (STR
|
||||
#2699)
|
||||
- The configure script only supported D-BUS on Linux
|
||||
(STR #2702)
|
||||
- The scheduler did not support </LimitExcept> (STR #2701)
|
||||
- The scheduler did not reset the job-hold-until attribute
|
||||
after a job's hold time was reached.
|
||||
- The scheduler did not support printer supply attributes
|
||||
(STR #1307)
|
||||
- The Kerberos credentials provided by some Windows KDCs
|
||||
were still too large - now use a dynamic buffer to
|
||||
support credentials up to 64k in size (STR #2695)
|
||||
- Printing a test page from the web interface incorrectly
|
||||
defaulted to the "guest" user (STR #2688)
|
||||
- The cupsEncodeOptions2() function did not parse multiple-
|
||||
value attribute values properly (STR #2690)
|
||||
- The scheduler incorrectly sent printer-stopped events for
|
||||
status updates from the print filters (STR #2680)
|
||||
- The IPP backend could crash when handling printer errors
|
||||
(STR #2667)
|
||||
- Multi-file jobs did not print to remote CUPS servers
|
||||
(STR #2673)
|
||||
- The scheduler did not provide the Apple language ID to
|
||||
job filters.
|
||||
- Kerberos authentication did not work with the web
|
||||
interface (STR #2606, STR #2669)
|
||||
- The requesing-user-name-allowed and -denied functionality
|
||||
did not work for Kerberos-authenticated usernames (STR
|
||||
#2670)
|
||||
- CUPS didn't compile on HP-UX 11i (STR #2679)
|
||||
- cupsEncodeOptions2() did not handle option values like
|
||||
"What's up, doc?" properly.
|
||||
- Added lots of memory allocation checks (Fortify)
|
||||
- The scheduler would crash if it was unable to add a job
|
||||
file (Fortify)
|
||||
- ppdOpen*() did not check all memory allocations (Coverity)
|
||||
- ippReadIO() did not check all memory allocations (Coverity)
|
||||
- The PostScript filter did not detect read errors (Coverity)
|
||||
- The scheduler did not check for a missing job-sheets-completed
|
||||
attribute when sending an event notification (Coverity)
|
||||
- "Set Printer Options" might not work with raw queues (Coverity)
|
||||
- cupsRasterInterpretPPD() could crash on certain PostScript
|
||||
errors (Coverity)
|
||||
- The USB backend did not check for back-channel support
|
||||
properly on all systems (Coverity)
|
||||
- Fixed memory leaks in the GIF and PNM image loading code
|
||||
(Coverity)
|
||||
- Removed some dead code in the CUPS API and scheduler (Coverity)
|
||||
- Fixed two overflow bugs in the HP-GL/2 filter (Coverity)
|
||||
- Fixed another ASN1 string parsing bug (STR #2665)
|
||||
- The RSS notifier directory was not installed with the
|
||||
correct permissions.
|
||||
- The standard CUPS backends could use 100% CPU while waiting
|
||||
for print data (STR #2664)
|
||||
- Filename-based MIME rules did not work (STR #2659)
|
||||
- The cups-polld program did not exit if the scheduler crashed
|
||||
(STR #2640)
|
||||
- The scheduler would crash if you tried to set the port-monitor
|
||||
on a raw queue (STR #2639)
|
||||
- The scheduler could crash if a polled remote printer was
|
||||
converted to a class (STR #2656)
|
||||
- The web interface and cupsctl did not correctly reflect
|
||||
the "allow printing from the Internet" state (STR #2650)
|
||||
- The scheduler incorrectly treated MIME types as case-
|
||||
sensitive (STR #2657)
|
||||
- The Java support classes did not send UTF-8 strings to
|
||||
the scheduler (STR #2651)
|
||||
- The CGI code did not handle interrupted POST requests
|
||||
properly (STR #2652)
|
||||
- The PostScript filter incorrectly handled number-up when
|
||||
the number of pages was evenly divisible by the number-up
|
||||
value.
|
||||
- The PDF filter incorrectly filtered pages when page-ranges
|
||||
and number-up were both specified (STR #2643)
|
||||
- The IPP backend did not handle printing of pictwps files
|
||||
to a non-Mac CUPS server properly.
|
||||
- The scheduler did not detect network interface changes
|
||||
on operating systems other than Mac OS X (STR #2631)
|
||||
- The scheduler now logs the UNIX error message when it
|
||||
is unable to create a request file such as a print job.
|
||||
- Added support for --enable-pie on Mac OS X.
|
||||
|
||||
|
||||
CHANGES IN CUPS V1.3.5
|
||||
|
||||
- The SNMP backend did not check for negative string
|
||||
lengths (STR #2589)
|
||||
- The scheduler incorrectly removed auth-info attributes,
|
||||
potentially leading to a loss of all options for a job.
|
||||
- The scheduler stopped sending CUPS browse packets on a
|
||||
restart when using fixed addresses (STR #2618)
|
||||
- Fixed PDF filter security issues (CVE-2007-4352
|
||||
CVE-2007-5392 CVE-2007-5393)
|
||||
- Changing settings would always change the DefaultAuthType
|
||||
and Allow lines (STR #2580)
|
||||
- The scheduler would crash when submitting an undefined
|
||||
format file from Samba with LogLevel debug2 (STR #2600)
|
||||
- The scheduler did not use poll() when epoll() was not
|
||||
supported by the running kernel (STR #2582)
|
||||
- Fixed a compile problem with Heimdal Kerberos (STR #2592)
|
||||
- The USB backend now retries connections to a printer
|
||||
indefinitely rather than stopping the queue.
|
||||
- Printers with untranslated JCL options were not exported
|
||||
to Samba correctly (STR #2570)
|
||||
- The USB backend did not work with some Minolta USB
|
||||
printers (STR #2604)
|
||||
- The strcasecmp() emulation code did not compile (STR
|
||||
#2612)
|
||||
- The scheduler would crash if a job was sent to an empty
|
||||
class (STR #2605)
|
||||
- The lpc command did not work in non-UTF-8 locales (STR
|
||||
#2595)
|
||||
- Subscriptions for printer-stopped events also received
|
||||
other state changes (STR #2572)
|
||||
- cupstestppd incorrectly reported translation errors for
|
||||
the "en" locale.
|
||||
- ppdOpen() did not handle custom options properly when the
|
||||
Custom attribute appeared before the OpenUI for that
|
||||
option.
|
||||
- The scheduler could crash when deleting a printer or
|
||||
listing old jobs.
|
||||
- The Mac OS X USB backend did not allow for requeuing of
|
||||
jobs submitted to a class.
|
||||
- lpmove didn't accept a job ID by itself.
|
||||
- The scheduler incorrectly removed job history information
|
||||
for remote print jobs.
|
||||
- The scheduler incorrectly sent the
|
||||
"com.apple.printerListChanged" message for printer state
|
||||
changes.
|
||||
- The PostScript filter drew the page borders (when enabled)
|
||||
outside the imageable area.
|
||||
- The LPD and IPP backends did not default to the correct
|
||||
port numbers when using alternate scheme names.
|
||||
- The scheduler incorrectly deleted hardwired remote
|
||||
printers on system sleep.
|
||||
- The scheduler would abort if a bad browse protocol name
|
||||
was listed in the cupsd.conf file.
|
||||
- The online cupsd.conf help file incorrectly showed
|
||||
"dns-sd" instead of "dnssd" for Bonjour sharing.
|
||||
- The scheduler could crash changing the port-monitor value.
|
||||
- The scheduler generated CoreFoundation errors when run as
|
||||
a background process.
|
||||
- When printing with number-up > 1, it was possible to get
|
||||
an extra blank page.
|
||||
|
||||
|
||||
CHANGES IN CUPS V1.3.4
|
||||
|
||||
- Documentation updates (STR #2560, STR #2563, STR #2569)
|
||||
- CUPS now maps the "nb" locale to "no" on all platforms
|
||||
(STR #2575)
|
||||
- CUPS did not work with a Windows 2003 R2 KDC (STR #2568)
|
||||
- ippReadIO() could read past the end of a buffer (STR
|
||||
#2561)
|
||||
- The scheduler would crash on shutdown if it was unable
|
||||
to create a Kerberos context.
|
||||
- Multiple AuthTypes in cupsd.conf did not work (STR
|
||||
#2545)
|
||||
- The snmp.conf file referenced the wrong man page (STR
|
||||
#2564)
|
||||
- The cupsaddsmb program didn't handle domain sockets
|
||||
properly (STR #2556)
|
||||
- The scheduler now validates device URIs when adding
|
||||
printers.
|
||||
- Updated httpSeparateURI() to support hostnames with
|
||||
the backslash character.
|
||||
- Updated the Japanese localization (STR #2546)
|
||||
- The parallel backend now gets the current IEEE-1284
|
||||
device ID string on Linux (STR #2553)
|
||||
- The IPP backend now checks the job status at
|
||||
variable intervals (from 1 to 10 seconds) instead
|
||||
of every 10 seconds for faster remote printing
|
||||
(STR #2548)
|
||||
- "lpr -p" and "lpr -l" did not work (STR #2544)
|
||||
- Compilation failed when a previous version of CUPS
|
||||
was installed and was included in the SSL include
|
||||
path (STR #2538)
|
||||
- The scheduler did not reject requests with charsets
|
||||
other than US-ASCII or UTF-8, and the CUPS API
|
||||
incorrectly passed the locale charset to the scheduler
|
||||
instead of UTF-8 (STR #2537)
|
||||
- cups-deviced did not filter out duplicate devices.
|
||||
- The AppleTalk backend incorrectly added a scheme
|
||||
listing when AppleTalk was disabled or no printers
|
||||
were found.
|
||||
- The PostScript filter generated N^2 copies when the
|
||||
printer supported collated copies and user requested
|
||||
reverse-order output.
|
||||
- The scheduler did not reprint all of the files in a
|
||||
job that was held.
|
||||
- The scheduler did not update the printcap file after
|
||||
removing stale remote queues.
|
||||
- The cupsd.conf man page incorrectly referenced
|
||||
"AuthType Kerberos" instead of "AuthType Negotiate".
|
||||
|
||||
|
||||
CHANGES IN CUPS V1.3.3
|
||||
|
||||
- The scheduler did not use the attributes-natural-language
|
||||
attribute when passing the LANG environment variable to
|
||||
cups-deviced or cups-driverd.
|
||||
- The scheduler did not use the printer-op-policy when
|
||||
modifying classes or printers (STR #2525)
|
||||
- The auth-info-required attribute was not always updated
|
||||
for remote queues that required authentication.
|
||||
- The German web interface localization contained errors
|
||||
(STR #2523)
|
||||
- The Swedish localization contained errors (STR #2522)
|
||||
|
||||
|
||||
CHANGES IN CUPS V1.3.2
|
||||
|
||||
- The 1.3.1 release was incorrectly created from the
|
||||
1.4.x source tree (STR #2519)
|
||||
- Added support for 32/64-bit libraries on HP-UX
|
||||
(STR #2520)
|
||||
- The scheduler incorrectly used portrait as the default
|
||||
orientation (STR #2513)
|
||||
- The scheduler no longer writes the printcap file for
|
||||
every remote printer update (STR #2512)
|
||||
- Remote raw printing with multiple copies did not work
|
||||
(STR #2518)
|
||||
- Updated the configure script to require at least autoconf
|
||||
2.60 (STR #2515)
|
||||
- Some gzip'd PPD files were not read in their entirety
|
||||
(STR #2510)
|
||||
|
||||
|
||||
CHANGES IN CUPS V1.3.1
|
||||
|
||||
- Documentation updates.
|
||||
- The USB backend on Mac OS X could hang if the driver and
|
||||
printer did not match.
|
||||
- Delegated Kerberos credentials were not working.
|
||||
- "make distclean" incorrectly removed the edit-config.tmpl
|
||||
files (STR #2508)
|
||||
- Fix compile problem on HP-UX (STR #2501)
|
||||
- The cupstestppd utility now tests for resolutions greater
|
||||
than 99999 DPI to detect a missing "x" between the X and Y
|
||||
resolutions.
|
||||
- Fixed many problems in the various translations and added
|
||||
a new "checkpo" utility to validate them.
|
||||
- The cupstestppd utility now tests the custom page size code
|
||||
for CUPS raster drivers.
|
||||
- cupsLangDefault() did not attempt to return a language that
|
||||
was supported by the calling application.
|
||||
- If a remote printer stopped while a job was being sent, the
|
||||
local queue would also get stopped and the job re-queued,
|
||||
resulting in duplicate prints in some cases.
|
||||
- A few Apple-specific job options needed to be omitted when
|
||||
printing a banner page.
|
||||
- The new peer credential support did not compile on FreeBSD
|
||||
(STR #2495)
|
||||
- Direct links to help files did not set the current section
|
||||
so the table-of-contents was not shown.
|
||||
- The configure script did not support --localedir=foo (STR #2488)
|
||||
- The backends were not displaying their localized messages.
|
||||
- CUPS-Authenticate-Job did not require Kerberos authentication
|
||||
on queues protected by Kerberos.
|
||||
- The Zebra ZPL driver did not work with Brady label printers
|
||||
(STR #2487)
|
||||
- Norwegian wasn't localized on Mac OS X.
|
||||
- getnameinfo() returns an error on some systems when DNS is
|
||||
not available, leading to numerous problems (STR #2486)
|
||||
- The cupsfilter command did not work properly on Mac OS X.
|
||||
- The scheduler makefile contained a typo (STR #2483)
|
||||
- The TBCP and BCP port monitors did not handle the trailing
|
||||
CTRL-D in some PostScript output properly.
|
||||
- Fixed the localization instructions and German template for
|
||||
the "Find New Printers" button (STR #2478)
|
||||
- The web interface did not work with the Chinese localization
|
||||
(STR #2477)
|
||||
- The web interface home page did not work for languages that
|
||||
were only partially localized (STR #2472)
|
||||
- Updated the Spanish web interface localization (STR #2473)
|
||||
- ppdLocalize() did not work for country-specific localizations.
|
||||
|
||||
|
||||
CHANGES IN CUPS V1.3.0
|
||||
|
||||
- The scheduler did not handle out-of-file conditions
|
||||
gracefully when accepting new connections, leading to
|
||||
heavy CPU usage.
|
||||
- The scheduler did not detect ServerBin misconfigurations
|
||||
(STR #2470)
|
||||
- "AuthType Default" did not work as expected when the
|
||||
"DefaultAuthType foo" line appeared after it in the
|
||||
cupsd.conf file.
|
||||
- The on-line help did not describe many common printing
|
||||
options (STR #1846)
|
||||
- The IPP backend did not return the "auth required" status
|
||||
when printing to a Kerberos-protected queue.
|
||||
- The scheduler was not looking in the correct directories
|
||||
for LSB PPD files (STR #2464)
|
||||
- Changed references to ESP Ghostscript to GPL Ghostscript
|
||||
(STR #2463)
|
||||
- The PostScript filter did not cleanly terminate when
|
||||
the job was canceled or stopped.
|
||||
- Fixed generation of Kerberos credentials for remote
|
||||
printing. Note that this requires a recent version of
|
||||
MIT Kerberos with a working krb5_cc_new_unique()
|
||||
function or Heimdal Kerberos.
|
||||
- Added Portuguese and updated Italian message catalogs.
|
||||
|
||||
|
||||
CHANGES IN CUPS V1.3rc2
|
||||
|
||||
- Added more range checking to the pdftops filter.
|
||||
- The scheduler would crash if a remote IPP queue was stopped
|
||||
(STR #2460)
|
||||
- The scheduler did not allow "DefaultAuthType None".
|
||||
|
||||
|
||||
CHANGES IN CUPS V1.3rc1
|
||||
|
||||
- Updated the German localization (STR #2443)
|
||||
|
||||
+4
-2
@@ -1,4 +1,4 @@
|
||||
CREDITS.txt - 2007-02-05
|
||||
CREDITS.txt - 2008-06-16
|
||||
------------------------
|
||||
|
||||
Few projects are completed by one person, and CUPS is no exception. We'd
|
||||
@@ -19,6 +19,7 @@ like to thank the following individuals for their contributions:
|
||||
Till Kamppeter - Bug fixes, beta testing, evangelism.
|
||||
Kenshi Muto - Japanese localization, patches, and
|
||||
testing.
|
||||
Tomohiro Kato - Japanese localization.
|
||||
Kiko - Bug fixes.
|
||||
Sergey V. Kovalyov - ESP Print Pro and CUPS beta tester.
|
||||
Marek Laane - Estonian translation.
|
||||
@@ -29,6 +30,7 @@ like to thank the following individuals for their contributions:
|
||||
Daniel Nylander - Swedish localization.
|
||||
Giulio Orsero - Bug fixes and testing.
|
||||
Michal Osowiecki - Polish localization.
|
||||
Citra Paska - Indonesian localization.
|
||||
Kurt Pfeifle - Bug fixes, beta testing, evangelism.
|
||||
Vincenzo Reale - Italian localization.
|
||||
Petter Reinholdtsen - HP-UX compiler stuff.
|
||||
@@ -36,7 +38,7 @@ like to thank the following individuals for their contributions:
|
||||
Opher Shachar - Hebrew localization.
|
||||
Stuart Stevens - HP JetDirect IPP information.
|
||||
Andrea Suatoni - IRIX desktop integration and testing.
|
||||
Tomohiro Kato - Japanese localization.
|
||||
Teppo Turlianen - Finnish localization.
|
||||
Tim Waugh - Lots of patches, testing, and Linux
|
||||
integration.
|
||||
Yugami - LDAP browsing support.
|
||||
|
||||
+15
-8
@@ -1,13 +1,15 @@
|
||||
INSTALL - CUPS v1.3rc1 - 2007-07-27
|
||||
-----------------------------------
|
||||
INSTALL - CUPS v1.3.9 - 2008-10-09
|
||||
----------------------------------
|
||||
|
||||
This file describes how to compile and install CUPS from source
|
||||
code. For more information on CUPS see the file called
|
||||
"README.txt". A complete change log can be found in
|
||||
"CHANGES.txt".
|
||||
|
||||
**** IF YOU HAVE A NON-POSTSCRIPT PRINTER, YOU WILL ALSO ****
|
||||
**** NEED TO INSTALL ESP GHOSTSCRIPT AFTER YOU INSTALL CUPS ****
|
||||
**** IF YOU HAVE A NON-POSTSCRIPT PRINTER AND ARE NOT ****
|
||||
**** RUNNING MAC OS X, YOU WILL ALSO NEED TO INSTALL GPL ****
|
||||
**** GHOSTSCRIPT WITH THE "cups" DRIVER AFTER YOU INSTALL ****
|
||||
**** CUPS. ****
|
||||
|
||||
|
||||
BEFORE YOU BEGIN
|
||||
@@ -20,7 +22,7 @@ BEFORE YOU BEGIN
|
||||
The makefiles used by the project should work with all
|
||||
versions of make. We've tested them with GNU make as well as
|
||||
the make programs shipped by Compaq, HP, SGI, and Sun.
|
||||
FreeBSD users should use GNU make (gmake).
|
||||
BSD users should use GNU make (gmake).
|
||||
|
||||
Besides these tools you'll want the JPEG, PNG, TIFF, and ZLIB
|
||||
libraries for image support, the CDSA, GNU TLS, or OpenSSL
|
||||
@@ -29,17 +31,22 @@ BEFORE YOU BEGIN
|
||||
compile and run without these, however you'll miss out on
|
||||
many of the features provided by CUPS.
|
||||
|
||||
Kerberos support requires MIT Kerberos 1.6.3 or later or
|
||||
Heimdal Kerberos, along with the corresponding GSSAPI
|
||||
pieces.
|
||||
|
||||
Also, please note that CUPS no longer includes the
|
||||
Ghostscript- based pstoraster filter. You *must* download
|
||||
ESP Ghostscript separately from the CUPS web site if you want
|
||||
to print PostScript files to non-PostScript printers.
|
||||
GPL Ghostscript separately from the CUPS web site if you want
|
||||
to print PostScript files to non-PostScript printers on
|
||||
operating systems other than Mac OS X.
|
||||
|
||||
|
||||
COMPILING FROM SUBVERSION
|
||||
|
||||
The CUPS Subversion repository doesn't hold a copy of the
|
||||
pre-built configure script. You'll need to run the GNU
|
||||
autoconf software (2.52 or higher) before compiling the
|
||||
autoconf software (2.60 or higher) before compiling the
|
||||
software from Subversion:
|
||||
|
||||
autoconf -f
|
||||
|
||||
+8
-8
@@ -3,7 +3,7 @@
|
||||
#
|
||||
# Common makefile definitions for the Common UNIX Printing System (CUPS).
|
||||
#
|
||||
# Copyright 2007 by Apple Inc.
|
||||
# Copyright 2007-2008 by Apple Inc.
|
||||
# Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs are the
|
||||
@@ -108,17 +108,17 @@ INSTALLSTATIC = @INSTALLSTATIC@
|
||||
# for extra debug info)
|
||||
#
|
||||
|
||||
ALL_CFLAGS = $(SSLFLAGS) @LARGEFILE@ @PTHREAD_FLAGS@ \
|
||||
$(OPTIONS) $(CFLAGS)
|
||||
ALL_CFLAGS = -I.. -D_CUPS_SOURCE $(CFLAGS) $(SSLFLAGS) \
|
||||
@LARGEFILE@ @PTHREAD_FLAGS@ $(OPTIONS)
|
||||
ALL_CXXFLAGS = -I.. -D_CUPS_SOURCE $(CXXFLAGS) $(SSLFLAGS) \
|
||||
@LARGEFILE@ @PTHREAD_FLAGS@ $(OPTIONS)
|
||||
ARCHFLAGS = @ARCHFLAGS@
|
||||
ARFLAGS = @ARFLAGS@
|
||||
BACKLIBS = @BACKLIBS@
|
||||
CFLAGS = -I.. @CPPFLAGS@ @CFLAGS@ \
|
||||
@LARGEFILE@ @PTHREAD_FLAGS@ $(OPTIONS)
|
||||
CFLAGS = @CPPFLAGS@ @CFLAGS@
|
||||
COMMONLIBS = @LIBS@
|
||||
CUPSDLIBS = @CUPSDLIBS@
|
||||
CXXFLAGS = -I.. $(SSLFLAGS) @CPPFLAGS@ @CXXFLAGS@ \
|
||||
@LARGEFILE@ @PTHREAD_FLAGS@ $(OPTIONS)
|
||||
CXXFLAGS = @CPPFLAGS@ @CXXFLAGS@
|
||||
CXXLIBS = @CXXLIBS@
|
||||
DSOFLAGS = @DSOFLAGS@
|
||||
DSOLIBS = @DSOLIBS@ $(COMMONLIBS)
|
||||
@@ -258,7 +258,7 @@ DBUSDIR = @DBUSDIR@
|
||||
|
||||
.cxx.o:
|
||||
echo Compiling $<...
|
||||
$(CXX) $(ARCHFLAGS) $(OPTIM) $(CXXFLAGS) -c $<
|
||||
$(CXX) $(ARCHFLAGS) $(OPTIM) $(ALL_CXXFLAGS) -c $<
|
||||
|
||||
.man.1 .man.1m .man.5 .man.7 .man.8:
|
||||
echo Linking $<...
|
||||
|
||||
+21
-7
@@ -3,7 +3,7 @@
|
||||
#
|
||||
# Top-level Makefile for the Common UNIX Printing System (CUPS).
|
||||
#
|
||||
# Copyright 2007 by Apple Inc.
|
||||
# Copyright 2007-2008 by Apple Inc.
|
||||
# Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs are the
|
||||
@@ -31,6 +31,10 @@ DIRS = cups backend berkeley cgi-bin filter locale man monitor \
|
||||
|
||||
all:
|
||||
chmod +x cups-config
|
||||
echo Using ALL_CFLAGS="$(ALL_CFLAGS)"
|
||||
echo Using ALL_CXXFLAGS="$(ALL_CXXFLAGS)"
|
||||
echo Using LDFLAGS="$(LDFLAGS)"
|
||||
echo Using LIBS="$(LIBS)"
|
||||
for dir in $(DIRS); do\
|
||||
echo Making all in $$dir... ;\
|
||||
(cd $$dir ; $(MAKE) $(MFLAGS)) || exit 1;\
|
||||
@@ -54,18 +58,17 @@ clean:
|
||||
|
||||
distclean: clean
|
||||
$(RM) Makedefs config.h config.log config.status
|
||||
$(RM) cups-config conf/cupsd.conf conf/pam.std
|
||||
$(RM) doc/help/ref-cupsd-conf.html doc/help/standard.html
|
||||
$(RM) doc/index.html
|
||||
$(RM) init/cups.sh init/cups-lpd
|
||||
$(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) init/cups.sh init/cups-lpd init/org.cups.cups-lpd.plist
|
||||
$(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/lpoptions.man
|
||||
$(RM) packaging/cups.list
|
||||
$(RM) templates/edit-config.tmpl templates/header.tmpl
|
||||
$(RM) templates/header.tmpl
|
||||
-$(RM) doc/*/index.html
|
||||
-$(RM) templates/*/edit-config.tmpl
|
||||
-$(RM) templates/*/header.tmpl
|
||||
-$(RM) -r autom4te*.cache
|
||||
|
||||
@@ -81,6 +84,17 @@ depend:
|
||||
done
|
||||
|
||||
|
||||
#
|
||||
# Run the clang.llvm.org static code analysis tool on the C sources.
|
||||
#
|
||||
|
||||
.PHONY: clang
|
||||
clang:
|
||||
$(RM) -r clang
|
||||
scan-build -k -o `pwd`/clang $(MAKE) $(MFLAGS) \
|
||||
CC=ccc-analyzer CXX=ccc-analyzer clean all
|
||||
|
||||
|
||||
#
|
||||
# Generate a ctags file...
|
||||
#
|
||||
|
||||
+10
-11
@@ -1,5 +1,5 @@
|
||||
README - CUPS v1.3rc1 - 2007-07-27
|
||||
----------------------------------
|
||||
README - CUPS v1.3.9 - 2008-10-09
|
||||
---------------------------------
|
||||
|
||||
Looking for compile instructions? Read the file "INSTALL.txt"
|
||||
instead...
|
||||
@@ -22,12 +22,11 @@ INTRODUCTION
|
||||
to support real-world printing under UNIX.
|
||||
|
||||
CUPS includes an image file RIP that supports printing of
|
||||
image files to non-PostScript printers. A customized version
|
||||
of GPL Ghostscript for CUPS called ESP Ghostscript is
|
||||
available separately to support printing of PostScript files
|
||||
within the CUPS driver framework. Sample drivers for Dymo,
|
||||
EPSON, HP, OKIDATA, and Zebra printers are included that use
|
||||
these filters.
|
||||
image files to non-PostScript printers. GPL Ghostscript now
|
||||
includes the "cups" driver to support printing of PostScript
|
||||
files within the CUPS driver framework. Sample drivers for
|
||||
Dymo, EPSON, HP, OKIDATA, and Zebra printers are included that
|
||||
use these filters.
|
||||
|
||||
CUPS is licensed under the GNU General Public License and GNU
|
||||
Library General Public License versions 2.
|
||||
@@ -154,9 +153,9 @@ PRINTING FILES
|
||||
|
||||
LEGAL STUFF
|
||||
|
||||
CUPS is Copyright 2007 by Apple Inc. CUPS, the CUPS logo, and
|
||||
the Common UNIX Printing System are the trademark property of
|
||||
Apple Inc.
|
||||
CUPS is Copyright 2007-2008 Apple Inc. All Rights Reserved.
|
||||
CUPS, the CUPS logo, and the Common UNIX Printing System are
|
||||
trademarks of Apple Inc.
|
||||
|
||||
The MD5 Digest code is Copyright 1999 Aladdin Enterprises.
|
||||
|
||||
|
||||
+43
-49
@@ -1,50 +1,44 @@
|
||||
# DO NOT DELETE THIS LINE -- make depend depends on it.
|
||||
betest.o: betest.c ../cups/string.h ../config.h
|
||||
ipp.o: ipp.c ../cups/http-private.h ../config.h ../cups/http.h \
|
||||
../cups/md5.h ../cups/ipp-private.h ../cups/ipp.h ../cups/backend.h \
|
||||
../cups/cups.h ../cups/ppd.h ../cups/array.h ../cups/file.h \
|
||||
../cups/language.h ../cups/language.h ../cups/i18n.h \
|
||||
../cups/transcode.h ../cups/string.h
|
||||
lpd.o: lpd.c ../cups/backend.h ../cups/http-private.h ../config.h \
|
||||
../cups/http.h ../cups/md5.h ../cups/ipp-private.h ../cups/ipp.h \
|
||||
../cups/cups.h ../cups/ppd.h ../cups/array.h ../cups/file.h \
|
||||
../cups/language.h ../cups/i18n.h ../cups/transcode.h ../cups/string.h
|
||||
pap.o: pap.c ../config.h ../cups/cups.h ../cups/ipp.h ../cups/http.h \
|
||||
../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h \
|
||||
../cups/backend.h ../cups/sidechannel.h ../cups/i18n.h \
|
||||
../cups/transcode.h
|
||||
parallel.o: parallel.c backend-private.h ../cups/backend.h \
|
||||
../cups/sidechannel.h ../cups/cups.h ../cups/ipp.h ../cups/http.h \
|
||||
../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h \
|
||||
../cups/debug.h ../cups/i18n.h ../cups/transcode.h ../cups/string.h \
|
||||
../config.h
|
||||
scsi.o: scsi.c ../cups/backend.h ../cups/cups.h ../cups/ipp.h \
|
||||
../cups/http.h ../cups/ppd.h ../cups/array.h ../cups/file.h \
|
||||
../cups/language.h ../cups/i18n.h ../cups/transcode.h ../cups/string.h \
|
||||
../config.h scsi-linux.c
|
||||
serial.o: serial.c backend-private.h ../cups/backend.h \
|
||||
../cups/sidechannel.h ../cups/cups.h ../cups/ipp.h ../cups/http.h \
|
||||
../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h \
|
||||
../cups/debug.h ../cups/i18n.h ../cups/transcode.h ../cups/string.h \
|
||||
../config.h
|
||||
snmp.o: snmp.c ../cups/http-private.h ../config.h ../cups/http.h \
|
||||
../cups/md5.h ../cups/ipp-private.h ../cups/ipp.h backend-private.h \
|
||||
../cups/backend.h ../cups/sidechannel.h ../cups/cups.h ../cups/ppd.h \
|
||||
../cups/array.h ../cups/file.h ../cups/language.h ../cups/debug.h \
|
||||
../cups/i18n.h ../cups/transcode.h ../cups/string.h ../cups/array.h \
|
||||
../cups/file.h
|
||||
socket.o: socket.c ../cups/http-private.h ../config.h ../cups/http.h \
|
||||
../cups/md5.h ../cups/ipp-private.h ../cups/ipp.h backend-private.h \
|
||||
../cups/backend.h ../cups/sidechannel.h ../cups/cups.h ../cups/ppd.h \
|
||||
../cups/array.h ../cups/file.h ../cups/language.h ../cups/debug.h \
|
||||
../cups/i18n.h ../cups/transcode.h ../cups/string.h
|
||||
test1284.o: test1284.c ../cups/string.h ../config.h ieee1284.c \
|
||||
backend-private.h ../cups/backend.h ../cups/sidechannel.h \
|
||||
../cups/cups.h ../cups/ipp.h ../cups/http.h ../cups/ppd.h \
|
||||
../cups/array.h ../cups/file.h ../cups/language.h ../cups/debug.h \
|
||||
../cups/i18n.h ../cups/transcode.h
|
||||
usb.o: usb.c ../cups/backend.h ../cups/cups.h ../cups/ipp.h \
|
||||
../cups/http.h ../cups/ppd.h ../cups/array.h ../cups/file.h \
|
||||
../cups/language.h ../cups/string.h ../config.h ../cups/i18n.h \
|
||||
../cups/transcode.h usb-unix.c ieee1284.c backend-private.h \
|
||||
../cups/sidechannel.h ../cups/debug.h
|
||||
|
||||
betest.o: ../cups/string.h ../config.h
|
||||
ipp.o: ../cups/http-private.h ../config.h ../cups/http.h ../cups/md5.h
|
||||
ipp.o: ../cups/ipp-private.h ../cups/ipp.h ../cups/backend.h ../cups/cups.h
|
||||
ipp.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h
|
||||
ipp.o: ../cups/language.h ../cups/i18n.h ../cups/transcode.h ../cups/string.h
|
||||
lpd.o: ../cups/backend.h ../cups/http-private.h ../config.h ../cups/http.h
|
||||
lpd.o: ../cups/md5.h ../cups/ipp-private.h ../cups/ipp.h ../cups/cups.h
|
||||
lpd.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h
|
||||
lpd.o: ../cups/i18n.h ../cups/transcode.h ../cups/string.h
|
||||
pap.o: ../config.h ../cups/cups.h ../cups/ipp.h ../cups/http.h ../cups/ppd.h
|
||||
pap.o: ../cups/array.h ../cups/file.h ../cups/language.h ../cups/backend.h
|
||||
pap.o: ../cups/sidechannel.h ../cups/i18n.h ../cups/transcode.h
|
||||
parallel.o: backend-private.h ../cups/backend.h ../cups/sidechannel.h
|
||||
parallel.o: ../cups/cups.h ../cups/ipp.h ../cups/http.h ../cups/ppd.h
|
||||
parallel.o: ../cups/array.h ../cups/file.h ../cups/language.h ../cups/debug.h
|
||||
parallel.o: ../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h
|
||||
scsi.o: ../cups/backend.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
|
||||
scsi.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h
|
||||
scsi.o: ../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h
|
||||
serial.o: backend-private.h ../cups/backend.h ../cups/sidechannel.h
|
||||
serial.o: ../cups/cups.h ../cups/ipp.h ../cups/http.h ../cups/ppd.h
|
||||
serial.o: ../cups/array.h ../cups/file.h ../cups/language.h ../cups/debug.h
|
||||
serial.o: ../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h
|
||||
snmp.o: ../cups/http-private.h ../config.h ../cups/http.h ../cups/md5.h
|
||||
snmp.o: ../cups/ipp-private.h ../cups/ipp.h backend-private.h
|
||||
snmp.o: ../cups/backend.h ../cups/sidechannel.h ../cups/cups.h ../cups/ppd.h
|
||||
snmp.o: ../cups/array.h ../cups/file.h ../cups/language.h ../cups/debug.h
|
||||
snmp.o: ../cups/i18n.h ../cups/transcode.h ../cups/string.h ../cups/array.h
|
||||
snmp.o: ../cups/file.h
|
||||
socket.o: ../cups/http-private.h ../config.h ../cups/http.h ../cups/md5.h
|
||||
socket.o: ../cups/ipp-private.h ../cups/ipp.h backend-private.h
|
||||
socket.o: ../cups/backend.h ../cups/sidechannel.h ../cups/cups.h
|
||||
socket.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h
|
||||
socket.o: ../cups/debug.h ../cups/i18n.h ../cups/transcode.h ../cups/string.h
|
||||
test1284.o: ../cups/string.h ../config.h ieee1284.c backend-private.h
|
||||
test1284.o: ../cups/backend.h ../cups/sidechannel.h ../cups/cups.h
|
||||
test1284.o: ../cups/ipp.h ../cups/http.h ../cups/ppd.h ../cups/array.h
|
||||
test1284.o: ../cups/file.h ../cups/language.h ../cups/debug.h ../cups/i18n.h
|
||||
test1284.o: ../cups/transcode.h
|
||||
usb.o: ../cups/backend.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
|
||||
usb.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h
|
||||
usb.o: ../cups/string.h ../config.h ../cups/i18n.h ../cups/transcode.h
|
||||
|
||||
+2
-2
@@ -17,8 +17,8 @@
|
||||
|
||||
include ../Makedefs
|
||||
|
||||
RBACKENDS = lpd
|
||||
UBACKENDS = ipp $(PAP) $(LEGACY_BACKENDS) serial snmp socket usb
|
||||
RBACKENDS = ipp lpd
|
||||
UBACKENDS = $(PAP) $(LEGACY_BACKENDS) serial snmp socket usb
|
||||
TARGETS = betest test1284 libbackend.a $(RBACKENDS) $(UBACKENDS)
|
||||
LIBOBJS = ieee1284.o runloop.o
|
||||
OBJS = betest.o ipp.o lpd.o pap.o parallel.o scsi.o \
|
||||
|
||||
+143
-18
@@ -32,6 +32,10 @@
|
||||
# include <linux/lp.h>
|
||||
# define IOCNR_GET_DEVICE_ID 1
|
||||
# define LPIOC_GET_DEVICE_ID(len) _IOC(_IOC_READ, 'P', IOCNR_GET_DEVICE_ID, len)
|
||||
# include <linux/parport.h>
|
||||
# include <linux/ppdev.h>
|
||||
# include <unistd.h>
|
||||
# include <fcntl.h>
|
||||
#endif /* __linux */
|
||||
|
||||
#ifdef __sun
|
||||
@@ -60,18 +64,23 @@ backendGetDeviceID(
|
||||
char *uri, /* O - Device URI */
|
||||
int uri_size) /* I - Size of buffer */
|
||||
{
|
||||
#ifdef __APPLE__ /* This function is a no-op */
|
||||
return (-1);
|
||||
|
||||
#else /* Get the device ID from the specified file descriptor... */
|
||||
char *attr, /* 1284 attribute */
|
||||
*delim, /* 1284 delimiter */
|
||||
*uriptr, /* Pointer into URI */
|
||||
manufacturer[256], /* Manufacturer string */
|
||||
serial_number[1024]; /* Serial number string */
|
||||
int manulen; /* Length of manufacturer string */
|
||||
#ifdef __linux
|
||||
# ifdef __linux
|
||||
int length; /* Length of device ID info */
|
||||
#endif /* __linux */
|
||||
#if defined(__sun) && defined(ECPPIOC_GETDEVID)
|
||||
int got_id = 0;
|
||||
# endif /* __linux */
|
||||
# if defined(__sun) && defined(ECPPIOC_GETDEVID)
|
||||
struct ecpp_device_id did; /* Device ID buffer */
|
||||
#endif /* __sun && ECPPIOC_GETDEVID */
|
||||
# endif /* __sun && ECPPIOC_GETDEVID */
|
||||
|
||||
|
||||
DEBUG_printf(("backendGetDeviceID(fd=%d, device_id=%p, device_id_size=%d, "
|
||||
@@ -93,9 +102,6 @@ backendGetDeviceID(
|
||||
if (make_model)
|
||||
*make_model = '\0';
|
||||
|
||||
if (uri)
|
||||
*uri = '\0';
|
||||
|
||||
if (fd >= 0)
|
||||
{
|
||||
/*
|
||||
@@ -104,8 +110,83 @@ backendGetDeviceID(
|
||||
|
||||
*device_id = '\0';
|
||||
|
||||
#ifdef __linux
|
||||
if (!ioctl(fd, LPIOC_GET_DEVICE_ID(device_id_size), device_id))
|
||||
# ifdef __linux
|
||||
if (ioctl(fd, LPIOC_GET_DEVICE_ID(device_id_size), device_id))
|
||||
{
|
||||
/*
|
||||
* Linux has to implement things differently for every device it seems.
|
||||
* Since the standard parallel port driver does not provide a simple
|
||||
* ioctl() to get the 1284 device ID, we have to open the "raw" parallel
|
||||
* device corresponding to this port and do some negotiation trickery
|
||||
* to get the current device ID.
|
||||
*/
|
||||
|
||||
if (uri && !strncmp(uri, "parallel:/dev/", 14))
|
||||
{
|
||||
char devparport[16]; /* /dev/parportN */
|
||||
int devparportfd, /* File descriptor for raw device */
|
||||
mode; /* Port mode */
|
||||
|
||||
|
||||
/*
|
||||
* Since the Linux parallel backend only supports 4 parallel port
|
||||
* devices, just grab the trailing digit and use it to construct a
|
||||
* /dev/parportN filename...
|
||||
*/
|
||||
|
||||
snprintf(devparport, sizeof(devparport), "/dev/parport%s",
|
||||
uri + strlen(uri) - 1);
|
||||
|
||||
if ((devparportfd = open(devparport, O_RDWR | O_NOCTTY)) != -1)
|
||||
{
|
||||
/*
|
||||
* Claim the device...
|
||||
*/
|
||||
|
||||
if (!ioctl(devparportfd, PPCLAIM))
|
||||
{
|
||||
fcntl(devparportfd, F_SETFL, fcntl(devparportfd, F_GETFL) | O_NONBLOCK);
|
||||
|
||||
mode = IEEE1284_MODE_COMPAT;
|
||||
|
||||
if (!ioctl(devparportfd, PPNEGOT, &mode))
|
||||
{
|
||||
/*
|
||||
* Put the device into Device ID mode...
|
||||
*/
|
||||
|
||||
mode = IEEE1284_MODE_NIBBLE | IEEE1284_DEVICEID;
|
||||
|
||||
if (!ioctl(devparportfd, PPNEGOT, &mode))
|
||||
{
|
||||
/*
|
||||
* Read the 1284 device ID...
|
||||
*/
|
||||
|
||||
if ((length = read(devparportfd, device_id,
|
||||
device_id_size - 1)) >= 2)
|
||||
{
|
||||
device_id[length] = '\0';
|
||||
got_id = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Release the device...
|
||||
*/
|
||||
|
||||
ioctl(devparportfd, PPRELEASE);
|
||||
}
|
||||
|
||||
close(devparportfd);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
got_id = 1;
|
||||
|
||||
if (got_id)
|
||||
{
|
||||
/*
|
||||
* Extract the length of the device ID string from the first two
|
||||
@@ -136,13 +217,13 @@ backendGetDeviceID(
|
||||
memmove(device_id, device_id + 2, length);
|
||||
device_id[length] = '\0';
|
||||
}
|
||||
# ifdef DEBUG
|
||||
# ifdef DEBUG
|
||||
else
|
||||
printf("backendGetDeviceID: ioctl failed - %s\n", strerror(errno));
|
||||
# endif /* DEBUG */
|
||||
#endif /* __linux */
|
||||
# endif /* DEBUG */
|
||||
# endif /* __linux */
|
||||
|
||||
#if defined(__sun) && defined(ECPPIOC_GETDEVID)
|
||||
# if defined(__sun) && defined(ECPPIOC_GETDEVID)
|
||||
did.mode = ECPP_CENTRONICS;
|
||||
did.len = device_id_size - 1;
|
||||
did.rlen = 0;
|
||||
@@ -159,15 +240,18 @@ backendGetDeviceID(
|
||||
else
|
||||
device_id[device_id_size - 1] = '\0';
|
||||
}
|
||||
# ifdef DEBUG
|
||||
# ifdef DEBUG
|
||||
else
|
||||
printf("backendGetDeviceID: ioctl failed - %s\n", strerror(errno));
|
||||
# endif /* DEBUG */
|
||||
#endif /* __sun && ECPPIOC_GETDEVID */
|
||||
# endif /* DEBUG */
|
||||
# endif /* __sun && ECPPIOC_GETDEVID */
|
||||
}
|
||||
|
||||
DEBUG_printf(("backendGetDeviceID: device_id=\"%s\"\n", device_id));
|
||||
|
||||
if (scheme && uri)
|
||||
*uri = '\0';
|
||||
|
||||
if (!*device_id)
|
||||
return (-1);
|
||||
|
||||
@@ -289,6 +373,7 @@ backendGetDeviceID(
|
||||
}
|
||||
|
||||
return (0);
|
||||
#endif /* __APPLE__ */
|
||||
}
|
||||
|
||||
|
||||
@@ -394,15 +479,41 @@ backendGetMakeModel(
|
||||
|
||||
if (mfg)
|
||||
{
|
||||
/*
|
||||
* Skip leading whitespace...
|
||||
*/
|
||||
|
||||
while (isspace(*mfg & 255))
|
||||
mfg ++;
|
||||
|
||||
/*
|
||||
* Map common bad names to the ones we use for driver selection...
|
||||
*/
|
||||
|
||||
if (!strncasecmp(mfg, "Hewlett-Packard", 15))
|
||||
strlcpy(make_model, "HP", make_model_size);
|
||||
else if (!strncasecmp(mfg, "Lexmark International", 21))
|
||||
strlcpy(make_model, "Lexmark", make_model_size);
|
||||
else
|
||||
{
|
||||
/*
|
||||
* Use the manufacturer that is supplied...
|
||||
*/
|
||||
|
||||
strlcpy(make_model, mfg, make_model_size);
|
||||
|
||||
if ((delim = strchr(make_model, ';')) != NULL)
|
||||
*delim = '\0';
|
||||
if ((delim = strchr(make_model, ';')) != NULL)
|
||||
*delim = '\0';
|
||||
|
||||
/*
|
||||
* But strip trailing whitespace...
|
||||
*/
|
||||
|
||||
for (delim = make_model + strlen(make_model) - 1;
|
||||
delim > make_model && *delim == ' ';
|
||||
delim --)
|
||||
*delim = '\0';
|
||||
}
|
||||
|
||||
if (!strncasecmp(make_model, mdl, strlen(make_model)))
|
||||
{
|
||||
@@ -418,6 +529,9 @@ backendGetMakeModel(
|
||||
* Concatenate the make and model...
|
||||
*/
|
||||
|
||||
while (isspace(*mdl & 255))
|
||||
mdl ++;
|
||||
|
||||
strlcat(make_model, " ", make_model_size);
|
||||
strlcat(make_model, mdl, make_model_size);
|
||||
}
|
||||
@@ -428,6 +542,9 @@ backendGetMakeModel(
|
||||
* Just copy model string, since it has the manufacturer...
|
||||
*/
|
||||
|
||||
while (isspace(*mdl & 255))
|
||||
mdl ++;
|
||||
|
||||
strlcpy(make_model, mdl, make_model_size);
|
||||
}
|
||||
}
|
||||
@@ -437,6 +554,9 @@ backendGetMakeModel(
|
||||
* Use description...
|
||||
*/
|
||||
|
||||
while (isspace(*attr & 255))
|
||||
attr ++;
|
||||
|
||||
if (!strncasecmp(attr, "Hewlett-Packard hp ", 19))
|
||||
{
|
||||
/*
|
||||
@@ -472,6 +592,11 @@ backendGetMakeModel(
|
||||
if ((delim = strchr(make_model, ';')) != NULL)
|
||||
*delim = '\0';
|
||||
|
||||
for (delim = make_model + strlen(make_model) - 1;
|
||||
delim > make_model && *delim == ' ';
|
||||
delim --)
|
||||
*delim = '\0';
|
||||
|
||||
/*
|
||||
* Strip trailing whitespace...
|
||||
*/
|
||||
|
||||
+310
-153
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* IPP backend for the Common UNIX Printing System (CUPS).
|
||||
*
|
||||
* Copyright 2007 by Apple Inc.
|
||||
* Copyright 2007-2008 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -22,6 +22,7 @@
|
||||
* compress_files() - Compress print files...
|
||||
* password_cb() - Disable the password prompt for
|
||||
* cupsDoFileRequest().
|
||||
* report_attr() - Report an IPP attribute value.
|
||||
* report_printer_state() - Report the printer state.
|
||||
* run_pictwps_filter() - Convert PICT files to PostScript when printing
|
||||
* remotely.
|
||||
@@ -51,6 +52,7 @@
|
||||
*/
|
||||
|
||||
static char *password = NULL; /* Password for device URI */
|
||||
static int password_tries = 0; /* Password tries */
|
||||
#ifdef __APPLE__
|
||||
static char pstmpname[1024] = ""; /* Temporary PostScript file name */
|
||||
#endif /* __APPLE__ */
|
||||
@@ -66,12 +68,13 @@ static void cancel_job(http_t *http, const char *uri, int id,
|
||||
const char *resource, const char *user, int version);
|
||||
static void check_printer_state(http_t *http, const char *uri,
|
||||
const char *resource, const char *user,
|
||||
int version);
|
||||
int version, int job_id);
|
||||
#ifdef HAVE_LIBZ
|
||||
static void compress_files(int num_files, char **files);
|
||||
#endif /* HAVE_LIBZ */
|
||||
static const char *password_cb(const char *);
|
||||
static int report_printer_state(ipp_t *ipp);
|
||||
static void report_attr(ipp_attribute_t *attr);
|
||||
static int report_printer_state(ipp_t *ipp, int job_id);
|
||||
|
||||
#ifdef __APPLE__
|
||||
static int run_pictwps_filter(char **argv, const char *filename);
|
||||
@@ -101,9 +104,9 @@ main(int argc, /* I - Number of command-line args */
|
||||
resource[1024], /* Resource info (printer name) */
|
||||
addrname[256], /* Address name */
|
||||
*optptr, /* Pointer to URI options */
|
||||
name[255], /* Name of option */
|
||||
value[255], /* Value of option */
|
||||
*ptr; /* Pointer into name or value */
|
||||
*name, /* Name of option */
|
||||
*value, /* Value of option */
|
||||
sep; /* Separator character */
|
||||
int num_files; /* Number of files to print */
|
||||
char **files, /* Files to print */
|
||||
*filename; /* Pointer to single filename */
|
||||
@@ -131,7 +134,8 @@ main(int argc, /* I - Number of command-line args */
|
||||
ipp_attribute_t *printer_accepting; /* printer-is-accepting-jobs */
|
||||
int copies, /* Number of copies for job */
|
||||
copies_remaining; /* Number of copies remaining */
|
||||
const char *content_type; /* CONTENT_TYPE environment variable */
|
||||
const char *content_type, /* CONTENT_TYPE environment variable */
|
||||
*final_content_type; /* FINAL_CONTENT_TYPE environment var */
|
||||
#if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET)
|
||||
struct sigaction action; /* Actions for POSIX signals */
|
||||
#endif /* HAVE_SIGACTION && !HAVE_SIGSET */
|
||||
@@ -140,6 +144,11 @@ main(int argc, /* I - Number of command-line args */
|
||||
{ /* Printer attributes we want */
|
||||
"copies-supported",
|
||||
"document-format-supported",
|
||||
"marker-colors",
|
||||
"marker-levels",
|
||||
"marker-message",
|
||||
"marker-names",
|
||||
"marker-types",
|
||||
"printer-is-accepting-jobs",
|
||||
"printer-state",
|
||||
"printer-state-message",
|
||||
@@ -198,8 +207,9 @@ main(int argc, /* I - Number of command-line args */
|
||||
}
|
||||
else if (argc < 6)
|
||||
{
|
||||
fprintf(stderr, _("Usage: %s job-id user title copies options [file]\n"),
|
||||
argv[0]);
|
||||
_cupsLangPrintf(stderr,
|
||||
_("Usage: %s job-id user title copies options [file]\n"),
|
||||
argv[0]);
|
||||
return (CUPS_BACKEND_STOP);
|
||||
}
|
||||
|
||||
@@ -207,12 +217,16 @@ main(int argc, /* I - Number of command-line args */
|
||||
* Get the (final) content type...
|
||||
*/
|
||||
|
||||
if ((content_type = getenv("FINAL_CONTENT_TYPE")) == NULL)
|
||||
if ((content_type = getenv("CONTENT_TYPE")) == NULL)
|
||||
content_type = "application/octet-stream";
|
||||
if ((content_type = getenv("CONTENT_TYPE")) == NULL)
|
||||
content_type = "application/octet-stream";
|
||||
|
||||
if (!strncmp(content_type, "printer/", 8))
|
||||
content_type = "application/vnd.cups-raw";
|
||||
if ((final_content_type = getenv("FINAL_CONTENT_TYPE")) == NULL)
|
||||
{
|
||||
final_content_type = content_type;
|
||||
|
||||
if (!strncmp(final_content_type, "printer/", 8))
|
||||
final_content_type = "application/vnd.cups-raw";
|
||||
}
|
||||
|
||||
/*
|
||||
* Extract the hostname and printer name from the URI...
|
||||
@@ -223,11 +237,15 @@ main(int argc, /* I - Number of command-line args */
|
||||
hostname, sizeof(hostname), &port,
|
||||
resource, sizeof(resource)) < HTTP_URI_OK)
|
||||
{
|
||||
fputs(_("ERROR: Missing device URI on command-line and no "
|
||||
"DEVICE_URI environment variable!\n"), stderr);
|
||||
_cupsLangPuts(stderr,
|
||||
_("ERROR: Missing device URI on command-line and no "
|
||||
"DEVICE_URI environment variable!\n"));
|
||||
return (CUPS_BACKEND_STOP);
|
||||
}
|
||||
|
||||
if (!port)
|
||||
port = IPP_PORT; /* Default to port 631 */
|
||||
|
||||
if (!strcmp(method, "https"))
|
||||
cupsSetEncryption(HTTP_ENCRYPT_ALWAYS);
|
||||
else
|
||||
@@ -262,29 +280,30 @@ main(int argc, /* I - Number of command-line args */
|
||||
* Get the name...
|
||||
*/
|
||||
|
||||
for (ptr = name; *optptr && *optptr != '=';)
|
||||
if (ptr < (name + sizeof(name) - 1))
|
||||
*ptr++ = *optptr++;
|
||||
*ptr = '\0';
|
||||
name = optptr;
|
||||
|
||||
if (*optptr == '=')
|
||||
while (*optptr && *optptr != '=' && *optptr != '+' && *optptr != '&')
|
||||
optptr ++;
|
||||
|
||||
if ((sep = *optptr) != '\0')
|
||||
*optptr++ = '\0';
|
||||
|
||||
if (sep == '=')
|
||||
{
|
||||
/*
|
||||
* Get the value...
|
||||
*/
|
||||
|
||||
optptr ++;
|
||||
value = optptr;
|
||||
|
||||
for (ptr = value; *optptr && *optptr != '+' && *optptr != '&';)
|
||||
if (ptr < (value + sizeof(value) - 1))
|
||||
*ptr++ = *optptr++;
|
||||
*ptr = '\0';
|
||||
|
||||
if (*optptr == '+' || *optptr == '&')
|
||||
while (*optptr && *optptr != '+' && *optptr != '&')
|
||||
optptr ++;
|
||||
|
||||
if (*optptr)
|
||||
*optptr++ = '\0';
|
||||
}
|
||||
else
|
||||
value[0] = '\0';
|
||||
value = (char *)"";
|
||||
|
||||
/*
|
||||
* Process the option...
|
||||
@@ -326,7 +345,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
cupsSetEncryption(HTTP_ENCRYPT_IF_REQUESTED);
|
||||
else
|
||||
{
|
||||
fprintf(stderr,
|
||||
_cupsLangPrintf(stderr,
|
||||
_("ERROR: Unknown encryption option value \"%s\"!\n"),
|
||||
value);
|
||||
}
|
||||
@@ -339,7 +358,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
version = 1;
|
||||
else
|
||||
{
|
||||
fprintf(stderr,
|
||||
_cupsLangPrintf(stderr,
|
||||
_("ERROR: Unknown version option value \"%s\"!\n"),
|
||||
value);
|
||||
}
|
||||
@@ -368,8 +387,9 @@ main(int argc, /* I - Number of command-line args */
|
||||
* Unknown option...
|
||||
*/
|
||||
|
||||
fprintf(stderr, _("ERROR: Unknown option \"%s\" with value \"%s\"!\n"),
|
||||
name, value);
|
||||
_cupsLangPrintf(stderr,
|
||||
_("ERROR: Unknown option \"%s\" with value \"%s\"!\n"),
|
||||
name, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -421,10 +441,9 @@ main(int argc, /* I - Number of command-line args */
|
||||
* Point to the single file from stdin...
|
||||
*/
|
||||
|
||||
filename = tmpfilename;
|
||||
files = &filename;
|
||||
num_files = 1;
|
||||
|
||||
filename = tmpfilename;
|
||||
num_files = 1;
|
||||
files = &filename;
|
||||
send_options = 0;
|
||||
}
|
||||
else
|
||||
@@ -433,10 +452,9 @@ main(int argc, /* I - Number of command-line args */
|
||||
* Point to the files on the command-line...
|
||||
*/
|
||||
|
||||
num_files = argc - 6;
|
||||
files = argv + 6;
|
||||
|
||||
send_options = strncasecmp(content_type, "application/vnd.cups-", 21) != 0;
|
||||
num_files = argc - 6;
|
||||
files = argv + 6;
|
||||
send_options = 1;
|
||||
|
||||
#ifdef HAVE_LIBZ
|
||||
if (compression)
|
||||
@@ -469,7 +487,9 @@ main(int argc, /* I - Number of command-line args */
|
||||
* Try loading authentication information from the environment.
|
||||
*/
|
||||
|
||||
if ((ptr = getenv("AUTH_USERNAME")) != NULL)
|
||||
const char *ptr = getenv("AUTH_USERNAME");
|
||||
|
||||
if (ptr)
|
||||
cupsSetUser(ptr);
|
||||
|
||||
password = getenv("AUTH_PASSWORD");
|
||||
@@ -487,8 +507,8 @@ main(int argc, /* I - Number of command-line args */
|
||||
|
||||
do
|
||||
{
|
||||
fprintf(stderr, _("INFO: Connecting to %s on port %d...\n"),
|
||||
hostname, port);
|
||||
_cupsLangPrintf(stderr, _("INFO: Connecting to %s on port %d...\n"),
|
||||
hostname, port);
|
||||
|
||||
if ((http = httpConnectEncrypt(hostname, port, cupsEncryption())) == NULL)
|
||||
{
|
||||
@@ -504,11 +524,12 @@ main(int argc, /* I - Number of command-line args */
|
||||
* available printer in the class.
|
||||
*/
|
||||
|
||||
fputs(_("INFO: Unable to contact printer, queuing on next "
|
||||
"printer in class...\n"), stderr);
|
||||
_cupsLangPuts(stderr,
|
||||
_("INFO: Unable to contact printer, queuing on next "
|
||||
"printer in class...\n"));
|
||||
|
||||
if (argc == 6 || strcmp(filename, argv[6]))
|
||||
unlink(filename);
|
||||
if (tmpfilename[0])
|
||||
unlink(tmpfilename);
|
||||
|
||||
/*
|
||||
* Sleep 5 seconds to keep the job from requeuing too rapidly...
|
||||
@@ -524,16 +545,16 @@ main(int argc, /* I - Number of command-line args */
|
||||
{
|
||||
if (contimeout && (time(NULL) - start_time) > contimeout)
|
||||
{
|
||||
fputs(_("ERROR: Printer not responding!\n"), stderr);
|
||||
_cupsLangPuts(stderr, _("ERROR: Printer not responding!\n"));
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
|
||||
recoverable = 1;
|
||||
|
||||
fprintf(stderr,
|
||||
_("WARNING: recoverable: Network host \'%s\' is busy; will "
|
||||
"retry in %d seconds...\n"),
|
||||
hostname, delay);
|
||||
_cupsLangPrintf(stderr,
|
||||
_("WARNING: recoverable: Network host \'%s\' is busy; "
|
||||
"will retry in %d seconds...\n"),
|
||||
hostname, delay);
|
||||
|
||||
sleep(delay);
|
||||
|
||||
@@ -542,8 +563,8 @@ main(int argc, /* I - Number of command-line args */
|
||||
}
|
||||
else if (h_errno)
|
||||
{
|
||||
fprintf(stderr, _("ERROR: Unable to locate printer \'%s\'!\n"),
|
||||
hostname);
|
||||
_cupsLangPrintf(stderr, _("ERROR: Unable to locate printer \'%s\'!\n"),
|
||||
hostname);
|
||||
return (CUPS_BACKEND_STOP);
|
||||
}
|
||||
else
|
||||
@@ -551,8 +572,9 @@ main(int argc, /* I - Number of command-line args */
|
||||
recoverable = 1;
|
||||
|
||||
fprintf(stderr, "DEBUG: Connection error: %s\n", strerror(errno));
|
||||
fputs(_("ERROR: recoverable: Unable to connect to printer; will "
|
||||
"retry in 30 seconds...\n"), stderr);
|
||||
_cupsLangPuts(stderr,
|
||||
_("ERROR: recoverable: Unable to connect to printer; will "
|
||||
"retry in 30 seconds...\n"));
|
||||
sleep(30);
|
||||
}
|
||||
|
||||
@@ -564,14 +586,14 @@ main(int argc, /* I - Number of command-line args */
|
||||
|
||||
if (job_cancelled)
|
||||
{
|
||||
if (argc == 6 || strcmp(filename, argv[6]))
|
||||
unlink(filename);
|
||||
if (tmpfilename[0])
|
||||
unlink(tmpfilename);
|
||||
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
|
||||
fputs("STATE: -connecting-to-device\n", stderr);
|
||||
fprintf(stderr, _("INFO: Connected to %s...\n"), hostname);
|
||||
_cupsLangPrintf(stderr, _("INFO: Connected to %s...\n"), hostname);
|
||||
|
||||
#ifdef AF_INET6
|
||||
if (http->hostaddr->addr.sa_family == AF_INET6)
|
||||
@@ -637,18 +659,18 @@ main(int argc, /* I - Number of command-line args */
|
||||
{
|
||||
if (contimeout && (time(NULL) - start_time) > contimeout)
|
||||
{
|
||||
fputs(_("ERROR: Printer not responding!\n"), stderr);
|
||||
_cupsLangPuts(stderr, _("ERROR: Printer not responding!\n"));
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
|
||||
recoverable = 1;
|
||||
|
||||
fprintf(stderr,
|
||||
_("WARNING: recoverable: Network host \'%s\' is busy; will "
|
||||
"retry in %d seconds...\n"),
|
||||
hostname, delay);
|
||||
_cupsLangPrintf(stderr,
|
||||
_("WARNING: recoverable: Network host \'%s\' is busy; "
|
||||
"will retry in %d seconds...\n"),
|
||||
hostname, delay);
|
||||
|
||||
report_printer_state(supported);
|
||||
report_printer_state(supported, 0);
|
||||
|
||||
sleep(delay);
|
||||
|
||||
@@ -662,14 +684,15 @@ main(int argc, /* I - Number of command-line args */
|
||||
* Switch to IPP/1.0...
|
||||
*/
|
||||
|
||||
fputs(_("INFO: Printer does not support IPP/1.1, trying IPP/1.0...\n"),
|
||||
stderr);
|
||||
_cupsLangPuts(stderr,
|
||||
_("INFO: Printer does not support IPP/1.1, trying "
|
||||
"IPP/1.0...\n"));
|
||||
version = 0;
|
||||
httpReconnect(http);
|
||||
}
|
||||
else if (ipp_status == IPP_NOT_FOUND)
|
||||
{
|
||||
fputs(_("ERROR: Destination printer does not exist!\n"), stderr);
|
||||
_cupsLangPuts(stderr, _("ERROR: Destination printer does not exist!\n"));
|
||||
|
||||
if (supported)
|
||||
ippDelete(supported);
|
||||
@@ -678,8 +701,9 @@ main(int argc, /* I - Number of command-line args */
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf(stderr, _("ERROR: Unable to get printer status (%s)!\n"),
|
||||
cupsLastErrorString());
|
||||
_cupsLangPrintf(stderr,
|
||||
_("ERROR: Unable to get printer status (%s)!\n"),
|
||||
cupsLastErrorString());
|
||||
sleep(10);
|
||||
}
|
||||
|
||||
@@ -712,7 +736,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
format_sup->values[i].string.text);
|
||||
}
|
||||
|
||||
report_printer_state(supported);
|
||||
report_printer_state(supported, 0);
|
||||
}
|
||||
while (ipp_status > IPP_OK_CONFLICT);
|
||||
|
||||
@@ -741,14 +765,15 @@ main(int argc, /* I - Number of command-line args */
|
||||
* available printer in the class.
|
||||
*/
|
||||
|
||||
fputs(_("INFO: Unable to contact printer, queuing on next "
|
||||
"printer in class...\n"), stderr);
|
||||
_cupsLangPuts(stderr,
|
||||
_("INFO: Unable to contact printer, queuing on next "
|
||||
"printer in class...\n"));
|
||||
|
||||
ippDelete(supported);
|
||||
httpClose(http);
|
||||
|
||||
if (argc == 6 || strcmp(filename, argv[6]))
|
||||
unlink(filename);
|
||||
if (tmpfilename[0])
|
||||
unlink(tmpfilename);
|
||||
|
||||
/*
|
||||
* Sleep 5 seconds to keep the job from requeuing too rapidly...
|
||||
@@ -847,13 +872,13 @@ main(int argc, /* I - Number of command-line args */
|
||||
num_options = cupsParseOptions(argv[5], 0, &options);
|
||||
|
||||
#ifdef __APPLE__
|
||||
if (content_type != NULL &&
|
||||
!strcasecmp(content_type, "application/pictwps") && num_files == 1)
|
||||
if (!strcasecmp(final_content_type, "application/pictwps") &&
|
||||
num_files == 1)
|
||||
{
|
||||
if (format_sup != NULL)
|
||||
{
|
||||
for (i = 0; i < format_sup->num_values; i ++)
|
||||
if (!strcasecmp(content_type, format_sup->values[i].string.text))
|
||||
if (!strcasecmp(final_content_type, format_sup->values[i].string.text))
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -864,33 +889,41 @@ main(int argc, /* I - Number of command-line args */
|
||||
* so convert the document to PostScript...
|
||||
*/
|
||||
|
||||
if (run_pictwps_filter(argv, filename))
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
if (run_pictwps_filter(argv, files[0]))
|
||||
{
|
||||
if (pstmpname[0])
|
||||
unlink(pstmpname);
|
||||
|
||||
filename = pstmpname;
|
||||
if (tmpfilename[0])
|
||||
unlink(tmpfilename);
|
||||
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
|
||||
files[0] = pstmpname;
|
||||
|
||||
/*
|
||||
* Change the MIME type to application/postscript and change the
|
||||
* number of copies to 1...
|
||||
*/
|
||||
|
||||
content_type = "application/postscript";
|
||||
copies = 1;
|
||||
copies_remaining = 1;
|
||||
send_options = 0;
|
||||
final_content_type = "application/postscript";
|
||||
copies = 1;
|
||||
copies_remaining = 1;
|
||||
send_options = 0;
|
||||
}
|
||||
}
|
||||
#endif /* __APPLE__ */
|
||||
|
||||
if (content_type != NULL && format_sup != NULL)
|
||||
if (format_sup != NULL)
|
||||
{
|
||||
for (i = 0; i < format_sup->num_values; i ++)
|
||||
if (!strcasecmp(content_type, format_sup->values[i].string.text))
|
||||
if (!strcasecmp(final_content_type, format_sup->values[i].string.text))
|
||||
break;
|
||||
|
||||
if (i < format_sup->num_values)
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_MIMETYPE,
|
||||
"document-format", NULL, content_type);
|
||||
"document-format", NULL, final_content_type);
|
||||
}
|
||||
|
||||
if (copies_sup && version > 0 && send_options)
|
||||
@@ -943,7 +976,8 @@ main(int argc, /* I - Number of command-line args */
|
||||
if (ipp_status == IPP_SERVICE_UNAVAILABLE ||
|
||||
ipp_status == IPP_PRINTER_BUSY)
|
||||
{
|
||||
fputs(_("INFO: Printer busy; will retry in 10 seconds...\n"), stderr);
|
||||
_cupsLangPuts(stderr,
|
||||
_("INFO: Printer busy; will retry in 10 seconds...\n"));
|
||||
sleep(10);
|
||||
}
|
||||
else if ((ipp_status == IPP_BAD_REQUEST ||
|
||||
@@ -953,25 +987,28 @@ main(int argc, /* I - Number of command-line args */
|
||||
* Switch to IPP/1.0...
|
||||
*/
|
||||
|
||||
fputs(_("INFO: Printer does not support IPP/1.1, trying IPP/1.0...\n"),
|
||||
stderr);
|
||||
_cupsLangPuts(stderr,
|
||||
_("INFO: Printer does not support IPP/1.1, trying "
|
||||
"IPP/1.0...\n"));
|
||||
version = 0;
|
||||
httpReconnect(http);
|
||||
}
|
||||
else
|
||||
fprintf(stderr, _("ERROR: Print file was not accepted (%s)!\n"),
|
||||
cupsLastErrorString());
|
||||
_cupsLangPrintf(stderr, _("ERROR: Print file was not accepted (%s)!\n"),
|
||||
cupsLastErrorString());
|
||||
}
|
||||
else if ((job_id_attr = ippFindAttribute(response, "job-id",
|
||||
IPP_TAG_INTEGER)) == NULL)
|
||||
{
|
||||
fputs(_("NOTICE: Print file accepted - job ID unknown.\n"), stderr);
|
||||
_cupsLangPuts(stderr,
|
||||
_("NOTICE: Print file accepted - job ID unknown.\n"));
|
||||
job_id = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
job_id = job_id_attr->values[0].integer;
|
||||
fprintf(stderr, _("NOTICE: Print file accepted - job ID %d.\n"), job_id);
|
||||
_cupsLangPrintf(stderr, _("NOTICE: Print file accepted - job ID %d.\n"),
|
||||
job_id);
|
||||
}
|
||||
|
||||
ippDelete(response);
|
||||
@@ -1009,8 +1046,9 @@ main(int argc, /* I - Number of command-line args */
|
||||
{
|
||||
ipp_status = cupsLastError();
|
||||
|
||||
fprintf(stderr, _("ERROR: Unable to add file %d to job: %s\n"),
|
||||
job_id, cupsLastErrorString());
|
||||
_cupsLangPrintf(stderr,
|
||||
_("ERROR: Unable to add file %d to job: %s\n"),
|
||||
job_id, cupsLastErrorString());
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1023,7 +1061,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
}
|
||||
else if (ipp_status == IPP_SERVICE_UNAVAILABLE ||
|
||||
ipp_status == IPP_PRINTER_BUSY)
|
||||
break;
|
||||
continue;
|
||||
else
|
||||
copies_remaining --;
|
||||
|
||||
@@ -1034,9 +1072,9 @@ main(int argc, /* I - Number of command-line args */
|
||||
if (!job_id || !waitjob)
|
||||
continue;
|
||||
|
||||
fputs(_("INFO: Waiting for job to complete...\n"), stderr);
|
||||
_cupsLangPuts(stderr, _("INFO: Waiting for job to complete...\n"));
|
||||
|
||||
for (; !job_cancelled;)
|
||||
for (delay = 1; !job_cancelled;)
|
||||
{
|
||||
/*
|
||||
* Build an IPP_GET_JOB_ATTRIBUTES request...
|
||||
@@ -1088,8 +1126,9 @@ main(int argc, /* I - Number of command-line args */
|
||||
{
|
||||
ippDelete(response);
|
||||
|
||||
fprintf(stderr, _("ERROR: Unable to get job %d attributes (%s)!\n"),
|
||||
job_id, cupsLastErrorString());
|
||||
_cupsLangPrintf(stderr,
|
||||
_("ERROR: Unable to get job %d attributes (%s)!\n"),
|
||||
job_id, cupsLastErrorString());
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1123,13 +1162,17 @@ main(int argc, /* I - Number of command-line args */
|
||||
* Check the printer state and report it if necessary...
|
||||
*/
|
||||
|
||||
check_printer_state(http, uri, resource, argv[2], version);
|
||||
check_printer_state(http, uri, resource, argv[2], version, job_id);
|
||||
|
||||
/*
|
||||
* Wait 10 seconds before polling again...
|
||||
* Wait 1-10 seconds before polling again...
|
||||
*/
|
||||
|
||||
sleep(10);
|
||||
sleep(delay);
|
||||
|
||||
delay ++;
|
||||
if (delay > 10)
|
||||
delay = 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1144,7 +1187,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
* Check the printer state and report it if necessary...
|
||||
*/
|
||||
|
||||
check_printer_state(http, uri, resource, argv[2], version);
|
||||
check_printer_state(http, uri, resource, argv[2], version, job_id);
|
||||
|
||||
/*
|
||||
* Free memory...
|
||||
@@ -1178,7 +1221,20 @@ main(int argc, /* I - Number of command-line args */
|
||||
* Return the queue status...
|
||||
*/
|
||||
|
||||
return (ipp_status > IPP_OK_CONFLICT ? CUPS_BACKEND_FAILED : CUPS_BACKEND_OK);
|
||||
if (ipp_status == IPP_NOT_AUTHORIZED)
|
||||
{
|
||||
/*
|
||||
* Authorization failures here mean that we need Kerberos. Username +
|
||||
* password authentication is handled in the password_cb function.
|
||||
*/
|
||||
|
||||
fputs("ATTR: auth-info-required=negotiate\n", stderr);
|
||||
return (CUPS_BACKEND_AUTH_REQUIRED);
|
||||
}
|
||||
else if (ipp_status > IPP_OK_CONFLICT)
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
else
|
||||
return (CUPS_BACKEND_OK);
|
||||
}
|
||||
|
||||
|
||||
@@ -1197,7 +1253,7 @@ cancel_job(http_t *http, /* I - HTTP connection */
|
||||
ipp_t *request; /* Cancel-Job request */
|
||||
|
||||
|
||||
fputs(_("INFO: Canceling print job...\n"), stderr);
|
||||
_cupsLangPuts(stderr, _("INFO: Canceling print job...\n"));
|
||||
|
||||
request = ippNewRequest(IPP_CANCEL_JOB);
|
||||
request->request.op.version[1] = version;
|
||||
@@ -1217,8 +1273,8 @@ cancel_job(http_t *http, /* I - HTTP connection */
|
||||
ippDelete(cupsDoRequest(http, request, resource));
|
||||
|
||||
if (cupsLastError() > IPP_OK_CONFLICT)
|
||||
fprintf(stderr, _("ERROR: Unable to cancel job %d: %s\n"), id,
|
||||
cupsLastErrorString());
|
||||
_cupsLangPrintf(stderr, _("ERROR: Unable to cancel job %d: %s\n"), id,
|
||||
cupsLastErrorString());
|
||||
}
|
||||
|
||||
|
||||
@@ -1232,12 +1288,18 @@ check_printer_state(
|
||||
const char *uri, /* I - Printer URI */
|
||||
const char *resource, /* I - Resource path */
|
||||
const char *user, /* I - Username, if any */
|
||||
int version) /* I - IPP version */
|
||||
int version, /* I - IPP version */
|
||||
int job_id) /* I - Current job ID */
|
||||
{
|
||||
ipp_t *request, /* IPP request */
|
||||
*response; /* IPP response */
|
||||
static const char * const attrs[] = /* Attributes we want */
|
||||
{
|
||||
"marker-colors",
|
||||
"marker-levels",
|
||||
"marker-message",
|
||||
"marker-names",
|
||||
"marker-types",
|
||||
"printer-state-message",
|
||||
"printer-state-reasons"
|
||||
};
|
||||
@@ -1267,7 +1329,7 @@ check_printer_state(
|
||||
|
||||
if ((response = cupsDoRequest(http, request, resource)) != NULL)
|
||||
{
|
||||
report_printer_state(response);
|
||||
report_printer_state(response, job_id);
|
||||
ippDelete(response);
|
||||
}
|
||||
}
|
||||
@@ -1298,25 +1360,25 @@ compress_files(int num_files, /* I - Number of files */
|
||||
{
|
||||
if ((fd = cupsTempFd(filename, sizeof(filename))) < 0)
|
||||
{
|
||||
fprintf(stderr,
|
||||
_("ERROR: Unable to create temporary compressed print file: "
|
||||
"%s\n"),
|
||||
strerror(errno));
|
||||
_cupsLangPrintf(stderr,
|
||||
_("ERROR: Unable to create temporary compressed print "
|
||||
"file: %s\n"), strerror(errno));
|
||||
exit(CUPS_BACKEND_FAILED);
|
||||
}
|
||||
|
||||
if ((out = cupsFileOpenFd(fd, "w9")) == NULL)
|
||||
{
|
||||
fprintf(stderr,
|
||||
_("ERROR: Unable to open temporary compressed print file: %s\n"),
|
||||
strerror(errno));
|
||||
_cupsLangPrintf(stderr,
|
||||
_("ERROR: Unable to open temporary compressed print "
|
||||
"file: %s\n"), strerror(errno));
|
||||
exit(CUPS_BACKEND_FAILED);
|
||||
}
|
||||
|
||||
if ((in = cupsFileOpen(files[i], "r")) == NULL)
|
||||
{
|
||||
fprintf(stderr, _("ERROR: Unable to open print file \"%s\": %s\n"),
|
||||
files[i], strerror(errno));
|
||||
_cupsLangPrintf(stderr,
|
||||
_("ERROR: Unable to open print file \"%s\": %s\n"),
|
||||
files[i], strerror(errno));
|
||||
cupsFileClose(out);
|
||||
exit(CUPS_BACKEND_FAILED);
|
||||
}
|
||||
@@ -1325,8 +1387,9 @@ compress_files(int num_files, /* I - Number of files */
|
||||
while ((bytes = cupsFileRead(in, buffer, sizeof(buffer))) > 0)
|
||||
if (cupsFileWrite(out, buffer, bytes) < bytes)
|
||||
{
|
||||
fprintf(stderr, _("ERROR: Unable to write %d bytes to \"%s\": %s\n"),
|
||||
(int)bytes, filename, strerror(errno));
|
||||
_cupsLangPrintf(stderr,
|
||||
_("ERROR: Unable to write %d bytes to \"%s\": %s\n"),
|
||||
(int)bytes, filename, strerror(errno));
|
||||
cupsFileClose(in);
|
||||
cupsFileClose(out);
|
||||
exit(CUPS_BACKEND_FAILED);
|
||||
@@ -1359,8 +1422,12 @@ password_cb(const char *prompt) /* I - Prompt (not used) */
|
||||
{
|
||||
(void)prompt;
|
||||
|
||||
if (password)
|
||||
if (password && *password && password_tries < 3)
|
||||
{
|
||||
password_tries ++;
|
||||
|
||||
return (password);
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
@@ -1385,22 +1452,93 @@ password_cb(const char *prompt) /* I - Prompt (not used) */
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'report_attr()' - Report an IPP attribute value.
|
||||
*/
|
||||
|
||||
static void
|
||||
report_attr(ipp_attribute_t *attr) /* I - Attribute */
|
||||
{
|
||||
int i; /* Looping var */
|
||||
char value[1024], /* Value string */
|
||||
*valptr, /* Pointer into value string */
|
||||
*attrptr; /* Pointer into attribute value */
|
||||
|
||||
|
||||
/*
|
||||
* Convert the attribute values into quoted strings...
|
||||
*/
|
||||
|
||||
for (i = 0, valptr = value;
|
||||
i < attr->num_values && valptr < (value + sizeof(value) - 10);
|
||||
i ++)
|
||||
{
|
||||
if (i > 0)
|
||||
*valptr++ = ',';
|
||||
|
||||
switch (attr->value_tag)
|
||||
{
|
||||
case IPP_TAG_INTEGER :
|
||||
case IPP_TAG_ENUM :
|
||||
snprintf(valptr, sizeof(value) - (valptr - value), "%d",
|
||||
attr->values[i].integer);
|
||||
valptr += strlen(valptr);
|
||||
break;
|
||||
|
||||
case IPP_TAG_TEXT :
|
||||
case IPP_TAG_NAME :
|
||||
case IPP_TAG_KEYWORD :
|
||||
*valptr++ = '\"';
|
||||
for (attrptr = attr->values[i].string.text;
|
||||
*attrptr && valptr < (value + sizeof(value) - 10);
|
||||
attrptr ++)
|
||||
{
|
||||
if (*attrptr == '\\' || *attrptr == '\"')
|
||||
*valptr++ = '\\';
|
||||
|
||||
*valptr++ = *attrptr;
|
||||
}
|
||||
*valptr++ = '\"';
|
||||
break;
|
||||
|
||||
default :
|
||||
/*
|
||||
* Unsupported value type...
|
||||
*/
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
*valptr = '\0';
|
||||
|
||||
/*
|
||||
* Tell the scheduler about the new values...
|
||||
*/
|
||||
|
||||
fprintf(stderr, "ATTR: %s=%s\n", attr->name, value);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'report_printer_state()' - Report the printer state.
|
||||
*/
|
||||
|
||||
static int /* O - Number of reasons shown */
|
||||
report_printer_state(ipp_t *ipp) /* I - IPP response */
|
||||
report_printer_state(ipp_t *ipp, /* I - IPP response */
|
||||
int job_id) /* I - Current job ID */
|
||||
{
|
||||
int i; /* Looping var */
|
||||
int count; /* Count of reasons shown... */
|
||||
ipp_attribute_t *psm, /* pritner-state-message */
|
||||
*reasons; /* printer-state-reasons */
|
||||
ipp_attribute_t *psm, /* printer-state-message */
|
||||
*reasons, /* printer-state-reasons */
|
||||
*marker; /* marker-* attributes */
|
||||
const char *reason; /* Current reason */
|
||||
const char *message; /* Message to show */
|
||||
char unknown[1024]; /* Unknown message string */
|
||||
const char *prefix; /* Prefix for STATE: line */
|
||||
char state[1024]; /* State string */
|
||||
cups_lang_t *language; /* Current localization */
|
||||
|
||||
|
||||
if ((psm = ippFindAttribute(ipp, "printer-state-message",
|
||||
@@ -1413,15 +1551,20 @@ report_printer_state(ipp_t *ipp) /* I - IPP response */
|
||||
|
||||
state[0] = '\0';
|
||||
prefix = "STATE: ";
|
||||
language = cupsLangDefault();
|
||||
|
||||
for (i = 0, count = 0; i < reasons->num_values; i ++)
|
||||
{
|
||||
reason = reasons->values[i].string.text;
|
||||
|
||||
strlcat(state, prefix, sizeof(state));
|
||||
strlcat(state, reason, sizeof(state));
|
||||
if (strcmp(reason, "paused"))
|
||||
{
|
||||
strlcat(state, prefix, sizeof(state));
|
||||
strlcat(state, reason, sizeof(state));
|
||||
|
||||
prefix = ",";
|
||||
}
|
||||
|
||||
prefix = ",";
|
||||
message = "";
|
||||
|
||||
if (!strncmp(reason, "media-needed", 12))
|
||||
@@ -1486,16 +1629,32 @@ report_printer_state(ipp_t *ipp) /* I - IPP response */
|
||||
{
|
||||
count ++;
|
||||
if (strstr(reasons->values[i].string.text, "error"))
|
||||
fprintf(stderr, "ERROR: %s\n", message);
|
||||
fprintf(stderr, "ERROR: %s\n", _cupsLangString(language, message));
|
||||
else if (strstr(reasons->values[i].string.text, "warning"))
|
||||
fprintf(stderr, "WARNING: %s\n", message);
|
||||
fprintf(stderr, "WARNING: %s\n", _cupsLangString(language, message));
|
||||
else
|
||||
fprintf(stderr, "INFO: %s\n", message);
|
||||
fprintf(stderr, "INFO: %s\n", _cupsLangString(language, message));
|
||||
}
|
||||
}
|
||||
|
||||
fprintf(stderr, "%s\n", state);
|
||||
|
||||
/*
|
||||
* Relay the current marker-* attribute values...
|
||||
*/
|
||||
|
||||
if ((marker = ippFindAttribute(ipp, "marker-colors", IPP_TAG_NAME)) != NULL)
|
||||
report_attr(marker);
|
||||
if ((marker = ippFindAttribute(ipp, "marker-levels",
|
||||
IPP_TAG_INTEGER)) != NULL)
|
||||
report_attr(marker);
|
||||
if ((marker = ippFindAttribute(ipp, "marker-message", IPP_TAG_TEXT)) != NULL)
|
||||
report_attr(marker);
|
||||
if ((marker = ippFindAttribute(ipp, "marker-names", IPP_TAG_NAME)) != NULL)
|
||||
report_attr(marker);
|
||||
if ((marker = ippFindAttribute(ipp, "marker-types", IPP_TAG_KEYWORD)) != NULL)
|
||||
report_attr(marker);
|
||||
|
||||
return (count);
|
||||
}
|
||||
|
||||
@@ -1532,15 +1691,16 @@ run_pictwps_filter(char **argv, /* I - Command-line arguments */
|
||||
printer = getenv("PRINTER");
|
||||
if (!printer)
|
||||
{
|
||||
fputs(_("ERROR: PRINTER environment variable not defined!\n"), stderr);
|
||||
_cupsLangPuts(stderr,
|
||||
_("ERROR: PRINTER environment variable not defined!\n"));
|
||||
return (-1);
|
||||
}
|
||||
|
||||
if ((ppdfile = cupsGetPPD(printer)) == NULL)
|
||||
{
|
||||
fprintf(stderr,
|
||||
_("ERROR: Unable to get PPD file for printer \"%s\" - %s.\n"),
|
||||
printer, cupsLastErrorString());
|
||||
_cupsLangPrintf(stderr,
|
||||
_("ERROR: Unable to get PPD file for printer \"%s\" - "
|
||||
"%s.\n"), printer, cupsLastErrorString());
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1554,8 +1714,8 @@ run_pictwps_filter(char **argv, /* I - Command-line arguments */
|
||||
|
||||
if ((fd = cupsTempFd(pstmpname, sizeof(pstmpname))) < 0)
|
||||
{
|
||||
fprintf(stderr, _("ERROR: Unable to create temporary file - %s.\n"),
|
||||
strerror(errno));
|
||||
_cupsLangPrintf(stderr, _("ERROR: Unable to create temporary file - %s.\n"),
|
||||
strerror(errno));
|
||||
if (ppdfile)
|
||||
unlink(ppdfile);
|
||||
return (-1);
|
||||
@@ -1611,8 +1771,8 @@ run_pictwps_filter(char **argv, /* I - Command-line arguments */
|
||||
|
||||
execlp("pictwpstops", printer, argv[1], argv[2], argv[3], argv[4], argv[5],
|
||||
filename, NULL);
|
||||
fprintf(stderr, _("ERROR: Unable to exec pictwpstops: %s\n"),
|
||||
strerror(errno));
|
||||
_cupsLangPrintf(stderr, _("ERROR: Unable to exec pictwpstops: %s\n"),
|
||||
strerror(errno));
|
||||
return (errno);
|
||||
}
|
||||
|
||||
@@ -1624,9 +1784,8 @@ run_pictwps_filter(char **argv, /* I - Command-line arguments */
|
||||
* Error!
|
||||
*/
|
||||
|
||||
fprintf(stderr, _("ERROR: Unable to fork pictwpstops: %s\n"),
|
||||
strerror(errno));
|
||||
unlink(filename);
|
||||
_cupsLangPrintf(stderr, _("ERROR: Unable to fork pictwpstops: %s\n"),
|
||||
strerror(errno));
|
||||
if (ppdfile)
|
||||
unlink(ppdfile);
|
||||
return (-1);
|
||||
@@ -1638,10 +1797,9 @@ run_pictwps_filter(char **argv, /* I - Command-line arguments */
|
||||
|
||||
if (wait(&status) < 0)
|
||||
{
|
||||
fprintf(stderr, _("ERROR: Unable to wait for pictwpstops: %s\n"),
|
||||
strerror(errno));
|
||||
_cupsLangPrintf(stderr, _("ERROR: Unable to wait for pictwpstops: %s\n"),
|
||||
strerror(errno));
|
||||
close(fd);
|
||||
unlink(filename);
|
||||
if (ppdfile)
|
||||
unlink(ppdfile);
|
||||
return (-1);
|
||||
@@ -1655,13 +1813,12 @@ run_pictwps_filter(char **argv, /* I - Command-line arguments */
|
||||
if (status)
|
||||
{
|
||||
if (status >= 256)
|
||||
fprintf(stderr, _("ERROR: pictwpstops exited with status %d!\n"),
|
||||
status / 256);
|
||||
_cupsLangPrintf(stderr, _("ERROR: pictwpstops exited with status %d!\n"),
|
||||
status / 256);
|
||||
else
|
||||
fprintf(stderr, _("ERROR: pictwpstops exited on signal %d!\n"),
|
||||
status);
|
||||
_cupsLangPrintf(stderr, _("ERROR: pictwpstops exited on signal %d!\n"),
|
||||
status);
|
||||
|
||||
unlink(filename);
|
||||
return (status);
|
||||
}
|
||||
|
||||
|
||||
+85
-74
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Line Printer Daemon backend for the Common UNIX Printing System (CUPS).
|
||||
*
|
||||
* Copyright 2007 by Apple Inc.
|
||||
* Copyright 2007-2008 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -125,9 +125,9 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
username[255], /* Username info */
|
||||
resource[1024], /* Resource info (printer name) */
|
||||
*options, /* Pointer to options */
|
||||
name[255], /* Name of option */
|
||||
value[255], /* Value of option */
|
||||
*ptr, /* Pointer into name or value */
|
||||
*name, /* Name of option */
|
||||
*value, /* Value of option */
|
||||
sep, /* Separator character */
|
||||
*filename, /* File to print */
|
||||
title[256]; /* Title string */
|
||||
int port; /* Port number */
|
||||
@@ -186,8 +186,9 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
}
|
||||
else if (argc < 6 || argc > 7)
|
||||
{
|
||||
fprintf(stderr, _("Usage: %s job-id user title copies options [file]\n"),
|
||||
argv[0]);
|
||||
_cupsLangPrintf(stderr,
|
||||
_("Usage: %s job-id user title copies options [file]\n"),
|
||||
argv[0]);
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
|
||||
@@ -200,6 +201,9 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
hostname, sizeof(hostname), &port,
|
||||
resource, sizeof(resource));
|
||||
|
||||
if (!port)
|
||||
port = 515; /* Default to port 515 */
|
||||
|
||||
if (!username[0])
|
||||
{
|
||||
/*
|
||||
@@ -276,29 +280,30 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
* Get the name...
|
||||
*/
|
||||
|
||||
for (ptr = name; *options && *options != '=';)
|
||||
if (ptr < (name + sizeof(name) - 1))
|
||||
*ptr++ = *options++;
|
||||
*ptr = '\0';
|
||||
name = options;
|
||||
|
||||
if (*options == '=')
|
||||
while (*options && *options != '=' && *options != '+' && *options != '&')
|
||||
options ++;
|
||||
|
||||
if ((sep = *options) != '\0')
|
||||
*options++ = '\0';
|
||||
|
||||
if (sep == '=')
|
||||
{
|
||||
/*
|
||||
* Get the value...
|
||||
*/
|
||||
|
||||
options ++;
|
||||
value = options;
|
||||
|
||||
for (ptr = value; *options && *options != '+' && *options != '&';)
|
||||
if (ptr < (value + sizeof(value) - 1))
|
||||
*ptr++ = *options++;
|
||||
*ptr = '\0';
|
||||
|
||||
if (*options == '+' || *options == '&')
|
||||
while (*options && *options != '+' && *options != '&')
|
||||
options ++;
|
||||
|
||||
if (*options)
|
||||
*options++ = '\0';
|
||||
}
|
||||
else
|
||||
value[0] = '\0';
|
||||
value = (char *)"";
|
||||
|
||||
/*
|
||||
* Process the option...
|
||||
@@ -322,8 +327,8 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
if (strchr("cdfglnoprtv", value[0]))
|
||||
format = value[0];
|
||||
else
|
||||
fprintf(stderr, _("ERROR: Unknown format character \"%c\"\n"),
|
||||
value[0]);
|
||||
_cupsLangPrintf(stderr, _("ERROR: Unknown format character \"%c\"\n"),
|
||||
value[0]);
|
||||
}
|
||||
else if (!strcasecmp(name, "mode") && value[0])
|
||||
{
|
||||
@@ -336,7 +341,8 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
else if (!strcasecmp(value, "stream"))
|
||||
mode = MODE_STREAM;
|
||||
else
|
||||
fprintf(stderr, _("ERROR: Unknown print mode \"%s\"\n"), value);
|
||||
_cupsLangPrintf(stderr, _("ERROR: Unknown print mode \"%s\"\n"),
|
||||
value);
|
||||
}
|
||||
else if (!strcasecmp(name, "order") && value[0])
|
||||
{
|
||||
@@ -349,7 +355,8 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
else if (!strcasecmp(value, "data,control"))
|
||||
order = ORDER_DATA_CONTROL;
|
||||
else
|
||||
fprintf(stderr, _("ERROR: Unknown file order \"%s\"\n"), value);
|
||||
_cupsLangPrintf(stderr, _("ERROR: Unknown file order \"%s\"\n"),
|
||||
value);
|
||||
}
|
||||
else if (!strcasecmp(name, "reserve"))
|
||||
{
|
||||
@@ -438,8 +445,6 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
unlink(tmpfilename);
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
|
||||
filename = tmpfilename;
|
||||
}
|
||||
else if (argc == 6)
|
||||
{
|
||||
@@ -457,8 +462,8 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
|
||||
if (fd == -1)
|
||||
{
|
||||
fprintf(stderr, _("ERROR: Unable to open print file %s: %s\n"),
|
||||
filename, strerror(errno));
|
||||
_cupsLangPrintf(stderr, _("ERROR: Unable to open print file %s: %s\n"),
|
||||
filename, strerror(errno));
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
}
|
||||
@@ -476,6 +481,8 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
* the remote end...
|
||||
*/
|
||||
|
||||
char *ptr;
|
||||
|
||||
for (ptr = title; *ptr; ptr ++)
|
||||
if (!isalnum(*ptr & 255) && !isspace(*ptr & 255))
|
||||
*ptr = '_';
|
||||
@@ -585,9 +592,9 @@ lpd_command(int fd, /* I - Socket connection to LPD host */
|
||||
|
||||
if (recv(fd, &status, 1, 0) < 1)
|
||||
{
|
||||
fprintf(stderr,
|
||||
_("WARNING: Remote host did not respond with command status "
|
||||
"byte after %d seconds!\n"), timeout);
|
||||
_cupsLangPrintf(stderr,
|
||||
_("WARNING: Remote host did not respond with command "
|
||||
"status byte after %d seconds!\n"), timeout);
|
||||
status = errno;
|
||||
}
|
||||
|
||||
@@ -668,7 +675,8 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
|
||||
if ((addrlist = httpAddrGetList(hostname, AF_UNSPEC, portname)) == NULL)
|
||||
{
|
||||
fprintf(stderr, _("ERROR: Unable to locate printer \'%s\'!\n"), hostname);
|
||||
_cupsLangPrintf(stderr, _("ERROR: Unable to locate printer \'%s\'!\n"),
|
||||
hostname);
|
||||
return (CUPS_BACKEND_STOP);
|
||||
}
|
||||
|
||||
@@ -690,9 +698,9 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
*/
|
||||
|
||||
fputs("STATE: +connecting-to-device\n", stderr);
|
||||
fprintf(stderr,
|
||||
_("INFO: Attempting to connect to host %s for printer %s\n"),
|
||||
hostname, printer);
|
||||
_cupsLangPrintf(stderr,
|
||||
_("INFO: Attempting to connect to host %s for printer %s\n"),
|
||||
hostname, printer);
|
||||
|
||||
for (lport = reserve == RESERVE_RFC1179 ? 732 : 1024, addr = addrlist,
|
||||
delay = 5;;
|
||||
@@ -791,8 +799,9 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
* available printer in the class.
|
||||
*/
|
||||
|
||||
fputs(_("INFO: Unable to contact printer, queuing on next "
|
||||
"printer in class...\n"), stderr);
|
||||
_cupsLangPuts(stderr,
|
||||
_("INFO: Unable to contact printer, queuing on next "
|
||||
"printer in class...\n"));
|
||||
|
||||
httpAddrFreeList(addrlist);
|
||||
|
||||
@@ -810,16 +819,15 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
{
|
||||
if (contimeout && (time(NULL) - start_time) > contimeout)
|
||||
{
|
||||
fputs(_("ERROR: Printer not responding!\n"), stderr);
|
||||
_cupsLangPuts(stderr, _("ERROR: Printer not responding!\n"));
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
|
||||
recoverable = 1;
|
||||
|
||||
fprintf(stderr,
|
||||
_("WARNING: recoverable: Network host \'%s\' is busy; will "
|
||||
"retry in %d seconds...\n"),
|
||||
hostname, delay);
|
||||
_cupsLangPrintf(stderr,
|
||||
_("WARNING: recoverable: Network host \'%s\' is busy; "
|
||||
"will retry in %d seconds...\n"), hostname, delay);
|
||||
|
||||
sleep(delay);
|
||||
|
||||
@@ -839,8 +847,9 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
recoverable = 1;
|
||||
|
||||
fprintf(stderr, "DEBUG: Connection error: %s\n", strerror(errno));
|
||||
fputs(_("ERROR: recoverable: Unable to connect to printer; will "
|
||||
"retry in 30 seconds...\n"), stderr);
|
||||
_cupsLangPuts(stderr,
|
||||
_("ERROR: recoverable: Unable to connect to printer; "
|
||||
"will retry in 30 seconds...\n"));
|
||||
sleep(30);
|
||||
}
|
||||
}
|
||||
@@ -858,7 +867,7 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
}
|
||||
|
||||
fputs("STATE: -connecting-to-device\n", stderr);
|
||||
fprintf(stderr, _("INFO: Connected to %s...\n"), hostname);
|
||||
_cupsLangPrintf(stderr, _("INFO: Connected to %s...\n"), hostname);
|
||||
|
||||
#ifdef AF_INET6
|
||||
if (addr->addr.addr.sa_family == AF_INET6)
|
||||
@@ -964,8 +973,8 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
|
||||
fprintf(stderr, _("INFO: Sending control file (%u bytes)\n"),
|
||||
(unsigned)strlen(control));
|
||||
_cupsLangPrintf(stderr, _("INFO: Sending control file (%u bytes)\n"),
|
||||
(unsigned)strlen(control));
|
||||
|
||||
if (lpd_write(fd, control, strlen(control) + 1) < (strlen(control) + 1))
|
||||
{
|
||||
@@ -978,9 +987,9 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
|
||||
if (read(fd, &status, 1) < 1)
|
||||
{
|
||||
fprintf(stderr,
|
||||
_("WARNING: Remote host did not respond with control "
|
||||
"status byte after %d seconds!\n"), timeout);
|
||||
_cupsLangPrintf(stderr,
|
||||
_("WARNING: Remote host did not respond with control "
|
||||
"status byte after %d seconds!\n"), timeout);
|
||||
status = errno;
|
||||
}
|
||||
|
||||
@@ -988,11 +997,11 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
}
|
||||
|
||||
if (status != 0)
|
||||
fprintf(stderr,
|
||||
_("ERROR: Remote host did not accept control file (%d)\n"),
|
||||
status);
|
||||
_cupsLangPrintf(stderr,
|
||||
_("ERROR: Remote host did not accept control file "
|
||||
"(%d)\n"), status);
|
||||
else
|
||||
fputs(_("INFO: Control file sent successfully\n"), stderr);
|
||||
_cupsLangPuts(stderr, _("INFO: Control file sent successfully\n"));
|
||||
}
|
||||
else
|
||||
status = 0;
|
||||
@@ -1013,13 +1022,13 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
|
||||
fprintf(stderr,
|
||||
_cupsLangPrintf(stderr,
|
||||
#ifdef HAVE_LONG_LONG
|
||||
_("INFO: Sending data file (%lld bytes)\n"),
|
||||
_("INFO: Sending data file (%lld bytes)\n"),
|
||||
#else
|
||||
_("INFO: Sending data file (%ld bytes)\n"),
|
||||
_("INFO: Sending data file (%ld bytes)\n"),
|
||||
#endif /* HAVE_LONG_LONG */
|
||||
CUPS_LLCAST filestats.st_size);
|
||||
CUPS_LLCAST filestats.st_size);
|
||||
|
||||
tbytes = 0;
|
||||
for (copy = 0; copy < manual_copies; copy ++)
|
||||
@@ -1028,8 +1037,9 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
|
||||
while ((nbytes = read(print_fd, buffer, sizeof(buffer))) > 0)
|
||||
{
|
||||
fprintf(stderr, _("INFO: Spooling LPR job, %.0f%% complete...\n"),
|
||||
100.0 * tbytes / filestats.st_size);
|
||||
_cupsLangPrintf(stderr,
|
||||
_("INFO: Spooling LPR job, %.0f%% complete...\n"),
|
||||
100.0 * tbytes / filestats.st_size);
|
||||
|
||||
if (lpd_write(fd, buffer, nbytes) < nbytes)
|
||||
{
|
||||
@@ -1063,9 +1073,9 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
|
||||
if (recv(fd, &status, 1, 0) < 1)
|
||||
{
|
||||
fprintf(stderr,
|
||||
_("WARNING: Remote host did not respond with data "
|
||||
"status byte after %d seconds!\n"), timeout);
|
||||
_cupsLangPrintf(stderr,
|
||||
_("WARNING: Remote host did not respond with data "
|
||||
"status byte after %d seconds!\n"), timeout);
|
||||
status = 0;
|
||||
}
|
||||
|
||||
@@ -1076,10 +1086,11 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
status = 0;
|
||||
|
||||
if (status != 0)
|
||||
fprintf(stderr, _("ERROR: Remote host did not accept data file (%d)\n"),
|
||||
status);
|
||||
_cupsLangPrintf(stderr,
|
||||
_("ERROR: Remote host did not accept data file (%d)\n"),
|
||||
status);
|
||||
else
|
||||
fputs(_("INFO: Data file sent successfully\n"), stderr);
|
||||
_cupsLangPuts(stderr, _("INFO: Data file sent successfully\n"));
|
||||
}
|
||||
|
||||
if (status == 0 && order == ORDER_DATA_CONTROL)
|
||||
@@ -1093,8 +1104,8 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
|
||||
fprintf(stderr, _("INFO: Sending control file (%lu bytes)\n"),
|
||||
(unsigned long)strlen(control));
|
||||
_cupsLangPrintf(stderr, _("INFO: Sending control file (%lu bytes)\n"),
|
||||
(unsigned long)strlen(control));
|
||||
|
||||
if (lpd_write(fd, control, strlen(control) + 1) < (strlen(control) + 1))
|
||||
{
|
||||
@@ -1107,9 +1118,9 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
|
||||
if (read(fd, &status, 1) < 1)
|
||||
{
|
||||
fprintf(stderr,
|
||||
_("WARNING: Remote host did not respond with control "
|
||||
"status byte after %d seconds!\n"), timeout);
|
||||
_cupsLangPrintf(stderr,
|
||||
_("WARNING: Remote host did not respond with control "
|
||||
"status byte after %d seconds!\n"), timeout);
|
||||
status = errno;
|
||||
}
|
||||
|
||||
@@ -1117,11 +1128,11 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
}
|
||||
|
||||
if (status != 0)
|
||||
fprintf(stderr,
|
||||
_("ERROR: Remote host did not accept control file (%d)\n"),
|
||||
status);
|
||||
_cupsLangPrintf(stderr,
|
||||
_("ERROR: Remote host did not accept control file "
|
||||
"(%d)\n"), status);
|
||||
else
|
||||
fputs(_("INFO: Control file sent successfully\n"), stderr);
|
||||
_cupsLangPuts(stderr, _("INFO: Control file sent successfully\n"));
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
+90
-78
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
*
|
||||
* © Copyright 2004 Apple Computer, Inc. All rights reserved.
|
||||
* Copyright 2004-2008 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
|
||||
@@ -70,6 +70,16 @@
|
||||
* signalHandler() - handle SIGINT to close the session before quiting.
|
||||
*/
|
||||
|
||||
/*
|
||||
* This backend uses deprecated APIs for AppleTalk; we know this, so
|
||||
* silence any warnings about it...
|
||||
*/
|
||||
|
||||
#ifdef MAC_OS_X_VERSION_MIN_REQUIRED
|
||||
# undef MAC_OS_X_VERSION_MIN_REQUIRED
|
||||
#endif /* MAX_OS_X_VERSION_MIN_REQUIRED */
|
||||
#define MAC_OS_X_VERSION_MIN_REQUIRED MAC_OS_X_VERSION_10_0
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <stdio.h>
|
||||
@@ -85,17 +95,17 @@
|
||||
#include <sys/time.h>
|
||||
#include <sys/errno.h>
|
||||
|
||||
#include <cups/cups.h>
|
||||
#include <cups/backend.h>
|
||||
#include <cups/sidechannel.h>
|
||||
#include <cups/i18n.h>
|
||||
|
||||
#include <netat/appletalk.h>
|
||||
#include <netat/atp.h>
|
||||
#include <netat/ddp.h>
|
||||
#include <netat/nbp.h>
|
||||
#include <netat/pap.h>
|
||||
|
||||
#include <cups/cups.h>
|
||||
#include <cups/backend.h>
|
||||
#include <cups/sidechannel.h>
|
||||
#include <cups/i18n.h>
|
||||
|
||||
#include <libkern/OSByteOrder.h>
|
||||
|
||||
#ifdef HAVE_APPLETALK_AT_PROTO_H
|
||||
@@ -207,12 +217,7 @@ int main (int argc, const char * argv[])
|
||||
|
||||
if (argc == 1 || (argc == 2 && strcmp(argv[1], "-discover") == 0))
|
||||
{
|
||||
/* If listDevices() didn't find any devices or returns an error output a
|
||||
* legacy style announcement.
|
||||
*
|
||||
*/
|
||||
if (listDevices() <= 0)
|
||||
puts("network pap \"Unknown\" \"AppleTalk Printer Access Protocol (pap)\"");
|
||||
listDevices();
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -242,7 +247,9 @@ int main (int argc, const char * argv[])
|
||||
/* Try to open the print file... */
|
||||
if ((fp = fopen(argv[6], "rb")) == NULL)
|
||||
{
|
||||
fprintf(stderr, "ERROR: unable to open print file \"%s\": %s\n", argv[6], strerror(errno));
|
||||
_cupsLangPrintf(stderr,
|
||||
_("ERROR: Unable to open print file \"%s\": %s\n"),
|
||||
argv[6], strerror(errno));
|
||||
return (1);
|
||||
}
|
||||
|
||||
@@ -273,7 +280,6 @@ int main (int argc, const char * argv[])
|
||||
*/
|
||||
static int listDevices(void)
|
||||
{
|
||||
int err = noErr;
|
||||
int i;
|
||||
int numberFound;
|
||||
|
||||
@@ -289,11 +295,11 @@ static int listDevices(void)
|
||||
/* Make sure it's okay to use appletalk */
|
||||
if (!okayToUseAppleTalk())
|
||||
{
|
||||
fprintf(stderr, "ERROR: AppleTalk disabled in System Preferences\n");
|
||||
fprintf(stderr, "INFO: AppleTalk disabled in System Preferences\n");
|
||||
return -1; /* Network is down */
|
||||
}
|
||||
|
||||
if ((err = zip_getmyzone(ZIP_DEF_INTERFACE, &at_zone)) != 0)
|
||||
if (zip_getmyzone(ZIP_DEF_INTERFACE, &at_zone))
|
||||
{
|
||||
perror("ERROR: Unable to get default AppleTalk zone");
|
||||
return -2;
|
||||
@@ -402,14 +408,13 @@ static int printFile(char* name, char* type, char* zone, int fdin, int fdout, in
|
||||
at_inet_t sendDataAddr;
|
||||
at_inet_t src;
|
||||
at_resp_t resp;
|
||||
int userdata, xo, reqlen;
|
||||
int userdata, xo = 0, reqlen;
|
||||
u_short tid;
|
||||
u_char bitmap;
|
||||
int maxfdp1,
|
||||
nbp_failures = 0;
|
||||
struct timeval timeout, *timeoutPtr;
|
||||
u_char flowQuantum = 1;
|
||||
u_short recvSequence = 0;
|
||||
time_t now,
|
||||
start_time,
|
||||
elasped_time,
|
||||
@@ -721,7 +726,7 @@ static int printFile(char* name, char* type, char* zone, int fdin, int fdout, in
|
||||
case AT_PAP_TYPE_SEND_DATA: /* Send-Data packet */
|
||||
sendDataAddr.socket = src.socket;
|
||||
gSendDataID = tid;
|
||||
recvSequence = OSReadBigInt16(&SEQUENCE_NUM(userdata), 0);
|
||||
OSReadBigInt16(&SEQUENCE_NUM(userdata), 0);
|
||||
|
||||
if ((fileBufferNbytes > 0 || fileEOFRead) && fileEOFSent == false)
|
||||
{
|
||||
@@ -899,8 +904,7 @@ static int papOpen(at_nbptuple_t* tuple, u_char* connID, int* fd,
|
||||
{
|
||||
int result,
|
||||
open_result,
|
||||
userdata,
|
||||
atp_err;
|
||||
userdata;
|
||||
time_t tm,
|
||||
waitTime;
|
||||
char data[10],
|
||||
@@ -949,8 +953,8 @@ static int papOpen(at_nbptuple_t* tuple, u_char* connID, int* fd,
|
||||
|
||||
fprintf(stderr, "DEBUG: -> %s\n", packet_name(AT_PAP_TYPE_OPEN_CONN));
|
||||
|
||||
if ((atp_err = atp_sendreq(*fd, &tuple->enu_addr, data, 4, userdata, 1, 0,
|
||||
0, &resp, &retry, 0)) < 0)
|
||||
if (atp_sendreq(*fd, &tuple->enu_addr, data, 4, userdata, 1, 0,
|
||||
0, &resp, &retry, 0) < 0)
|
||||
{
|
||||
statusUpdate("Destination unreachable", 23);
|
||||
result = EHOSTUNREACH;
|
||||
@@ -1017,7 +1021,6 @@ static int papClose()
|
||||
{
|
||||
int fd;
|
||||
u_short tmpID;
|
||||
int result;
|
||||
unsigned char rdata[ATP_DATA_SIZE];
|
||||
int userdata;
|
||||
u_char *puserdata = (u_char *)&userdata;
|
||||
@@ -1070,9 +1073,9 @@ static int papClose()
|
||||
resp.resp[0].iov_base = rdata;
|
||||
resp.resp[0].iov_len = sizeof(rdata);
|
||||
|
||||
result = atp_sendreq(fd, &gSessionAddr, 0, 0, userdata, 1, 0, 0, &resp, &retry, 0);
|
||||
atp_sendreq(fd, &gSessionAddr, 0, 0, userdata, 1, 0, 0, &resp, &retry, 0);
|
||||
|
||||
result = close(fd);
|
||||
close(fd);
|
||||
}
|
||||
return noErr;
|
||||
}
|
||||
@@ -1363,9 +1366,9 @@ static int parseUri(const char* argv0, char* name, char* type, char* zone)
|
||||
*resourcePtr,
|
||||
*typePtr,
|
||||
*options, /* Pointer to options */
|
||||
optionName[255], /* Name of option */
|
||||
value[255], /* Value of option */
|
||||
*ptr; /* Pointer into name or value */
|
||||
*optionName, /* Name of option */
|
||||
*value, /* Value of option */
|
||||
sep; /* Separator character */
|
||||
int port; /* Port number (not used) */
|
||||
int statusInterval; /* */
|
||||
|
||||
@@ -1393,53 +1396,54 @@ static int parseUri(const char* argv0, char* name, char* type, char* zone)
|
||||
|
||||
while (*options != '\0')
|
||||
{
|
||||
/*
|
||||
/*
|
||||
* Get the name...
|
||||
*/
|
||||
for (ptr = optionName; *options && *options != '=' && *options != '+'; )
|
||||
*ptr++ = *options++;
|
||||
|
||||
*ptr = '\0';
|
||||
value[0] = '\0';
|
||||
optionName = options;
|
||||
|
||||
if (*options == '=')
|
||||
while (*options && *options != '=' && *options != '+' && *options != '&')
|
||||
options ++;
|
||||
|
||||
if ((sep = *options) != '\0')
|
||||
*options++ = '\0';
|
||||
|
||||
if (sep == '=')
|
||||
{
|
||||
/*
|
||||
/*
|
||||
* Get the value...
|
||||
*/
|
||||
|
||||
options ++;
|
||||
|
||||
for (ptr = value; *options && *options != '+';)
|
||||
*ptr++ = *options++;
|
||||
*/
|
||||
|
||||
*ptr = '\0';
|
||||
|
||||
if (*options == '+')
|
||||
options ++;
|
||||
}
|
||||
else if (*options == '+')
|
||||
{
|
||||
options ++;
|
||||
}
|
||||
value = options;
|
||||
|
||||
/*
|
||||
while (*options && *options != '+' && *options != '&')
|
||||
options ++;
|
||||
|
||||
if (*options)
|
||||
*options++ = '\0';
|
||||
}
|
||||
else
|
||||
value = (char *)"";
|
||||
|
||||
/*
|
||||
* Process the option...
|
||||
*/
|
||||
if (strcasecmp(optionName, "waiteof") == 0)
|
||||
|
||||
if (!strcasecmp(optionName, "waiteof"))
|
||||
{
|
||||
/*
|
||||
* Set the banner...
|
||||
/*
|
||||
* Wait for the end of the print file?
|
||||
*/
|
||||
if (strcasecmp(value, "on") == 0 ||
|
||||
strcasecmp(value, "yes") == 0 ||
|
||||
strcasecmp(value, "true") == 0)
|
||||
|
||||
if (!strcasecmp(value, "on") ||
|
||||
!strcasecmp(value, "yes") ||
|
||||
!strcasecmp(value, "true"))
|
||||
{
|
||||
gWaitEOF = true;
|
||||
}
|
||||
else if (strcasecmp(value, "off") == 0 ||
|
||||
strcasecmp(value, "no") == 0 ||
|
||||
strcasecmp(value, "false") == 0)
|
||||
else if (!strcasecmp(value, "off") ||
|
||||
!strcasecmp(value, "no") ||
|
||||
!strcasecmp(value, "false"))
|
||||
{
|
||||
gWaitEOF = false;
|
||||
}
|
||||
@@ -1448,13 +1452,17 @@ static int parseUri(const char* argv0, char* name, char* type, char* zone)
|
||||
fprintf(stderr, "WARNING: Boolean expected for waiteof option \"%s\"\n", value);
|
||||
}
|
||||
}
|
||||
else if (strcasecmp(optionName, "status") == 0)
|
||||
else if (!strcasecmp(optionName, "status"))
|
||||
{
|
||||
/*
|
||||
* Set status reporting interval...
|
||||
*/
|
||||
|
||||
statusInterval = atoi(value);
|
||||
if (value[0] < '0' || value[0] > '9' ||
|
||||
statusInterval < 0)
|
||||
if (value[0] < '0' || value[0] > '9' || statusInterval < 0)
|
||||
{
|
||||
fprintf(stderr, "WARNING: number expected for status option \"%s\"\n", value);
|
||||
fprintf(stderr, "WARNING: number expected for status option \"%s\"\n",
|
||||
value);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1469,20 +1477,24 @@ static int parseUri(const char* argv0, char* name, char* type, char* zone)
|
||||
if (*resourcePtr == '/')
|
||||
resourcePtr++;
|
||||
|
||||
/* If the resource has a slash we assume the slash seperates the AppleTalk object
|
||||
* name from the AppleTalk type. If the slash is not present we assume the AppleTalk
|
||||
* type is LaserWriter.
|
||||
*/
|
||||
typePtr = strchr(resourcePtr, '/');
|
||||
if (typePtr != NULL) {
|
||||
*typePtr++ = '\0';
|
||||
} else {
|
||||
typePtr = "LaserWriter";
|
||||
}
|
||||
/* If the resource has a slash we assume the slash seperates the AppleTalk object
|
||||
* name from the AppleTalk type. If the slash is not present we assume the AppleTalk
|
||||
* type is LaserWriter.
|
||||
*/
|
||||
|
||||
removePercentEscapes(hostname, zone, NBP_NVE_STR_SIZE + 1);
|
||||
removePercentEscapes(resourcePtr, name, NBP_NVE_STR_SIZE + 1);
|
||||
removePercentEscapes(typePtr, type, NBP_NVE_STR_SIZE + 1);
|
||||
typePtr = strchr(resourcePtr, '/');
|
||||
if (typePtr != NULL)
|
||||
{
|
||||
*typePtr++ = '\0';
|
||||
}
|
||||
else
|
||||
{
|
||||
typePtr = "LaserWriter";
|
||||
}
|
||||
|
||||
removePercentEscapes(hostname, zone, NBP_NVE_STR_SIZE + 1);
|
||||
removePercentEscapes(resourcePtr, name, NBP_NVE_STR_SIZE + 1);
|
||||
removePercentEscapes(typePtr, type, NBP_NVE_STR_SIZE + 1);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
+26
-18
@@ -122,8 +122,9 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
}
|
||||
else if (argc < 6 || argc > 7)
|
||||
{
|
||||
fprintf(stderr, _("Usage: %s job-id user title copies options [file]\n"),
|
||||
argv[0]);
|
||||
_cupsLangPrintf(stderr,
|
||||
_("Usage: %s job-id user title copies options [file]\n"),
|
||||
argv[0]);
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
|
||||
@@ -213,8 +214,9 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
* available printer in the class.
|
||||
*/
|
||||
|
||||
fputs(_("INFO: Unable to contact printer, queuing on next "
|
||||
"printer in class...\n"), stderr);
|
||||
_cupsLangPuts(stderr,
|
||||
_("INFO: Unable to contact printer, queuing on next "
|
||||
"printer in class...\n"));
|
||||
|
||||
/*
|
||||
* Sleep 5 seconds to keep the job from requeuing too rapidly...
|
||||
@@ -227,19 +229,22 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
|
||||
if (errno == EBUSY)
|
||||
{
|
||||
fputs(_("INFO: Printer busy; will retry in 30 seconds...\n"), stderr);
|
||||
_cupsLangPuts(stderr,
|
||||
_("INFO: Printer busy; will retry in 30 seconds...\n"));
|
||||
sleep(30);
|
||||
}
|
||||
else if (errno == ENXIO || errno == EIO || errno == ENOENT)
|
||||
{
|
||||
fputs(_("INFO: Printer not connected; will retry in 30 seconds...\n"),
|
||||
stderr);
|
||||
_cupsLangPuts(stderr,
|
||||
_("INFO: Printer not connected; will retry in 30 "
|
||||
"seconds...\n"));
|
||||
sleep(30);
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf(stderr, _("ERROR: Unable to open device file \"%s\": %s\n"),
|
||||
resource, strerror(errno));
|
||||
_cupsLangPrintf(stderr,
|
||||
_("ERROR: Unable to open device file \"%s\": %s\n"),
|
||||
resource, strerror(errno));
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
}
|
||||
@@ -279,13 +284,13 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
tbytes = backendRunLoop(print_fd, device_fd, use_bc, side_cb);
|
||||
|
||||
if (print_fd != 0 && tbytes >= 0)
|
||||
fprintf(stderr,
|
||||
_cupsLangPrintf(stderr,
|
||||
#ifdef HAVE_LONG_LONG
|
||||
_("INFO: Sent print file, %lld bytes...\n"),
|
||||
_("INFO: Sent print file, %lld bytes...\n"),
|
||||
#else
|
||||
_("INFO: Sent print file, %ld bytes...\n"),
|
||||
_("INFO: Sent print file, %ld bytes...\n"),
|
||||
#endif /* HAVE_LONG_LONG */
|
||||
CUPS_LLCAST tbytes);
|
||||
CUPS_LLCAST tbytes);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -319,7 +324,8 @@ list_devices(void)
|
||||
char device[255], /* Device filename */
|
||||
basedevice[255], /* Base device filename for ports */
|
||||
device_id[1024], /* Device ID string */
|
||||
make_model[1024]; /* Make and model */
|
||||
make_model[1024], /* Make and model */
|
||||
uri[1024]; /* Device URI */
|
||||
|
||||
|
||||
if (!access("/dev/parallel/", 0))
|
||||
@@ -345,13 +351,15 @@ list_devices(void)
|
||||
* Now grab the IEEE 1284 device ID string...
|
||||
*/
|
||||
|
||||
snprintf(uri, sizeof(uri), "parallel:%s", device);
|
||||
|
||||
if (!backendGetDeviceID(fd, device_id, sizeof(device_id),
|
||||
make_model, sizeof(make_model),
|
||||
NULL, NULL, 0))
|
||||
printf("direct parallel:%s \"%s\" \"%s LPT #%d\" \"%s\"\n", device,
|
||||
NULL, uri, sizeof(uri)))
|
||||
printf("direct %s \"%s\" \"%s LPT #%d\" \"%s\"\n", uri,
|
||||
make_model, make_model, i + 1, device_id);
|
||||
else
|
||||
printf("direct parallel:%s \"Unknown\" \"LPT #%d\"\n", device, i + 1);
|
||||
printf("direct %s \"Unknown\" \"LPT #%d\"\n", uri, i + 1);
|
||||
|
||||
close(fd);
|
||||
}
|
||||
@@ -613,7 +621,7 @@ side_cb(int print_fd, /* I - Print file */
|
||||
|
||||
if (cupsSideChannelRead(&command, &status, data, &datalen, 1.0))
|
||||
{
|
||||
fputs(_("WARNING: Failed to read side-channel request!\n"), stderr);
|
||||
_cupsLangPuts(stderr, _("WARNING: Failed to read side-channel request!\n"));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
+17
-9
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Common run loop APIs for the Common UNIX Printing System (CUPS).
|
||||
*
|
||||
* Copyright 2007 by Apple Inc.
|
||||
* Copyright 2007-2008 by Apple Inc.
|
||||
* Copyright 2006-2007 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -118,8 +118,8 @@ backendDrainOutput(int print_fd, /* I - Print file descriptor */
|
||||
if (errno != ENOSPC && errno != ENXIO && errno != EAGAIN &&
|
||||
errno != EINTR && errno != ENOTTY)
|
||||
{
|
||||
fprintf(stderr, _("ERROR: Unable to write print data: %s\n"),
|
||||
strerror(errno));
|
||||
_cupsLangPrintf(stderr, _("ERROR: Unable to write print data: %s\n"),
|
||||
strerror(errno));
|
||||
return (-1);
|
||||
}
|
||||
}
|
||||
@@ -212,11 +212,11 @@ backendRunLoop(
|
||||
FD_SET(print_fd, &input);
|
||||
if (use_bc)
|
||||
FD_SET(device_fd, &input);
|
||||
if (side_cb)
|
||||
if (!print_bytes && side_cb)
|
||||
FD_SET(CUPS_SC_FD, &input);
|
||||
|
||||
FD_ZERO(&output);
|
||||
if (print_bytes || !use_bc)
|
||||
if (print_bytes || (!use_bc && !side_cb))
|
||||
FD_SET(device_fd, &output);
|
||||
|
||||
if (use_bc || side_cb)
|
||||
@@ -230,7 +230,7 @@ backendRunLoop(
|
||||
if (errno == ENXIO && offline != 1)
|
||||
{
|
||||
fputs("STATE: +offline-error\n", stderr);
|
||||
fputs(_("INFO: Printer is currently off-line.\n"), stderr);
|
||||
_cupsLangPuts(stderr, _("INFO: Printer is currently off-line.\n"));
|
||||
offline = 1;
|
||||
}
|
||||
else if (errno == EINTR && total_bytes == 0)
|
||||
@@ -250,7 +250,15 @@ backendRunLoop(
|
||||
*/
|
||||
|
||||
if (side_cb && FD_ISSET(CUPS_SC_FD, &input))
|
||||
{
|
||||
/*
|
||||
* Do the side-channel request, then start back over in the select
|
||||
* loop since it may have read from print_fd...
|
||||
*/
|
||||
|
||||
(*side_cb)(print_fd, device_fd, use_bc);
|
||||
continue;
|
||||
}
|
||||
|
||||
/*
|
||||
* Check if we have back-channel data ready...
|
||||
@@ -321,7 +329,7 @@ backendRunLoop(
|
||||
if (paperout != 1)
|
||||
{
|
||||
fputs("STATE: +media-empty-error\n", stderr);
|
||||
fputs(_("ERROR: Out of paper!\n"), stderr);
|
||||
_cupsLangPuts(stderr, _("ERROR: Out of paper!\n"));
|
||||
paperout = 1;
|
||||
}
|
||||
}
|
||||
@@ -330,7 +338,7 @@ backendRunLoop(
|
||||
if (offline != 1)
|
||||
{
|
||||
fputs("STATE: +offline-error\n", stderr);
|
||||
fputs(_("INFO: Printer is currently off-line.\n"), stderr);
|
||||
_cupsLangPuts(stderr, _("INFO: Printer is currently off-line.\n"));
|
||||
offline = 1;
|
||||
}
|
||||
}
|
||||
@@ -352,7 +360,7 @@ backendRunLoop(
|
||||
if (offline)
|
||||
{
|
||||
fputs("STATE: -offline-error\n", stderr);
|
||||
fputs(_("INFO: Printer is now on-line.\n"), stderr);
|
||||
_cupsLangPuts(stderr, _("INFO: Printer is now on-line.\n"));
|
||||
offline = 0;
|
||||
}
|
||||
|
||||
|
||||
+15
-11
@@ -96,7 +96,8 @@ print_device(const char *resource, /* I - SCSI device */
|
||||
|
||||
if (strncmp(resource, "/dev/scsi/", 10) != 0)
|
||||
{
|
||||
fprintf(stderr, _("ERROR: Bad SCSI device file \"%s\"!\n"), resource);
|
||||
_cupsLangPrintf(stderr, _("ERROR: Bad SCSI device file \"%s\"!\n"),
|
||||
resource);
|
||||
return (CUPS_BACKEND_STOP);
|
||||
}
|
||||
|
||||
@@ -119,8 +120,9 @@ print_device(const char *resource, /* I - SCSI device */
|
||||
* available printer in the class.
|
||||
*/
|
||||
|
||||
fputs(_("INFO: Unable to contact printer, queuing on next "
|
||||
"printer in class...\n"), stderr);
|
||||
_cupsLangPuts(stderr,
|
||||
_("INFO: Unable to contact printer, queuing on next "
|
||||
"printer in class...\n"));
|
||||
|
||||
/*
|
||||
* Sleep 5 seconds to keep the job from requeuing too rapidly...
|
||||
@@ -133,13 +135,15 @@ print_device(const char *resource, /* I - SCSI device */
|
||||
|
||||
if (errno != EAGAIN && errno != EBUSY)
|
||||
{
|
||||
fprintf(stderr, _("ERROR: Unable to open device file \"%s\": %s\n"),
|
||||
resource, strerror(errno));
|
||||
_cupsLangPrintf(stderr,
|
||||
_("ERROR: Unable to open device file \"%s\": %s\n"),
|
||||
resource, strerror(errno));
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
else
|
||||
{
|
||||
fputs(_("INFO: Printer busy; will retry in 30 seconds...\n"), stderr);
|
||||
_cupsLangPuts(stderr,
|
||||
_("INFO: Printer busy; will retry in 30 seconds...\n"));
|
||||
sleep(30);
|
||||
}
|
||||
}
|
||||
@@ -201,9 +205,9 @@ print_device(const char *resource, /* I - SCSI device */
|
||||
if (ioctl(scsi_fd, DS_ENTER, &scsi_req) < 0 ||
|
||||
scsi_req.ds_status != 0)
|
||||
{
|
||||
fprintf(stderr,
|
||||
_("WARNING: SCSI command timed out (%d); retrying...\n"),
|
||||
scsi_req.ds_status);
|
||||
_cupsLangPrintf(stderr,
|
||||
_("WARNING: SCSI command timed out (%d); "
|
||||
"retrying...\n"), scsi_req.ds_status);
|
||||
sleep(try + 1);
|
||||
}
|
||||
else
|
||||
@@ -211,8 +215,8 @@ print_device(const char *resource, /* I - SCSI device */
|
||||
|
||||
if (try >= 10)
|
||||
{
|
||||
fprintf(stderr, _("ERROR: Unable to send print data (%d)\n"),
|
||||
scsi_req.ds_status);
|
||||
_cupsLangPrintf(stderr, _("ERROR: Unable to send print data (%d)\n"),
|
||||
scsi_req.ds_status);
|
||||
close(scsi_fd);
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
|
||||
+12
-9
@@ -110,7 +110,8 @@ print_device(const char *resource, /* I - SCSI device */
|
||||
|
||||
if (strncmp(resource, "/dev/sg", 7) != 0)
|
||||
{
|
||||
fprintf(stderr, _("ERROR: Bad SCSI device file \"%s\"!\n"), resource);
|
||||
_cupsLangPrintf(stderr, _("ERROR: Bad SCSI device file \"%s\"!\n"),
|
||||
resource);
|
||||
return (CUPS_BACKEND_STOP);
|
||||
}
|
||||
|
||||
@@ -148,13 +149,15 @@ print_device(const char *resource, /* I - SCSI device */
|
||||
|
||||
if (errno != EAGAIN && errno != EBUSY)
|
||||
{
|
||||
fprintf(stderr, _("ERROR: Unable to open device file \"%s\": %s\n"),
|
||||
resource, strerror(errno));
|
||||
_cupsLangPrintf(stderr,
|
||||
_("ERROR: Unable to open device file \"%s\": %s\n"),
|
||||
resource, strerror(errno));
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
else
|
||||
{
|
||||
fputs(_("INFO: Printer busy; will retry in 30 seconds...\n"), stderr);
|
||||
_cupsLangPuts(stderr,
|
||||
_("INFO: Printer busy; will retry in 30 seconds...\n"));
|
||||
sleep(30);
|
||||
}
|
||||
}
|
||||
@@ -220,9 +223,9 @@ print_device(const char *resource, /* I - SCSI device */
|
||||
if (ioctl(scsi_fd, SG_IO, &scsi_req) < 0 ||
|
||||
scsi_req.status != 0)
|
||||
{
|
||||
fprintf(stderr,
|
||||
_("WARNING: SCSI command timed out (%d); retrying...\n"),
|
||||
scsi_req.status);
|
||||
_cupsLangPrintf(stderr,
|
||||
_("WARNING: SCSI command timed out (%d); "
|
||||
"retrying...\n"), scsi_req.status);
|
||||
sleep(try + 1);
|
||||
}
|
||||
else
|
||||
@@ -230,8 +233,8 @@ print_device(const char *resource, /* I - SCSI device */
|
||||
|
||||
if (try >= 10)
|
||||
{
|
||||
fprintf(stderr, _("ERROR: Unable to send print data (%d)\n"),
|
||||
scsi_req.status);
|
||||
_cupsLangPrintf(stderr, _("ERROR: Unable to send print data (%d)\n"),
|
||||
scsi_req.status);
|
||||
close(scsi_fd);
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
|
||||
+3
-2
@@ -153,8 +153,9 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
}
|
||||
else if (argc < 6 || argc > 7)
|
||||
{
|
||||
fprintf(stderr, _("Usage: %s job-id user title copies options [file]\n"),
|
||||
argv[0]);
|
||||
_cupsLangPrintf(stderr,
|
||||
_("Usage: %s job-id user title copies options [file]\n"),
|
||||
argv[0]);
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
|
||||
|
||||
+42
-27
@@ -104,9 +104,9 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
username[255], /* Username info (not used) */
|
||||
resource[1024], /* Resource info (device and options) */
|
||||
*options, /* Pointer to options */
|
||||
name[255], /* Name of option */
|
||||
value[255], /* Value of option */
|
||||
*ptr; /* Pointer into name or value */
|
||||
*name, /* Name of option */
|
||||
*value, /* Value of option */
|
||||
sep; /* Option separator */
|
||||
int port; /* Port number (not used) */
|
||||
int copies; /* Number of copies to print */
|
||||
int print_fd, /* Print file */
|
||||
@@ -161,8 +161,9 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
}
|
||||
else if (argc < 6 || argc > 7)
|
||||
{
|
||||
fprintf(stderr, _("Usage: %s job-id user title copies options [file]\n"),
|
||||
argv[0]);
|
||||
_cupsLangPrintf(stderr,
|
||||
_("Usage: %s job-id user title copies options [file]\n"),
|
||||
argv[0]);
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
|
||||
@@ -234,8 +235,9 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
* available printer in the class.
|
||||
*/
|
||||
|
||||
fputs(_("INFO: Unable to contact printer, queuing on next "
|
||||
"printer in class...\n"), stderr);
|
||||
_cupsLangPuts(stderr,
|
||||
_("INFO: Unable to contact printer, queuing on next "
|
||||
"printer in class...\n"));
|
||||
|
||||
/*
|
||||
* Sleep 5 seconds to keep the job from requeuing too rapidly...
|
||||
@@ -248,13 +250,15 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
|
||||
if (errno == EBUSY)
|
||||
{
|
||||
fputs(_("INFO: Printer busy; will retry in 30 seconds...\n"), stderr);
|
||||
_cupsLangPuts(stderr,
|
||||
_("INFO: Printer busy; will retry in 30 seconds...\n"));
|
||||
sleep(30);
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf(stderr, _("ERROR: Unable to open device file \"%s\": %s\n"),
|
||||
resource, strerror(errno));
|
||||
_cupsLangPrintf(stderr,
|
||||
_("ERROR: Unable to open device file \"%s\": %s\n"),
|
||||
resource, strerror(errno));
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
}
|
||||
@@ -285,29 +289,30 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
* Get the name...
|
||||
*/
|
||||
|
||||
for (ptr = name; *options && *options != '=';)
|
||||
if (ptr < (name + sizeof(name) - 1))
|
||||
*ptr++ = *options++;
|
||||
*ptr = '\0';
|
||||
name = options;
|
||||
|
||||
if (*options == '=')
|
||||
while (*options && *options != '=' && *options != '+' && *options != '&')
|
||||
options ++;
|
||||
|
||||
if ((sep = *options) != '\0')
|
||||
*options++ = '\0';
|
||||
|
||||
if (sep == '=')
|
||||
{
|
||||
/*
|
||||
* Get the value...
|
||||
*/
|
||||
|
||||
options ++;
|
||||
value = options;
|
||||
|
||||
for (ptr = value; *options && *options != '+' && *options != '&';)
|
||||
if (ptr < (value + sizeof(value) - 1))
|
||||
*ptr++ = *options++;
|
||||
*ptr = '\0';
|
||||
|
||||
if (*options == '+' || *options == '&')
|
||||
while (*options && *options != '+' && *options != '&')
|
||||
options ++;
|
||||
|
||||
if (*options)
|
||||
*options++ = '\0';
|
||||
}
|
||||
else
|
||||
value[0] = '\0';
|
||||
value = (char *)"";
|
||||
|
||||
/*
|
||||
* Process the option...
|
||||
@@ -370,8 +375,8 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
break;
|
||||
# endif /* B230400 */
|
||||
default :
|
||||
fprintf(stderr, _("WARNING: Unsupported baud rate %s!\n"),
|
||||
value);
|
||||
_cupsLangPrintf(stderr, _("WARNING: Unsupported baud rate %s!\n"),
|
||||
value);
|
||||
break;
|
||||
}
|
||||
#endif /* B19200 == 19200 */
|
||||
@@ -551,7 +556,8 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
if (!print_bytes)
|
||||
FD_SET(print_fd, &input);
|
||||
FD_SET(device_fd, &input);
|
||||
FD_SET(CUPS_SC_FD, &input);
|
||||
if (!print_bytes)
|
||||
FD_SET(CUPS_SC_FD, &input);
|
||||
|
||||
FD_ZERO(&output);
|
||||
if (print_bytes)
|
||||
@@ -565,7 +571,15 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
*/
|
||||
|
||||
if (FD_ISSET(CUPS_SC_FD, &input))
|
||||
{
|
||||
/*
|
||||
* Do the side-channel request, then start back over in the select
|
||||
* loop since it may have read from print_fd...
|
||||
*/
|
||||
|
||||
side_cb(print_fd, device_fd, 1);
|
||||
continue;
|
||||
}
|
||||
|
||||
/*
|
||||
* Check if we have back-channel data ready...
|
||||
@@ -1247,7 +1261,8 @@ side_cb(int print_fd, /* I - Print file */
|
||||
|
||||
if (cupsSideChannelRead(&command, &status, data, &datalen, 1.0))
|
||||
{
|
||||
fputs(_("WARNING: Failed to read side-channel request!\n"), stderr);
|
||||
_cupsLangPuts(stderr,
|
||||
_("WARNING: Failed to read side-channel request!\n"));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
+24
-4
@@ -1064,18 +1064,38 @@ asn1_get_string(
|
||||
char *string, /* I - String buffer */
|
||||
int strsize) /* I - String buffer size */
|
||||
{
|
||||
if (length < strsize)
|
||||
if (length < 0)
|
||||
{
|
||||
memcpy(string, *buffer, length);
|
||||
/*
|
||||
* Disallow negative lengths!
|
||||
*/
|
||||
|
||||
fprintf(stderr, "ERROR: Bad ASN1 string length %d!\n", length);
|
||||
*string = '\0';
|
||||
}
|
||||
else if (length < strsize)
|
||||
{
|
||||
/*
|
||||
* String is smaller than the buffer...
|
||||
*/
|
||||
|
||||
if (length > 0)
|
||||
memcpy(string, *buffer, length);
|
||||
|
||||
string[length] = '\0';
|
||||
}
|
||||
else
|
||||
{
|
||||
memcpy(string, buffer, strsize - 1);
|
||||
/*
|
||||
* String is larger than the buffer...
|
||||
*/
|
||||
|
||||
memcpy(string, *buffer, strsize - 1);
|
||||
string[strsize - 1] = '\0';
|
||||
}
|
||||
|
||||
(*buffer) += length;
|
||||
if (length > 0)
|
||||
(*buffer) += length;
|
||||
|
||||
return (string);
|
||||
}
|
||||
|
||||
+65
-44
@@ -68,12 +68,14 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
username[255], /* Username info (not used) */
|
||||
resource[1024], /* Resource info (not used) */
|
||||
*options, /* Pointer to options */
|
||||
name[255], /* Name of option */
|
||||
value[255], /* Value of option */
|
||||
*ptr; /* Pointer into name or value */
|
||||
*name, /* Name of option */
|
||||
*value, /* Value of option */
|
||||
sep; /* Option separator */
|
||||
int print_fd; /* Print file */
|
||||
int copies; /* Number of copies to print */
|
||||
time_t start_time; /* Time of first connect */
|
||||
time_t start_time, /* Time of first connect */
|
||||
current_time, /* Current time */
|
||||
wait_time; /* Time to wait before shutting down socket */
|
||||
int recoverable; /* Recoverable error shown? */
|
||||
int contimeout; /* Connection timeout */
|
||||
int waiteof; /* Wait for end-of-file? */
|
||||
@@ -83,7 +85,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
int device_fd; /* AppSocket */
|
||||
int error; /* Error code (if any) */
|
||||
http_addrlist_t *addrlist, /* Address list */
|
||||
*addr; /* Connected address */
|
||||
*addr; /* Connected address */
|
||||
char addrname[256]; /* Address name */
|
||||
ssize_t tbytes; /* Total number of bytes written */
|
||||
#if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET)
|
||||
@@ -122,8 +124,9 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
}
|
||||
else if (argc < 6 || argc > 7)
|
||||
{
|
||||
fprintf(stderr, _("Usage: %s job-id user title copies options [file]\n"),
|
||||
argv[0]);
|
||||
_cupsLangPrintf(stderr,
|
||||
_("Usage: %s job-id user title copies options [file]\n"),
|
||||
argv[0]);
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
|
||||
@@ -190,29 +193,30 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
* Get the name...
|
||||
*/
|
||||
|
||||
for (ptr = name; *options && *options != '=';)
|
||||
if (ptr < (name + sizeof(name) - 1))
|
||||
*ptr++ = *options++;
|
||||
*ptr = '\0';
|
||||
name = options;
|
||||
|
||||
if (*options == '=')
|
||||
while (*options && *options != '=' && *options != '+' && *options != '&')
|
||||
options ++;
|
||||
|
||||
if ((sep = *options) != '\0')
|
||||
*options++ = '\0';
|
||||
|
||||
if (sep == '=')
|
||||
{
|
||||
/*
|
||||
* Get the value...
|
||||
*/
|
||||
|
||||
options ++;
|
||||
value = options;
|
||||
|
||||
for (ptr = value; *options && *options != '+' && *options != '&';)
|
||||
if (ptr < (value + sizeof(value) - 1))
|
||||
*ptr++ = *options++;
|
||||
*ptr = '\0';
|
||||
|
||||
if (*options == '+' || *options == '&')
|
||||
while (*options && *options != '+' && *options != '&')
|
||||
options ++;
|
||||
|
||||
if (*options)
|
||||
*options++ = '\0';
|
||||
}
|
||||
else
|
||||
value[0] = '\0';
|
||||
value = (char *)"";
|
||||
|
||||
/*
|
||||
* Process the option...
|
||||
@@ -250,12 +254,14 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
|
||||
if ((addrlist = httpAddrGetList(hostname, AF_UNSPEC, portname)) == NULL)
|
||||
{
|
||||
fprintf(stderr, _("ERROR: Unable to locate printer \'%s\'!\n"), hostname);
|
||||
_cupsLangPrintf(stderr, _("ERROR: Unable to locate printer \'%s\'!\n"),
|
||||
hostname);
|
||||
return (CUPS_BACKEND_STOP);
|
||||
}
|
||||
|
||||
fprintf(stderr, _("INFO: Attempting to connect to host %s on port %d\n"),
|
||||
hostname, port);
|
||||
_cupsLangPrintf(stderr,
|
||||
_("INFO: Attempting to connect to host %s on port %d\n"),
|
||||
hostname, port);
|
||||
|
||||
fputs("STATE: +connecting-to-device\n", stderr);
|
||||
|
||||
@@ -275,8 +281,9 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
* available printer in the class.
|
||||
*/
|
||||
|
||||
fputs(_("INFO: Unable to contact printer, queuing on next "
|
||||
"printer in class...\n"), stderr);
|
||||
_cupsLangPuts(stderr,
|
||||
_("INFO: Unable to contact printer, queuing on next "
|
||||
"printer in class...\n"));
|
||||
|
||||
/*
|
||||
* Sleep 5 seconds to keep the job from requeuing too rapidly...
|
||||
@@ -292,16 +299,16 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
{
|
||||
if (contimeout && (time(NULL) - start_time) > contimeout)
|
||||
{
|
||||
fputs(_("ERROR: Printer not responding!\n"), stderr);
|
||||
_cupsLangPuts(stderr, _("ERROR: Printer not responding!\n"));
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
|
||||
recoverable = 1;
|
||||
|
||||
fprintf(stderr,
|
||||
_("WARNING: recoverable: Network host \'%s\' is busy; will "
|
||||
"retry in %d seconds...\n"),
|
||||
hostname, delay);
|
||||
_cupsLangPrintf(stderr,
|
||||
_("WARNING: recoverable: Network host \'%s\' is busy; "
|
||||
"will retry in %d seconds...\n"),
|
||||
hostname, delay);
|
||||
|
||||
sleep(delay);
|
||||
|
||||
@@ -312,9 +319,11 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
{
|
||||
recoverable = 1;
|
||||
|
||||
fprintf(stderr, "DEBUG: Connection error: %s\n", strerror(errno));
|
||||
fputs(_("ERROR: recoverable: Unable to connect to printer; will "
|
||||
"retry in 30 seconds...\n"), stderr);
|
||||
_cupsLangPrintf(stderr, "DEBUG: Connection error: %s\n",
|
||||
strerror(errno));
|
||||
_cupsLangPuts(stderr,
|
||||
_("ERROR: recoverable: Unable to connect to printer; "
|
||||
"will retry in 30 seconds...\n"));
|
||||
sleep(30);
|
||||
}
|
||||
}
|
||||
@@ -335,7 +344,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
}
|
||||
|
||||
fputs("STATE: -connecting-to-device\n", stderr);
|
||||
fprintf(stderr, _("INFO: Connected to %s...\n"), hostname);
|
||||
_cupsLangPrintf(stderr, _("INFO: Connected to %s...\n"), hostname);
|
||||
|
||||
#ifdef AF_INET6
|
||||
if (addr->addr.addr.sa_family == AF_INET6)
|
||||
@@ -368,20 +377,23 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
tbytes = backendRunLoop(print_fd, device_fd, 1, side_cb);
|
||||
|
||||
if (print_fd != 0 && tbytes >= 0)
|
||||
fprintf(stderr,
|
||||
_cupsLangPrintf(stderr,
|
||||
#ifdef HAVE_LONG_LONG
|
||||
_("INFO: Sent print file, %lld bytes...\n"),
|
||||
_("INFO: Sent print file, %lld bytes...\n"),
|
||||
#else
|
||||
_("INFO: Sent print file, %ld bytes...\n"),
|
||||
_("INFO: Sent print file, %ld bytes...\n"),
|
||||
#endif /* HAVE_LONG_LONG */
|
||||
CUPS_LLCAST tbytes);
|
||||
CUPS_LLCAST tbytes);
|
||||
}
|
||||
|
||||
/*
|
||||
* Get any pending back-channel data...
|
||||
* Wait up to 5 seconds to get any pending back-channel data...
|
||||
*/
|
||||
|
||||
while (wait_bc(device_fd, 5) > 0);
|
||||
wait_time = time(NULL) + 5;
|
||||
while (wait_time >= time(¤t_time))
|
||||
if (wait_bc(device_fd, wait_time - current_time) <= 0)
|
||||
break;
|
||||
|
||||
if (waiteof)
|
||||
{
|
||||
@@ -389,8 +401,8 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
* Shutdown the socket and wait for the other end to finish...
|
||||
*/
|
||||
|
||||
fputs(_("INFO: Print file sent, waiting for printer to finish...\n"),
|
||||
stderr);
|
||||
_cupsLangPuts(stderr,
|
||||
_("INFO: Print file sent, waiting for printer to finish...\n"));
|
||||
|
||||
shutdown(device_fd, 1);
|
||||
|
||||
@@ -413,7 +425,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
close(print_fd);
|
||||
|
||||
if (tbytes >= 0)
|
||||
fputs(_("INFO: Ready to print.\n"), stderr);
|
||||
_cupsLangPuts(stderr, _("INFO: Ready to print.\n"));
|
||||
|
||||
return (tbytes < 0 ? CUPS_BACKEND_FAILED : CUPS_BACKEND_OK);
|
||||
}
|
||||
@@ -432,13 +444,14 @@ side_cb(int print_fd, /* I - Print file */
|
||||
cups_sc_status_t status; /* Request/response status */
|
||||
char data[2048]; /* Request/response data */
|
||||
int datalen; /* Request/response data size */
|
||||
const char *device_id; /* 1284DEVICEID env var */
|
||||
|
||||
|
||||
datalen = sizeof(data);
|
||||
|
||||
if (cupsSideChannelRead(&command, &status, data, &datalen, 1.0))
|
||||
{
|
||||
fputs(_("WARNING: Failed to read side-channel request!\n"), stderr);
|
||||
_cupsLangPuts(stderr, _("WARNING: Failed to read side-channel request!\n"));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -462,6 +475,14 @@ side_cb(int print_fd, /* I - Print file */
|
||||
datalen = 1;
|
||||
break;
|
||||
|
||||
case CUPS_SC_CMD_GET_DEVICE_ID :
|
||||
if ((device_id = getenv("1284DEVICEID")) != NULL)
|
||||
{
|
||||
strlcpy(data, device_id, sizeof(data));
|
||||
datalen = (int)strlen(data);
|
||||
break;
|
||||
}
|
||||
|
||||
default :
|
||||
status = CUPS_SC_STATUS_NOT_IMPLEMENTED;
|
||||
datalen = 0;
|
||||
|
||||
+179
-123
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
*
|
||||
* Copyright © 2005-2007 Apple Inc. All rights reserved.
|
||||
* Copyright 2005-2008 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
|
||||
@@ -83,6 +83,7 @@
|
||||
#include <fcntl.h>
|
||||
#include <termios.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/sysctl.h>
|
||||
#include <libgen.h>
|
||||
#include <mach/mach.h>
|
||||
@@ -91,6 +92,7 @@
|
||||
#include <cups/debug.h>
|
||||
#include <cups/sidechannel.h>
|
||||
#include <cups/i18n.h>
|
||||
#include "backend-private.h"
|
||||
|
||||
#include <CoreFoundation/CoreFoundation.h>
|
||||
#include <IOKit/usb/IOUSBLib.h>
|
||||
@@ -105,7 +107,7 @@
|
||||
*/
|
||||
#define WAIT_EOF_DELAY 7
|
||||
#define WAIT_SIDE_DELAY 3
|
||||
#define DEFAULT_TIMEOUT 60L
|
||||
#define DEFAULT_TIMEOUT 5000L
|
||||
|
||||
#define USB_INTERFACE_KIND CFUUIDGetUUIDBytes(kIOUSBInterfaceInterfaceID190)
|
||||
#define kUSBLanguageEnglish 0x409
|
||||
@@ -267,7 +269,7 @@ static void copy_devicestring(io_service_t usbInterface, CFStringRef *deviceID,
|
||||
static void device_added(void *userdata, io_iterator_t iterator);
|
||||
static void get_device_id(cups_sc_status_t *status, char *data, int *datalen);
|
||||
static void iterate_printers(iterator_callback_t callBack, void *userdata);
|
||||
static void parse_options(const char *options, char *serial, UInt32 *location, Boolean *wait_eof);
|
||||
static void parse_options(char *options, char *serial, int serial_size, UInt32 *location, Boolean *wait_eof);
|
||||
static void release_deviceinfo(CFStringRef *make, CFStringRef *model, CFStringRef *serial);
|
||||
static void setup_cfLanguage(void);
|
||||
static void soft_reset();
|
||||
@@ -304,7 +306,7 @@ int /* O - Exit status */
|
||||
print_device(const char *uri, /* I - Device URI */
|
||||
const char *hostname, /* I - Hostname/manufacturer */
|
||||
const char *resource, /* I - Resource/modelname */
|
||||
const char *options, /* I - Device options/serial number */
|
||||
char *options, /* I - Device options/serial number */
|
||||
int print_fd, /* I - File descriptor to print */
|
||||
int copies, /* I - Copies to print */
|
||||
int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
@@ -313,7 +315,9 @@ print_device(const char *uri, /* I - Device URI */
|
||||
char serial[1024]; /* Serial number buffer */
|
||||
OSStatus status; /* Function results */
|
||||
pthread_t read_thread_id, /* Read thread */
|
||||
sidechannel_thread_id;/* Side channel thread */
|
||||
sidechannel_thread_id;/* Side-channel thread */
|
||||
int have_sidechannel = 0; /* Was the side-channel thread started? */
|
||||
struct stat sidechannel_info; /* Side-channel file descriptor info */
|
||||
char print_buffer[8192], /* Print data buffer */
|
||||
*print_ptr; /* Pointer into print data buffer */
|
||||
UInt32 location; /* Unique location in bus topology */
|
||||
@@ -327,9 +331,21 @@ print_device(const char *uri, /* I - Device URI */
|
||||
stimeout; /* Timeout for select() */
|
||||
struct timespec cond_timeout; /* pthread condition timeout */
|
||||
|
||||
|
||||
/*
|
||||
* See if the side-channel descriptor is valid...
|
||||
*/
|
||||
|
||||
have_sidechannel = !fstat(CUPS_SC_FD, &sidechannel_info) &&
|
||||
S_ISSOCK(sidechannel_info.st_mode);
|
||||
|
||||
/*
|
||||
* Localize using CoreFoundation...
|
||||
*/
|
||||
|
||||
setup_cfLanguage();
|
||||
|
||||
parse_options(options, serial, &location, &g.wait_eof);
|
||||
parse_options(options, serial, sizeof(serial), &location, &g.wait_eof);
|
||||
|
||||
if (resource[0] == '/')
|
||||
resource++;
|
||||
@@ -340,6 +356,13 @@ print_device(const char *uri, /* I - Device URI */
|
||||
g.serial = cfstr_create_trim(serial);
|
||||
g.location = location;
|
||||
|
||||
if (!g.make || !g.model)
|
||||
{
|
||||
_cupsLangPrintf(stderr,
|
||||
_("ERROR: Unable to create make and model strings\n"));
|
||||
return CUPS_BACKEND_STOP;
|
||||
}
|
||||
|
||||
fputs("STATE: +connecting-to-device\n", stderr);
|
||||
|
||||
countdown = INITIAL_LOG_INTERVAL;
|
||||
@@ -387,7 +410,7 @@ print_device(const char *uri, /* I - Device URI */
|
||||
strlcpy(print_buffer, "USB class driver", sizeof(print_buffer));
|
||||
|
||||
fputs("STATE: +apple-missing-usbclassdriver-error\n", stderr);
|
||||
fprintf(stderr, _("FATAL: Could not load %s\n"), print_buffer);
|
||||
_cupsLangPrintf(stderr, _("FATAL: Could not load %s\n"), print_buffer);
|
||||
|
||||
if (driverBundlePath)
|
||||
CFRelease(driverBundlePath);
|
||||
@@ -404,7 +427,8 @@ print_device(const char *uri, /* I - Device URI */
|
||||
countdown -= PRINTER_POLLING_INTERVAL;
|
||||
if (countdown <= 0)
|
||||
{
|
||||
fprintf(stderr, _("INFO: Printer busy (status:0x%08x)\n"), (int)status);
|
||||
_cupsLangPrintf(stderr, _("INFO: Printer busy (status:0x%08x)\n"),
|
||||
(int)status);
|
||||
countdown = SUBSEQUENT_LOG_INTERVAL; /* subsequent log entries, every 15 seconds */
|
||||
}
|
||||
}
|
||||
@@ -432,21 +456,14 @@ print_device(const char *uri, /* I - Device URI */
|
||||
}
|
||||
|
||||
/*
|
||||
* Start the side channel thread only if the descriptor is valid
|
||||
* (i.e. it's not when the backend is used for auto-setup)...
|
||||
* Start the side channel thread if the descriptor is valid...
|
||||
*/
|
||||
|
||||
pthread_mutex_init(&g.readwrite_lock_mutex, NULL);
|
||||
pthread_cond_init(&g.readwrite_lock_cond, NULL);
|
||||
g.readwrite_lock = 1;
|
||||
|
||||
FD_ZERO(&input_set);
|
||||
FD_SET(CUPS_SC_FD, &input_set);
|
||||
|
||||
stimeout.tv_sec = 0;
|
||||
stimeout.tv_usec = 0;
|
||||
|
||||
if ((select(CUPS_SC_FD+1, &input_set, NULL, NULL, &stimeout)) >= 0)
|
||||
if (have_sidechannel)
|
||||
{
|
||||
g.sidechannel_thread_stop = 0;
|
||||
g.sidechannel_thread_done = 0;
|
||||
@@ -456,7 +473,7 @@ print_device(const char *uri, /* I - Device URI */
|
||||
|
||||
if (pthread_create(&sidechannel_thread_id, NULL, sidechannel_thread, NULL))
|
||||
{
|
||||
fputs(_("WARNING: Couldn't create side channel\n"), stderr);
|
||||
_cupsLangPuts(stderr, _("WARNING: Couldn't create side channel\n"));
|
||||
return CUPS_BACKEND_STOP;
|
||||
}
|
||||
}
|
||||
@@ -473,7 +490,7 @@ print_device(const char *uri, /* I - Device URI */
|
||||
|
||||
if (pthread_create(&read_thread_id, NULL, read_thread, NULL))
|
||||
{
|
||||
fputs(_("WARNING: Couldn't create read channel\n"), stderr);
|
||||
_cupsLangPuts(stderr, _("WARNING: Couldn't create read channel\n"));
|
||||
return CUPS_BACKEND_STOP;
|
||||
}
|
||||
|
||||
@@ -488,7 +505,7 @@ print_device(const char *uri, /* I - Device URI */
|
||||
|
||||
while (status == noErr && copies-- > 0)
|
||||
{
|
||||
fputs(_("INFO: Sending data\n"), stderr);
|
||||
_cupsLangPuts(stderr, _("INFO: Sending data\n"));
|
||||
|
||||
if (print_fd != STDIN_FILENO)
|
||||
{
|
||||
@@ -556,7 +573,7 @@ print_device(const char *uri, /* I - Device URI */
|
||||
}
|
||||
else if (errno != EAGAIN)
|
||||
{
|
||||
fprintf(stderr, _("ERROR: select() returned %d\n"), (int)errno);
|
||||
_cupsLangPrintf(stderr, _("ERROR: select() returned %d\n"), (int)errno);
|
||||
return CUPS_BACKEND_STOP;
|
||||
}
|
||||
}
|
||||
@@ -632,7 +649,8 @@ print_device(const char *uri, /* I - Device URI */
|
||||
*/
|
||||
|
||||
OSStatus err = (*g.classdriver)->Abort(g.classdriver);
|
||||
fprintf(stderr, _("ERROR: %ld: (canceled:%ld)\n"), (long)status, (long)err);
|
||||
_cupsLangPrintf(stderr, _("ERROR: %ld: (canceled:%ld)\n"),
|
||||
(long)status, (long)err);
|
||||
status = CUPS_BACKEND_STOP;
|
||||
break;
|
||||
}
|
||||
@@ -656,27 +674,42 @@ print_device(const char *uri, /* I - Device URI */
|
||||
* Wait for the side channel thread to exit...
|
||||
*/
|
||||
|
||||
close(CUPS_SC_FD);
|
||||
pthread_mutex_lock(&g.readwrite_lock_mutex);
|
||||
g.readwrite_lock = 0;
|
||||
pthread_cond_signal(&g.readwrite_lock_cond);
|
||||
pthread_mutex_unlock(&g.readwrite_lock_mutex);
|
||||
|
||||
g.sidechannel_thread_stop = 1;
|
||||
pthread_mutex_lock(&g.sidechannel_thread_mutex);
|
||||
if (!g.sidechannel_thread_done)
|
||||
if (have_sidechannel)
|
||||
{
|
||||
cond_timeout.tv_sec = time(NULL) + WAIT_SIDE_DELAY;
|
||||
cond_timeout.tv_nsec = 0;
|
||||
pthread_cond_timedwait(&g.sidechannel_thread_cond,
|
||||
&g.sidechannel_thread_mutex, &cond_timeout);
|
||||
close(CUPS_SC_FD);
|
||||
pthread_mutex_lock(&g.readwrite_lock_mutex);
|
||||
g.readwrite_lock = 0;
|
||||
pthread_cond_signal(&g.readwrite_lock_cond);
|
||||
pthread_mutex_unlock(&g.readwrite_lock_mutex);
|
||||
|
||||
g.sidechannel_thread_stop = 1;
|
||||
pthread_mutex_lock(&g.sidechannel_thread_mutex);
|
||||
if (!g.sidechannel_thread_done)
|
||||
{
|
||||
/*
|
||||
* Wait for the side-channel thread to exit...
|
||||
*/
|
||||
|
||||
cond_timeout.tv_sec = time(NULL) + WAIT_SIDE_DELAY;
|
||||
cond_timeout.tv_nsec = 0;
|
||||
if (pthread_cond_timedwait(&g.sidechannel_thread_cond,
|
||||
&g.sidechannel_thread_mutex,
|
||||
&cond_timeout) != 0)
|
||||
{
|
||||
/*
|
||||
* Force the side-channel thread to exit...
|
||||
*/
|
||||
|
||||
pthread_kill(sidechannel_thread_id, SIGTERM);
|
||||
}
|
||||
}
|
||||
pthread_mutex_unlock(&g.sidechannel_thread_mutex);
|
||||
|
||||
pthread_join(sidechannel_thread_id, NULL);
|
||||
|
||||
pthread_cond_destroy(&g.sidechannel_thread_cond);
|
||||
pthread_mutex_destroy(&g.sidechannel_thread_mutex);
|
||||
}
|
||||
pthread_mutex_unlock(&g.sidechannel_thread_mutex);
|
||||
|
||||
pthread_join(sidechannel_thread_id, NULL);
|
||||
|
||||
pthread_cond_destroy(&g.sidechannel_thread_cond);
|
||||
pthread_mutex_destroy(&g.sidechannel_thread_mutex);
|
||||
|
||||
pthread_cond_destroy(&g.readwrite_lock_cond);
|
||||
pthread_mutex_destroy(&g.readwrite_lock_mutex);
|
||||
@@ -689,9 +722,7 @@ print_device(const char *uri, /* I - Device URI */
|
||||
|
||||
/*
|
||||
* Give the read thread WAIT_EOF_DELAY seconds to complete all the data. If
|
||||
* we are not signaled in that time then force the thread to exit by setting
|
||||
* the waiteof to be false. Plese note that this relies on us using the timeout
|
||||
* class driver.
|
||||
* we are not signaled in that time then force the thread to exit.
|
||||
*/
|
||||
|
||||
pthread_mutex_lock(&g.read_thread_mutex);
|
||||
@@ -703,7 +734,13 @@ print_device(const char *uri, /* I - Device URI */
|
||||
|
||||
if (pthread_cond_timedwait(&g.read_thread_cond, &g.read_thread_mutex,
|
||||
&cond_timeout) != 0)
|
||||
g.wait_eof = false;
|
||||
{
|
||||
/*
|
||||
* Force the read thread to exit...
|
||||
*/
|
||||
|
||||
pthread_kill(read_thread_id, SIGTERM);
|
||||
}
|
||||
}
|
||||
pthread_mutex_unlock(&g.read_thread_mutex);
|
||||
|
||||
@@ -827,8 +864,16 @@ sidechannel_thread(void *reference)
|
||||
switch (command)
|
||||
{
|
||||
case CUPS_SC_CMD_SOFT_RESET: /* Do a soft reset */
|
||||
soft_reset();
|
||||
cupsSideChannelWrite(command, CUPS_SC_STATUS_OK, NULL, 0, 1.0);
|
||||
if ((*g.classdriver)->SoftReset != NULL)
|
||||
{
|
||||
soft_reset();
|
||||
cupsSideChannelWrite(command, CUPS_SC_STATUS_OK, NULL, 0, 1.0);
|
||||
}
|
||||
else
|
||||
{
|
||||
cupsSideChannelWrite(command, CUPS_SC_STATUS_NOT_IMPLEMENTED,
|
||||
NULL, 0, 1.0);
|
||||
}
|
||||
break;
|
||||
|
||||
case CUPS_SC_CMD_DRAIN_OUTPUT: /* Drain all pending output */
|
||||
@@ -964,25 +1009,23 @@ static Boolean list_device_cb(void *refcon,
|
||||
{
|
||||
CFStringRef make = NULL, model = NULL, serial = NULL;
|
||||
char uristr[1024], makestr[1024], modelstr[1024], serialstr[1024];
|
||||
char optionsstr[1024], idstr[1024];
|
||||
char optionsstr[1024], idstr[1024], make_modelstr[1024];
|
||||
|
||||
copy_deviceinfo(deviceIDString, &make, &model, &serial);
|
||||
CFStringGetCString(deviceIDString, idstr, sizeof(idstr),
|
||||
kCFStringEncodingUTF8);
|
||||
backendGetMakeModel(idstr, make_modelstr, sizeof(make_modelstr));
|
||||
|
||||
modelstr[0] = '/';
|
||||
|
||||
CFStringGetCString(deviceIDString, idstr, sizeof(idstr),
|
||||
kCFStringEncodingUTF8);
|
||||
|
||||
if (make)
|
||||
CFStringGetCString(make, makestr, sizeof(makestr),
|
||||
kCFStringEncodingUTF8);
|
||||
else
|
||||
if (!make ||
|
||||
!CFStringGetCString(make, makestr, sizeof(makestr),
|
||||
kCFStringEncodingUTF8))
|
||||
strcpy(makestr, "Unknown");
|
||||
|
||||
if (model)
|
||||
CFStringGetCString(model, &modelstr[1], sizeof(modelstr)-1,
|
||||
kCFStringEncodingUTF8);
|
||||
else
|
||||
if (!model ||
|
||||
!CFStringGetCString(model, &modelstr[1], sizeof(modelstr)-1,
|
||||
kCFStringEncodingUTF8))
|
||||
strcpy(modelstr + 1, "Printer");
|
||||
|
||||
optionsstr[0] = '\0';
|
||||
@@ -997,18 +1040,8 @@ static Boolean list_device_cb(void *refcon,
|
||||
httpAssembleURI(HTTP_URI_CODING_ALL, uristr, sizeof(uristr), "usb", NULL, makestr, 0, modelstr);
|
||||
strncat(uristr, optionsstr, sizeof(uristr));
|
||||
|
||||
/*
|
||||
* Fix common HP 1284 bug...
|
||||
*/
|
||||
|
||||
if (!strcasecmp(makestr, "Hewlett-Packard"))
|
||||
strcpy(makestr, "HP");
|
||||
|
||||
if (!strncasecmp(modelstr + 1, "hp ", 3))
|
||||
_cups_strcpy(modelstr + 1, modelstr + 4);
|
||||
|
||||
printf("direct %s \"%s %s\" \"%s %s USB\" \"%s\"\n", uristr, makestr,
|
||||
&modelstr[1], makestr, &modelstr[1], idstr);
|
||||
printf("direct %s \"%s\" \"%s USB\" \"%s\"\n", uristr, make_modelstr,
|
||||
make_modelstr, idstr);
|
||||
|
||||
release_deviceinfo(&make, &model, &serial);
|
||||
CFRelease(deviceIDString);
|
||||
@@ -1040,9 +1073,9 @@ static Boolean find_device_cb(void *refcon,
|
||||
CFStringRef make = NULL, model = NULL, serial = NULL;
|
||||
|
||||
copy_deviceinfo(idString, &make, &model, &serial);
|
||||
if (CFStringCompare(make, g.make, kCFCompareCaseInsensitive) == kCFCompareEqualTo)
|
||||
if (make && CFStringCompare(make, g.make, kCFCompareCaseInsensitive) == kCFCompareEqualTo)
|
||||
{
|
||||
if (CFStringCompare(model, g.model, kCFCompareCaseInsensitive) == kCFCompareEqualTo)
|
||||
if (model && CFStringCompare(model, g.model, kCFCompareCaseInsensitive) == kCFCompareEqualTo)
|
||||
{
|
||||
if (g.serial != NULL && CFStringGetLength(g.serial) > 0)
|
||||
{
|
||||
@@ -1091,7 +1124,7 @@ static Boolean find_device_cb(void *refcon,
|
||||
if (!keepLooking && g.status_timer != NULL)
|
||||
{
|
||||
fputs("STATE: -offline-error\n", stderr);
|
||||
fputs(_("INFO: Printer is now on-line.\n"), stderr);
|
||||
_cupsLangPuts(stderr, _("INFO: Printer is now on-line.\n"));
|
||||
CFRunLoopRemoveTimer(CFRunLoopGetCurrent(), g.status_timer, kCFRunLoopDefaultMode);
|
||||
CFRelease(g.status_timer);
|
||||
g.status_timer = NULL;
|
||||
@@ -1109,7 +1142,23 @@ static void status_timer_cb(CFRunLoopTimerRef timer,
|
||||
void *info)
|
||||
{
|
||||
fputs("STATE: +offline-error\n", stderr);
|
||||
fputs(_("INFO: Printer is currently off-line.\n"), stderr);
|
||||
_cupsLangPuts(stderr, _("INFO: Printer is currently off-line.\n"));
|
||||
|
||||
if (getenv("CLASS") != NULL)
|
||||
{
|
||||
/*
|
||||
* If the CLASS environment variable is set, the job was submitted
|
||||
* to a class and not to a specific queue. In this case, we want
|
||||
* to abort immediately so that the job can be requeued on the next
|
||||
* available printer in the class.
|
||||
*
|
||||
* Sleep 5 seconds to keep the job from requeuing too rapidly...
|
||||
*/
|
||||
|
||||
sleep(5);
|
||||
|
||||
exit(CUPS_BACKEND_FAILED);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1129,8 +1178,10 @@ static void copy_deviceinfo(CFStringRef deviceIDString,
|
||||
|
||||
if (make != NULL)
|
||||
*make = copy_value_for_key(deviceIDString, makeKeys);
|
||||
|
||||
if (model != NULL)
|
||||
*model = copy_value_for_key(deviceIDString, modelKeys);
|
||||
|
||||
if (serial != NULL)
|
||||
*serial = copy_value_for_key(deviceIDString, serialKeys);
|
||||
}
|
||||
@@ -1541,18 +1592,19 @@ CFStringRef cfstr_create_trim(const char *cstr)
|
||||
|
||||
#pragma mark -
|
||||
/*
|
||||
* 'parse_options()' - Parse uri options.
|
||||
* 'parse_options()' - Parse URI options.
|
||||
*/
|
||||
|
||||
static void parse_options(const char *options,
|
||||
static void parse_options(char *options,
|
||||
char *serial,
|
||||
int serial_size,
|
||||
UInt32 *location,
|
||||
Boolean *wait_eof)
|
||||
{
|
||||
char *serialnumber; /* ?serial=<serial> or ?location=<location> */
|
||||
char optionName[255], /* Name of option */
|
||||
value[255], /* Value of option */
|
||||
*ptr; /* Pointer into name or value */
|
||||
char sep, /* Separator character */
|
||||
*name, /* Name of option */
|
||||
*value; /* Value of option */
|
||||
|
||||
|
||||
if (serial)
|
||||
*serial = '\0';
|
||||
@@ -1562,65 +1614,67 @@ static void parse_options(const char *options,
|
||||
if (!options)
|
||||
return;
|
||||
|
||||
serialnumber = NULL;
|
||||
|
||||
while (*options != '\0')
|
||||
while (*options)
|
||||
{
|
||||
/* Get the name... */
|
||||
for (ptr = optionName; *options && *options != '=' && *options != '+';)
|
||||
*ptr++ = *options++;
|
||||
/*
|
||||
* Get the name...
|
||||
*/
|
||||
|
||||
*ptr = '\0';
|
||||
value[0] = '\0';
|
||||
name = options;
|
||||
|
||||
if (*options == '=')
|
||||
{
|
||||
/* Get the value... */
|
||||
while (*options && *options != '=' && *options != '+' && *options != '&')
|
||||
options ++;
|
||||
|
||||
for (ptr = value; *options && *options != '+';)
|
||||
*ptr++ = *options++;
|
||||
if ((sep = *options) != '\0')
|
||||
*options++ = '\0';
|
||||
|
||||
*ptr = '\0';
|
||||
if (sep == '=')
|
||||
{
|
||||
/*
|
||||
* Get the value...
|
||||
*/
|
||||
|
||||
if (*options == '+')
|
||||
value = options;
|
||||
|
||||
while (*options && *options != '+' && *options != '&')
|
||||
options ++;
|
||||
}
|
||||
else if (*options == '+')
|
||||
options ++;
|
||||
|
||||
/*
|
||||
* Process the option...
|
||||
*/
|
||||
if (strcasecmp(optionName, "waiteof") == 0)
|
||||
if (*options)
|
||||
*options++ = '\0';
|
||||
}
|
||||
else
|
||||
value = (char *)"";
|
||||
|
||||
/*
|
||||
* Process the option...
|
||||
*/
|
||||
|
||||
if (!strcasecmp(name, "waiteof"))
|
||||
{
|
||||
if (strcasecmp(value, "on") == 0 ||
|
||||
strcasecmp(value, "yes") == 0 ||
|
||||
strcasecmp(value, "true") == 0)
|
||||
if (!strcasecmp(value, "on") ||
|
||||
!strcasecmp(value, "yes") ||
|
||||
!strcasecmp(value, "true"))
|
||||
*wait_eof = true;
|
||||
else if (strcasecmp(value, "off") == 0 ||
|
||||
strcasecmp(value, "no") == 0 ||
|
||||
strcasecmp(value, "false") == 0)
|
||||
else if (!strcasecmp(value, "off") ||
|
||||
!strcasecmp(value, "no") ||
|
||||
!strcasecmp(value, "false"))
|
||||
*wait_eof = false;
|
||||
else
|
||||
fprintf(stderr, _("WARNING: Boolean expected for waiteof option \"%s\"\n"), value);
|
||||
_cupsLangPrintf(stderr,
|
||||
_("WARNING: Boolean expected for waiteof option "
|
||||
"\"%s\"\n"), value);
|
||||
}
|
||||
else if (strcasecmp(optionName, "serial") == 0)
|
||||
{
|
||||
strcpy(serial, value);
|
||||
serialnumber = serial;
|
||||
}
|
||||
else if (strcasecmp(optionName, "location") == 0 && location)
|
||||
else if (!strcasecmp(name, "serial"))
|
||||
strlcpy(serial, value, serial_size);
|
||||
else if (!strcasecmp(name, "location") && location)
|
||||
*location = strtol(value, NULL, 16);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
* @function setup_cfLanguage
|
||||
* @abstract Convert the contents of the CUPS 'LANG' environment
|
||||
* @abstract Convert the contents of the CUPS 'APPLE_LANGUAGE' environment
|
||||
* variable into a one element CF array of languages.
|
||||
*
|
||||
* @discussion Each submitted job comes with a natural language. CUPS passes
|
||||
@@ -1636,7 +1690,9 @@ static void setup_cfLanguage(void)
|
||||
CFArrayRef langArray = NULL;
|
||||
const char *requestedLang = NULL;
|
||||
|
||||
requestedLang = getenv("LANG");
|
||||
if ((requestedLang = getenv("APPLE_LANGUAGE")) == NULL)
|
||||
requestedLang = getenv("LANG");
|
||||
|
||||
if (requestedLang != NULL)
|
||||
{
|
||||
lang[0] = CFStringCreateWithCString(kCFAllocatorDefault, requestedLang, kCFStringEncodingUTF8);
|
||||
@@ -1649,7 +1705,7 @@ static void setup_cfLanguage(void)
|
||||
CFRelease(langArray);
|
||||
}
|
||||
else
|
||||
fputs("DEBUG: usb: LANG environment variable missing.\n", stderr);
|
||||
fputs("DEBUG: usb: LANG and APPLE_LANGUAGE environment variables missing.\n", stderr);
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
@@ -1888,7 +1944,7 @@ static void parse_pserror(char *sockBuffer,
|
||||
|
||||
|
||||
/*
|
||||
* 'soft_reset'
|
||||
* 'soft_reset()' - Send a soft reset to the device.
|
||||
*/
|
||||
|
||||
static void soft_reset()
|
||||
@@ -1936,7 +1992,7 @@ static void soft_reset()
|
||||
* Send the reset...
|
||||
*/
|
||||
|
||||
(*g.classdriver)->SoftReset(g.classdriver, 0);
|
||||
(*g.classdriver)->SoftReset(g.classdriver, DEFAULT_TIMEOUT);
|
||||
|
||||
/*
|
||||
* Release the I/O lock...
|
||||
|
||||
+27
-33
@@ -48,7 +48,7 @@ int /* O - Exit status */
|
||||
print_device(const char *uri, /* I - Device URI */
|
||||
const char *hostname, /* I - Hostname/manufacturer */
|
||||
const char *resource, /* I - Resource/modelname */
|
||||
const char *options, /* I - Device options/serial number */
|
||||
char *options, /* I - Device options/serial number */
|
||||
int print_fd, /* I - File descriptor to print */
|
||||
int copies, /* I - Copies to print */
|
||||
int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
@@ -90,8 +90,8 @@ print_device(const char *uri, /* I - Device URI */
|
||||
|
||||
use_bc = strcasecmp(hostname, "Brother") &&
|
||||
strcasecmp(hostname, "Canon") &&
|
||||
strcasecmp(hostname, "Konica Minolta") &&
|
||||
strcasecmp(hostname, "Minolta");
|
||||
strncasecmp(hostname, "Konica", 6) &&
|
||||
strncasecmp(hostname, "Minolta", 7);
|
||||
#endif /* __FreeBSD__ || __NetBSD__ || __OpenBSD__ || __DragonFly__ */
|
||||
|
||||
if ((device_fd = open_device(uri, &use_bc)) == -1)
|
||||
@@ -105,8 +105,9 @@ print_device(const char *uri, /* I - Device URI */
|
||||
* available printer in the class.
|
||||
*/
|
||||
|
||||
fputs(_("INFO: Unable to contact printer, queuing on next "
|
||||
"printer in class...\n"), stderr);
|
||||
_cupsLangPuts(stderr,
|
||||
_("INFO: Unable to contact printer, queuing on next "
|
||||
"printer in class...\n"));
|
||||
|
||||
/*
|
||||
* Sleep 5 seconds to keep the job from requeuing too rapidly...
|
||||
@@ -119,20 +120,23 @@ print_device(const char *uri, /* I - Device URI */
|
||||
|
||||
if (errno == EBUSY)
|
||||
{
|
||||
fputs(_("INFO: Printer busy; will retry in 10 seconds...\n"), stderr);
|
||||
_cupsLangPuts(stderr,
|
||||
_("INFO: Printer busy; will retry in 10 seconds...\n"));
|
||||
sleep(10);
|
||||
}
|
||||
else if (errno == ENXIO || errno == EIO || errno == ENOENT ||
|
||||
errno == ENODEV)
|
||||
{
|
||||
fputs(_("INFO: Printer not connected; will retry in 30 seconds...\n"),
|
||||
stderr);
|
||||
_cupsLangPuts(stderr,
|
||||
_("INFO: Printer not connected; will retry in 30 "
|
||||
"seconds...\n"));
|
||||
sleep(30);
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf(stderr, _("ERROR: Unable to open device file \"%s\": %s\n"),
|
||||
resource, strerror(errno));
|
||||
_cupsLangPrintf(stderr,
|
||||
_("ERROR: Unable to open device file \"%s\": %s\n"),
|
||||
resource, strerror(errno));
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
}
|
||||
@@ -172,13 +176,13 @@ print_device(const char *uri, /* I - Device URI */
|
||||
tbytes = backendRunLoop(print_fd, device_fd, use_bc, side_cb);
|
||||
|
||||
if (print_fd != 0 && tbytes >= 0)
|
||||
fprintf(stderr,
|
||||
_cupsLangPrintf(stderr,
|
||||
#ifdef HAVE_LONG_LONG
|
||||
_("INFO: Sent print file, %lld bytes...\n"),
|
||||
_("INFO: Sent print file, %lld bytes...\n"),
|
||||
#else
|
||||
_("INFO: Sent print file, %ld bytes...\n"),
|
||||
_("INFO: Sent print file, %ld bytes...\n"),
|
||||
#endif /* HAVE_LONG_LONG */
|
||||
CUPS_LLCAST tbytes);
|
||||
CUPS_LLCAST tbytes);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -341,7 +345,7 @@ open_device(const char *uri, /* I - Device URI */
|
||||
* Find the correct USB device...
|
||||
*/
|
||||
|
||||
do
|
||||
for (;;)
|
||||
{
|
||||
for (busy = 0, i = 0; i < 16; i ++)
|
||||
{
|
||||
@@ -410,21 +414,11 @@ open_device(const char *uri, /* I - Device URI */
|
||||
*/
|
||||
|
||||
if (busy)
|
||||
{
|
||||
fputs(_("INFO: Printer busy; will retry in 5 seconds...\n"),
|
||||
stderr);
|
||||
sleep(5);
|
||||
}
|
||||
_cupsLangPuts(stderr,
|
||||
_("INFO: Printer busy; will retry in 5 seconds...\n"));
|
||||
|
||||
sleep(5);
|
||||
}
|
||||
while (busy);
|
||||
|
||||
/*
|
||||
* Couldn't find the printer, return "no such device or address"...
|
||||
*/
|
||||
|
||||
errno = ENODEV;
|
||||
|
||||
return (-1);
|
||||
}
|
||||
#elif defined(__sun) && defined(ECPPIOC_GETDEVID)
|
||||
{
|
||||
@@ -504,8 +498,8 @@ open_device(const char *uri, /* I - Device URI */
|
||||
|
||||
if (busy)
|
||||
{
|
||||
fputs(_("INFO: Printer is busy; will retry in 5 seconds...\n"),
|
||||
stderr);
|
||||
_cupsLangPuts(stderr,
|
||||
_("INFO: Printer is busy; will retry in 5 seconds...\n"));
|
||||
sleep(5);
|
||||
}
|
||||
}
|
||||
@@ -521,7 +515,7 @@ open_device(const char *uri, /* I - Device URI */
|
||||
}
|
||||
#else
|
||||
{
|
||||
if (use_bc)
|
||||
if (*use_bc)
|
||||
fd = open(uri + 4, O_RDWR | O_EXCL);
|
||||
else
|
||||
fd = -1;
|
||||
@@ -562,7 +556,7 @@ side_cb(int print_fd, /* I - Print file */
|
||||
|
||||
if (cupsSideChannelRead(&command, &status, data, &datalen, 1.0))
|
||||
{
|
||||
fputs(_("WARNING: Failed to read side-channel request!\n"), stderr);
|
||||
_cupsLangPuts(stderr, _("WARNING: Failed to read side-channel request!\n"));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
+10
-8
@@ -54,7 +54,7 @@
|
||||
|
||||
void list_devices(void);
|
||||
int print_device(const char *uri, const char *hostname,
|
||||
const char *resource, const char *options,
|
||||
const char *resource, char *options,
|
||||
int print_fd, int copies, int argc, char *argv[]);
|
||||
|
||||
|
||||
@@ -99,7 +99,7 @@ int /* O - Exit status */
|
||||
print_device(const char *uri, /* I - Device URI */
|
||||
const char *hostname, /* I - Hostname/manufacturer */
|
||||
const char *resource, /* I - Resource/modelname */
|
||||
const char *options, /* I - Device options/serial number */
|
||||
char *options, /* I - Device options/serial number */
|
||||
int print_fd, /* I - File descriptor to print */
|
||||
int copies, /* I - Copies to print */
|
||||
int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
@@ -184,8 +184,9 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
}
|
||||
else if (argc < 6 || argc > 7)
|
||||
{
|
||||
fprintf(stderr, _("Usage: %s job-id user title copies options [file]\n"),
|
||||
argv[0]);
|
||||
_cupsLangPrintf(stderr,
|
||||
_("Usage: %s job-id user title copies options [file]\n"),
|
||||
argv[0]);
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
|
||||
@@ -200,8 +201,9 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
hostname, sizeof(hostname), &port,
|
||||
resource, sizeof(resource)) < HTTP_URI_OK)
|
||||
{
|
||||
fputs(_("ERROR: No device URI found in argv[0] or in DEVICE_URI "
|
||||
"environment variable!\n"), stderr);
|
||||
_cupsLangPuts(stderr,
|
||||
_("ERROR: No device URI found in argv[0] or in DEVICE_URI "
|
||||
"environment variable!\n"));
|
||||
return (1);
|
||||
}
|
||||
|
||||
@@ -237,8 +239,8 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
|
||||
if ((print_fd = open(argv[6], O_RDONLY)) < 0)
|
||||
{
|
||||
fprintf(stderr, _("ERROR: Unable to open print file %s - %s\n"),
|
||||
argv[6], strerror(errno));
|
||||
_cupsLangPrintf(stderr, _("ERROR: Unable to open print file %s - %s\n"),
|
||||
argv[6], strerror(errno));
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
|
||||
|
||||
+13
-12
@@ -1,13 +1,14 @@
|
||||
# DO NOT DELETE THIS LINE -- make depend depends on it.
|
||||
lpc.o: lpc.c ../cups/cups.h ../cups/ipp.h ../cups/http.h ../cups/ppd.h \
|
||||
../cups/array.h ../cups/file.h ../cups/language.h ../cups/i18n.h \
|
||||
../cups/transcode.h ../cups/debug.h ../cups/string.h ../config.h
|
||||
lpq.o: lpq.c ../cups/string.h ../config.h ../cups/cups.h ../cups/ipp.h \
|
||||
../cups/http.h ../cups/ppd.h ../cups/array.h ../cups/file.h \
|
||||
../cups/language.h ../cups/i18n.h ../cups/transcode.h ../cups/debug.h
|
||||
lpr.o: lpr.c ../cups/string.h ../config.h ../cups/cups.h ../cups/ipp.h \
|
||||
../cups/http.h ../cups/ppd.h ../cups/array.h ../cups/file.h \
|
||||
../cups/language.h ../cups/i18n.h ../cups/transcode.h
|
||||
lprm.o: lprm.c ../cups/cups.h ../cups/ipp.h ../cups/http.h ../cups/ppd.h \
|
||||
../cups/array.h ../cups/file.h ../cups/language.h ../cups/i18n.h \
|
||||
../cups/transcode.h ../cups/string.h ../config.h
|
||||
|
||||
lpc.o: ../cups/cups.h ../cups/ipp.h ../cups/http.h ../cups/ppd.h
|
||||
lpc.o: ../cups/array.h ../cups/file.h ../cups/language.h ../cups/i18n.h
|
||||
lpc.o: ../cups/transcode.h ../cups/debug.h ../cups/string.h ../config.h
|
||||
lpq.o: ../cups/string.h ../config.h ../cups/cups.h ../cups/ipp.h
|
||||
lpq.o: ../cups/http.h ../cups/ppd.h ../cups/array.h ../cups/file.h
|
||||
lpq.o: ../cups/language.h ../cups/i18n.h ../cups/transcode.h ../cups/debug.h
|
||||
lpr.o: ../cups/string.h ../config.h ../cups/cups.h ../cups/ipp.h
|
||||
lpr.o: ../cups/http.h ../cups/ppd.h ../cups/array.h ../cups/file.h
|
||||
lpr.o: ../cups/language.h ../cups/i18n.h ../cups/transcode.h
|
||||
lprm.o: ../cups/cups.h ../cups/ipp.h ../cups/http.h ../cups/ppd.h
|
||||
lprm.o: ../cups/array.h ../cups/file.h ../cups/language.h ../cups/i18n.h
|
||||
lprm.o: ../cups/transcode.h ../cups/string.h ../config.h
|
||||
|
||||
+1
-13
@@ -230,7 +230,6 @@ show_status(http_t *http, /* I - HTTP connection to server */
|
||||
ipp_t *request, /* IPP Request */
|
||||
*response; /* IPP Response */
|
||||
ipp_attribute_t *attr; /* Current attribute */
|
||||
cups_lang_t *language; /* Default language */
|
||||
char *printer, /* Printer name */
|
||||
*device, /* Device URI */
|
||||
*delimiter; /* Char search result */
|
||||
@@ -263,18 +262,7 @@ show_status(http_t *http, /* I - HTTP connection to server */
|
||||
* attributes-natural-language
|
||||
*/
|
||||
|
||||
request = ippNew();
|
||||
|
||||
request->request.op.operation_id = CUPS_GET_PRINTERS;
|
||||
request->request.op.request_id = 1;
|
||||
|
||||
language = cupsLangDefault();
|
||||
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET,
|
||||
"attributes-charset", NULL, cupsLangEncoding(language));
|
||||
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE,
|
||||
"attributes-natural-language", NULL, language->language);
|
||||
request = ippNewRequest(CUPS_GET_PRINTERS);
|
||||
|
||||
ippAddStrings(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD,
|
||||
"requested-attributes", sizeof(requested) / sizeof(requested[0]),
|
||||
|
||||
+3
-5
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* "lpr" command for the Common UNIX Printing System (CUPS).
|
||||
*
|
||||
* Copyright 2007 by Apple Inc.
|
||||
* Copyright 2007-2008 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -200,11 +200,11 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
break;
|
||||
|
||||
case 'l' : /* Literal/raw */
|
||||
num_options = cupsAddOption("raw", "", num_options, &options);
|
||||
num_options = cupsAddOption("raw", "true", num_options, &options);
|
||||
break;
|
||||
|
||||
case 'p' : /* Prettyprint */
|
||||
num_options = cupsAddOption("prettyprint", "", num_options,
|
||||
num_options = cupsAddOption("prettyprint", "true", num_options,
|
||||
&options);
|
||||
break;
|
||||
|
||||
@@ -420,8 +420,6 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
}
|
||||
else
|
||||
{
|
||||
num_files = 1;
|
||||
|
||||
#ifndef WIN32
|
||||
# if defined(HAVE_SIGSET)
|
||||
sigset(SIGHUP, sighandler);
|
||||
|
||||
+55
-55
@@ -1,56 +1,56 @@
|
||||
# DO NOT DELETE THIS LINE -- make depend depends on it.
|
||||
help-index.o: help-index.c cgi-private.h cgi.h ../cups/cups.h \
|
||||
../cups/ipp.h ../cups/http.h ../cups/ppd.h ../cups/array.h \
|
||||
../cups/file.h ../cups/language.h ../cups/array.h help-index.h \
|
||||
../cups/debug.h ../cups/i18n.h ../cups/transcode.h ../cups/string.h \
|
||||
../config.h ../cups/dir.h
|
||||
html.o: html.c cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h \
|
||||
../cups/http.h ../cups/ppd.h ../cups/array.h ../cups/file.h \
|
||||
../cups/language.h ../cups/array.h help-index.h ../cups/debug.h \
|
||||
../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h
|
||||
ipp-var.o: ipp-var.c cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h \
|
||||
../cups/http.h ../cups/ppd.h ../cups/array.h ../cups/file.h \
|
||||
../cups/language.h ../cups/array.h help-index.h ../cups/debug.h \
|
||||
../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h
|
||||
search.o: search.c cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h \
|
||||
../cups/http.h ../cups/ppd.h ../cups/array.h ../cups/file.h \
|
||||
../cups/language.h ../cups/array.h help-index.h ../cups/debug.h \
|
||||
../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h
|
||||
template.o: template.c cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h \
|
||||
../cups/http.h ../cups/ppd.h ../cups/array.h ../cups/file.h \
|
||||
../cups/language.h ../cups/array.h help-index.h ../cups/debug.h \
|
||||
../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h
|
||||
var.o: var.c cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h \
|
||||
../cups/http.h ../cups/ppd.h ../cups/array.h ../cups/file.h \
|
||||
../cups/language.h ../cups/array.h help-index.h ../cups/debug.h \
|
||||
../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h
|
||||
admin.o: admin.c cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h \
|
||||
../cups/http.h ../cups/ppd.h ../cups/array.h ../cups/file.h \
|
||||
../cups/language.h ../cups/array.h help-index.h ../cups/debug.h \
|
||||
../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h \
|
||||
../cups/adminutil.h ../cups/cups.h ../cups/file.h
|
||||
classes.o: classes.c cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h \
|
||||
../cups/http.h ../cups/ppd.h ../cups/array.h ../cups/file.h \
|
||||
../cups/language.h ../cups/array.h help-index.h ../cups/debug.h \
|
||||
../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h
|
||||
help.o: help.c cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h \
|
||||
../cups/http.h ../cups/ppd.h ../cups/array.h ../cups/file.h \
|
||||
../cups/language.h ../cups/array.h help-index.h ../cups/debug.h \
|
||||
../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h
|
||||
jobs.o: jobs.c cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h \
|
||||
../cups/http.h ../cups/ppd.h ../cups/array.h ../cups/file.h \
|
||||
../cups/language.h ../cups/array.h help-index.h ../cups/debug.h \
|
||||
../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h
|
||||
printers.o: printers.c cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h \
|
||||
../cups/http.h ../cups/ppd.h ../cups/array.h ../cups/file.h \
|
||||
../cups/language.h ../cups/array.h help-index.h ../cups/debug.h \
|
||||
../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h
|
||||
testcgi.o: testcgi.c cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h \
|
||||
../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h \
|
||||
../cups/array.h help-index.h
|
||||
testhi.o: testhi.c cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h \
|
||||
../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h \
|
||||
../cups/array.h help-index.h
|
||||
testtemplate.o: testtemplate.c cgi.h ../cups/cups.h ../cups/ipp.h \
|
||||
../cups/http.h ../cups/ppd.h ../cups/array.h ../cups/file.h \
|
||||
../cups/language.h ../cups/array.h help-index.h
|
||||
|
||||
help-index.o: cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
|
||||
help-index.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h
|
||||
help-index.o: ../cups/array.h help-index.h ../cups/debug.h ../cups/i18n.h
|
||||
help-index.o: ../cups/transcode.h ../cups/string.h ../config.h ../cups/dir.h
|
||||
html.o: cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
|
||||
html.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h
|
||||
html.o: ../cups/array.h help-index.h ../cups/debug.h ../cups/i18n.h
|
||||
html.o: ../cups/transcode.h ../cups/string.h ../config.h
|
||||
ipp-var.o: cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
|
||||
ipp-var.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h
|
||||
ipp-var.o: ../cups/array.h help-index.h ../cups/debug.h ../cups/i18n.h
|
||||
ipp-var.o: ../cups/transcode.h ../cups/string.h ../config.h
|
||||
search.o: cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
|
||||
search.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h
|
||||
search.o: ../cups/array.h help-index.h ../cups/debug.h ../cups/i18n.h
|
||||
search.o: ../cups/transcode.h ../cups/string.h ../config.h
|
||||
template.o: cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
|
||||
template.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h
|
||||
template.o: ../cups/array.h help-index.h ../cups/debug.h ../cups/i18n.h
|
||||
template.o: ../cups/transcode.h ../cups/string.h ../config.h
|
||||
var.o: cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
|
||||
var.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h
|
||||
var.o: ../cups/array.h help-index.h ../cups/debug.h ../cups/i18n.h
|
||||
var.o: ../cups/transcode.h ../cups/string.h ../config.h
|
||||
admin.o: cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
|
||||
admin.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h
|
||||
admin.o: ../cups/array.h help-index.h ../cups/debug.h ../cups/i18n.h
|
||||
admin.o: ../cups/transcode.h ../cups/string.h ../config.h ../cups/adminutil.h
|
||||
admin.o: ../cups/cups.h ../cups/file.h
|
||||
classes.o: cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
|
||||
classes.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h
|
||||
classes.o: ../cups/array.h help-index.h ../cups/debug.h ../cups/i18n.h
|
||||
classes.o: ../cups/transcode.h ../cups/string.h ../config.h
|
||||
help.o: cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
|
||||
help.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h
|
||||
help.o: ../cups/array.h help-index.h ../cups/debug.h ../cups/i18n.h
|
||||
help.o: ../cups/transcode.h ../cups/string.h ../config.h
|
||||
jobs.o: cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
|
||||
jobs.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h
|
||||
jobs.o: ../cups/array.h help-index.h ../cups/debug.h ../cups/i18n.h
|
||||
jobs.o: ../cups/transcode.h ../cups/string.h ../config.h
|
||||
printers.o: cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
|
||||
printers.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h
|
||||
printers.o: ../cups/array.h help-index.h ../cups/debug.h ../cups/i18n.h
|
||||
printers.o: ../cups/transcode.h ../cups/string.h ../config.h
|
||||
testcgi.o: cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h ../cups/ppd.h
|
||||
testcgi.o: ../cups/array.h ../cups/file.h ../cups/language.h ../cups/array.h
|
||||
testcgi.o: help-index.h
|
||||
testhi.o: cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h ../cups/ppd.h
|
||||
testhi.o: ../cups/array.h ../cups/file.h ../cups/language.h ../cups/array.h
|
||||
testhi.o: help-index.h
|
||||
testtemplate.o: cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
|
||||
testtemplate.o: ../cups/ppd.h ../cups/array.h ../cups/file.h
|
||||
testtemplate.o: ../cups/language.h ../cups/array.h help-index.h
|
||||
|
||||
+96
-57
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Administration CGI for the Common UNIX Printing System (CUPS).
|
||||
*
|
||||
* Copyright 2007 by Apple Inc.
|
||||
* Copyright 2007-2008 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -308,6 +308,16 @@ do_add_rss_subscription(http_t *http) /* I - HTTP connection */
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* Make sure we have a username...
|
||||
*/
|
||||
|
||||
if ((user = getenv("REMOTE_USER")) == NULL)
|
||||
{
|
||||
puts("Status: 401\n");
|
||||
exit(0);
|
||||
}
|
||||
|
||||
/*
|
||||
* Validate the subscription name...
|
||||
*/
|
||||
@@ -352,9 +362,6 @@ do_add_rss_subscription(http_t *http) /* I - HTTP connection */
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri",
|
||||
NULL, printer_uri);
|
||||
|
||||
if ((user = getenv("REMOTE_USER")) == NULL)
|
||||
user = "guest";
|
||||
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "requesting-user-name",
|
||||
NULL, user);
|
||||
|
||||
@@ -897,7 +904,7 @@ do_am_printer(http_t *http, /* I - HTTP connection */
|
||||
cgiCopyTemplateLang("choose-serial.tmpl");
|
||||
cgiEndHTML();
|
||||
}
|
||||
else if (!file && (var = cgiGetVariable("PPD_NAME")) == NULL)
|
||||
else if (!file && !cgiGetVariable("PPD_NAME"))
|
||||
{
|
||||
if (modify)
|
||||
{
|
||||
@@ -1268,6 +1275,16 @@ do_cancel_subscription(http_t *http)/* I - HTTP connection */
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* Require a username...
|
||||
*/
|
||||
|
||||
if ((user = getenv("REMOTE_USER")) == NULL)
|
||||
{
|
||||
puts("Status: 401\n");
|
||||
exit(0);
|
||||
}
|
||||
|
||||
/*
|
||||
* Cancel the subscription...
|
||||
*/
|
||||
@@ -1279,9 +1296,6 @@ do_cancel_subscription(http_t *http)/* I - HTTP connection */
|
||||
ippAddInteger(request, IPP_TAG_OPERATION, IPP_TAG_INTEGER,
|
||||
"notify-subscription-id", id);
|
||||
|
||||
if ((user = getenv("REMOTE_USER")) == NULL)
|
||||
user = "guest";
|
||||
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "requesting-user-name",
|
||||
NULL, user);
|
||||
|
||||
@@ -1333,12 +1347,12 @@ do_config_server(http_t *http) /* I - HTTP connection */
|
||||
*remote_printers,
|
||||
/* REMOTE_PRINTERS value */
|
||||
*share_printers,/* SHARE_PRINTERS value */
|
||||
#ifdef HAVE_GSSAPI
|
||||
*default_auth_type,
|
||||
/* DefaultAuthType value */
|
||||
#endif /* HAVE_GSSAPI */
|
||||
*user_cancel_any;
|
||||
/* USER_CANCEL_ANY value */
|
||||
#ifdef HAVE_GSSAPI
|
||||
char default_auth_type[255];
|
||||
/* DefaultAuthType value */
|
||||
#endif /* HAVE_GSSAPI */
|
||||
|
||||
|
||||
/*
|
||||
@@ -1351,11 +1365,6 @@ do_config_server(http_t *http) /* I - HTTP connection */
|
||||
remote_printers = cgiGetVariable("REMOTE_PRINTERS") ? "1" : "0";
|
||||
share_printers = cgiGetVariable("SHARE_PRINTERS") ? "1" : "0";
|
||||
user_cancel_any = cgiGetVariable("USER_CANCEL_ANY") ? "1" : "0";
|
||||
#ifdef HAVE_GSSAPI
|
||||
default_auth_type = cgiGetVariable("KERBEROS") ? "Negotiate" : "Basic";
|
||||
|
||||
fprintf(stderr, "DEBUG: DefaultAuthType %s\n", default_auth_type);
|
||||
#endif /* HAVE_GSSAPI */
|
||||
|
||||
/*
|
||||
* Get the current server settings...
|
||||
@@ -1372,6 +1381,27 @@ do_config_server(http_t *http) /* I - HTTP connection */
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef HAVE_GSSAPI
|
||||
/*
|
||||
* Get authentication settings...
|
||||
*/
|
||||
|
||||
if (cgiGetVariable("KERBEROS"))
|
||||
strlcpy(default_auth_type, "Negotiate", sizeof(default_auth_type));
|
||||
else
|
||||
{
|
||||
const char *val = cupsGetOption("DefaultAuthType", num_settings,
|
||||
settings);
|
||||
|
||||
if (val && !strcasecmp(val, "Negotiate"))
|
||||
strlcpy(default_auth_type, "Basic", sizeof(default_auth_type));
|
||||
else
|
||||
strlcpy(default_auth_type, val, sizeof(default_auth_type));
|
||||
}
|
||||
|
||||
fprintf(stderr, "DEBUG: DefaultAuthType %s\n", default_auth_type);
|
||||
#endif /* HAVE_GSSAPI */
|
||||
|
||||
/*
|
||||
* See if the settings have changed...
|
||||
*/
|
||||
@@ -1634,14 +1664,15 @@ do_config_server(http_t *http) /* I - HTTP connection */
|
||||
* Allocate memory and load the file into a string buffer...
|
||||
*/
|
||||
|
||||
buffer = calloc(1, info.st_size + 1);
|
||||
if ((buffer = calloc(1, info.st_size + 1)) != NULL)
|
||||
{
|
||||
cupsFileRead(cupsd, buffer, info.st_size);
|
||||
cgiSetVariable("CUPSDCONF", buffer);
|
||||
free(buffer);
|
||||
}
|
||||
|
||||
cupsFileRead(cupsd, buffer, info.st_size);
|
||||
cupsFileClose(cupsd);
|
||||
|
||||
cgiSetVariable("CUPSDCONF", buffer);
|
||||
free(buffer);
|
||||
|
||||
/*
|
||||
* Then get the default cupsd.conf file and put that into a string as
|
||||
* well...
|
||||
@@ -1652,37 +1683,39 @@ do_config_server(http_t *http) /* I - HTTP connection */
|
||||
if (!stat(filename, &info) && info.st_size < (1024 * 1024) &&
|
||||
(cupsd = cupsFileOpen(filename, "r")) != NULL)
|
||||
{
|
||||
buffer = calloc(1, 2 * info.st_size + 1);
|
||||
bufend = buffer + 2 * info.st_size - 1;
|
||||
|
||||
for (bufptr = buffer;
|
||||
bufptr < bufend && (ch = cupsFileGetChar(cupsd)) != EOF;)
|
||||
if ((buffer = calloc(1, 2 * info.st_size + 1)) != NULL)
|
||||
{
|
||||
if (ch == '\\' || ch == '\"')
|
||||
bufend = buffer + 2 * info.st_size - 1;
|
||||
|
||||
for (bufptr = buffer;
|
||||
bufptr < bufend && (ch = cupsFileGetChar(cupsd)) != EOF;)
|
||||
{
|
||||
*bufptr++ = '\\';
|
||||
*bufptr++ = ch;
|
||||
if (ch == '\\' || ch == '\"')
|
||||
{
|
||||
*bufptr++ = '\\';
|
||||
*bufptr++ = ch;
|
||||
}
|
||||
else if (ch == '\n')
|
||||
{
|
||||
*bufptr++ = '\\';
|
||||
*bufptr++ = 'n';
|
||||
}
|
||||
else if (ch == '\t')
|
||||
{
|
||||
*bufptr++ = '\\';
|
||||
*bufptr++ = 't';
|
||||
}
|
||||
else if (ch >= ' ')
|
||||
*bufptr++ = ch;
|
||||
}
|
||||
else if (ch == '\n')
|
||||
{
|
||||
*bufptr++ = '\\';
|
||||
*bufptr++ = 'n';
|
||||
}
|
||||
else if (ch == '\t')
|
||||
{
|
||||
*bufptr++ = '\\';
|
||||
*bufptr++ = 't';
|
||||
}
|
||||
else if (ch >= ' ')
|
||||
*bufptr++ = ch;
|
||||
|
||||
*bufptr = '\0';
|
||||
|
||||
cgiSetVariable("CUPSDCONF_DEFAULT", buffer);
|
||||
free(buffer);
|
||||
}
|
||||
|
||||
*bufptr = '\0';
|
||||
|
||||
cupsFileClose(cupsd);
|
||||
|
||||
cgiSetVariable("CUPSDCONF_DEFAULT", buffer);
|
||||
free(buffer);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -2565,6 +2598,9 @@ do_set_allowed_users(http_t *http) /* I - HTTP connection */
|
||||
while (*ptr == ',' || isspace(*ptr & 255))
|
||||
ptr ++;
|
||||
|
||||
if (!*ptr)
|
||||
break;
|
||||
|
||||
if (*ptr == '\'' || *ptr == '\"')
|
||||
{
|
||||
/*
|
||||
@@ -2630,6 +2666,9 @@ do_set_allowed_users(http_t *http) /* I - HTTP connection */
|
||||
while (*ptr == ',' || isspace(*ptr & 255))
|
||||
ptr ++;
|
||||
|
||||
if (!*ptr)
|
||||
break;
|
||||
|
||||
if (*ptr == '\'' || *ptr == '\"')
|
||||
{
|
||||
/*
|
||||
@@ -2979,15 +3018,15 @@ do_set_options(http_t *http, /* I - HTTP connection */
|
||||
|
||||
cgiSetVariable("KEYWORD", "job_sheets_start");
|
||||
cgiSetVariable("KEYTEXT", cgiText(_("Starting Banner")));
|
||||
cgiSetVariable("DEFCHOICE", attr == NULL ?
|
||||
"" : attr->values[0].string.text);
|
||||
cgiSetVariable("DEFCHOICE", attr != NULL ?
|
||||
attr->values[0].string.text : "");
|
||||
|
||||
cgiCopyTemplateLang("option-pickone.tmpl");
|
||||
|
||||
cgiSetVariable("KEYWORD", "job_sheets_end");
|
||||
cgiSetVariable("KEYTEXT", cgiText(_("Ending Banner")));
|
||||
cgiSetVariable("DEFCHOICE", attr == NULL && attr->num_values > 1 ?
|
||||
"" : attr->values[1].string.text);
|
||||
cgiSetVariable("DEFCHOICE", attr != NULL && attr->num_values > 1 ?
|
||||
attr->values[1].string.text : "");
|
||||
|
||||
cgiCopyTemplateLang("option-pickone.tmpl");
|
||||
|
||||
@@ -3071,7 +3110,7 @@ do_set_options(http_t *http, /* I - HTTP connection */
|
||||
* Binary protocol support...
|
||||
*/
|
||||
|
||||
if (ppd->protocols && strstr(ppd->protocols, "BCP"))
|
||||
if (ppd && ppd->protocols && strstr(ppd->protocols, "BCP"))
|
||||
{
|
||||
protocol = ppdFindAttr(ppd, "cupsProtocol", NULL);
|
||||
|
||||
@@ -3174,7 +3213,7 @@ do_set_options(http_t *http, /* I - HTTP connection */
|
||||
}
|
||||
|
||||
if ((var = cgiGetVariable("protocol")) != NULL)
|
||||
cupsFilePrintf(out, "*cupsProtocol: %s\n", cgiGetVariable("protocol"));
|
||||
cupsFilePrintf(out, "*cupsProtocol: %s\n", var);
|
||||
|
||||
cupsFileClose(in);
|
||||
cupsFileClose(out);
|
||||
@@ -3213,12 +3252,12 @@ do_set_options(http_t *http, /* I - HTTP connection */
|
||||
attr->values[1].string.text = _cupsStrAlloc(cgiGetVariable("job_sheets_end"));
|
||||
|
||||
if ((var = cgiGetVariable("printer_error_policy")) != NULL)
|
||||
attr = ippAddString(request, IPP_TAG_PRINTER, IPP_TAG_NAME,
|
||||
"printer-error-policy", NULL, var);
|
||||
ippAddString(request, IPP_TAG_PRINTER, IPP_TAG_NAME,
|
||||
"printer-error-policy", NULL, var);
|
||||
|
||||
if ((var = cgiGetVariable("printer_op_policy")) != NULL)
|
||||
attr = ippAddString(request, IPP_TAG_PRINTER, IPP_TAG_NAME,
|
||||
"printer-op-policy", NULL, var);
|
||||
ippAddString(request, IPP_TAG_PRINTER, IPP_TAG_NAME,
|
||||
"printer-op-policy", NULL, var);
|
||||
|
||||
/*
|
||||
* Do the request and get back a response...
|
||||
|
||||
@@ -151,6 +151,7 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
|
||||
cgiSetVariable("HELPFILE", helpfile);
|
||||
cgiSetVariable("HELPTITLE", n->text);
|
||||
cgiSetVariable("TOPIC", n->section);
|
||||
|
||||
/*
|
||||
* Send a standard page header...
|
||||
|
||||
+22
-9
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* CGI <-> IPP variable routines for the Common UNIX Printing System (CUPS).
|
||||
*
|
||||
* Copyright 2007 by Apple Inc.
|
||||
* Copyright 2007-2008 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -158,6 +158,8 @@ cgiGetAttributes(ipp_t *request, /* I - IPP request */
|
||||
for (i = 0; i < num_attrs; i ++)
|
||||
free(attrs[i]);
|
||||
}
|
||||
|
||||
fclose(in);
|
||||
}
|
||||
|
||||
|
||||
@@ -472,10 +474,16 @@ cgiMoveJobs(http_t *http, /* I - Connection to server */
|
||||
|
||||
if (cupsLastError() <= IPP_OK_CONFLICT)
|
||||
{
|
||||
cgiRewriteURL(job_printer_uri, resource, sizeof(resource), NULL);
|
||||
cgiFormEncode(uri, resource, sizeof(uri));
|
||||
snprintf(refresh, sizeof(refresh), "2;URL=%s", uri);
|
||||
cgiSetVariable("refresh_page", refresh);
|
||||
const char *path = strstr(job_printer_uri, "/printers/");
|
||||
if (!path)
|
||||
path = strstr(job_printer_uri, "/classes/");
|
||||
|
||||
if (path)
|
||||
{
|
||||
cgiFormEncode(uri, path, sizeof(uri));
|
||||
snprintf(refresh, sizeof(refresh), "2;URL=%s", uri);
|
||||
cgiSetVariable("refresh_page", refresh);
|
||||
}
|
||||
}
|
||||
|
||||
if (job_id)
|
||||
@@ -523,8 +531,7 @@ cgiPrintTestPage(http_t *http, /* I - Connection to server */
|
||||
* See who is logged in...
|
||||
*/
|
||||
|
||||
if ((user = getenv("REMOTE_USER")) == NULL)
|
||||
user = "guest";
|
||||
user = getenv("REMOTE_USER");
|
||||
|
||||
/*
|
||||
* Locate the test page file...
|
||||
@@ -562,8 +569,9 @@ cgiPrintTestPage(http_t *http, /* I - Connection to server */
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri",
|
||||
NULL, uri);
|
||||
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME,
|
||||
"requesting-user-name", NULL, user);
|
||||
if (user)
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME,
|
||||
"requesting-user-name", NULL, user);
|
||||
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "job-name",
|
||||
NULL, "Test Page");
|
||||
@@ -593,6 +601,11 @@ cgiPrintTestPage(http_t *http, /* I - Connection to server */
|
||||
snprintf(refresh, sizeof(refresh), "2;URL=%s", uri);
|
||||
cgiSetVariable("refresh_page", refresh);
|
||||
}
|
||||
else if (cupsLastError() == IPP_NOT_AUTHORIZED)
|
||||
{
|
||||
puts("Status: 401\n");
|
||||
exit(0);
|
||||
}
|
||||
|
||||
cgiStartHTML(cgiText(_("Print Test Page")));
|
||||
|
||||
|
||||
+6
-1
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Job status CGI for the Common UNIX Printing System (CUPS).
|
||||
*
|
||||
* Copyright 2007 by Apple Inc.
|
||||
* Copyright 2007-2008 by Apple Inc.
|
||||
* Copyright 1997-2006 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -185,6 +185,11 @@ do_job_op(http_t *http, /* I - HTTP connection */
|
||||
cgiFormEncode(url + 6, getenv("HTTP_REFERER"), sizeof(url) - 6);
|
||||
cgiSetVariable("refresh_page", url);
|
||||
}
|
||||
else if (cupsLastError() == IPP_NOT_AUTHORIZED)
|
||||
{
|
||||
puts("Status: 401\n");
|
||||
exit(0);
|
||||
}
|
||||
|
||||
cgiStartHTML(cgiText(_("Jobs")));
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Printer status CGI for the Common UNIX Printing System (CUPS).
|
||||
*
|
||||
* Copyright 2007 by Apple Inc.
|
||||
* Copyright 2007-2008 by Apple Inc.
|
||||
* Copyright 1997-2006 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -280,6 +280,11 @@ print_command(http_t *http, /* I - Connection to server */
|
||||
snprintf(refresh, sizeof(refresh), "2;URL=%s", uri);
|
||||
cgiSetVariable("refresh_page", refresh);
|
||||
}
|
||||
else if (cupsLastError() == IPP_NOT_AUTHORIZED)
|
||||
{
|
||||
puts("Status: 401\n");
|
||||
exit(0);
|
||||
}
|
||||
|
||||
cgiStartHTML(cgiText(_("Printer Maintenance")));
|
||||
|
||||
|
||||
+18
-5
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Search routines for the Common UNIX Printing System (CUPS).
|
||||
*
|
||||
* Copyright 2007 by Apple Inc.
|
||||
* Copyright 2007-2008 by Apple Inc.
|
||||
* Copyright 1997-2006 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -53,7 +53,8 @@ cgiCompileSearch(const char *query) /* I - Query string */
|
||||
* Allocate a regular expression storage structure...
|
||||
*/
|
||||
|
||||
re = (regex_t *)calloc(1, sizeof(regex_t));
|
||||
if ((re = (regex_t *)calloc(1, sizeof(regex_t))) == NULL)
|
||||
return (NULL);
|
||||
|
||||
/*
|
||||
* Allocate a buffer to hold the regular expression string, starting
|
||||
@@ -65,7 +66,11 @@ cgiCompileSearch(const char *query) /* I - Query string */
|
||||
if (slen < 1024)
|
||||
slen = 1024;
|
||||
|
||||
s = (char *)malloc(slen);
|
||||
if ((s = (char *)malloc(slen)) == NULL)
|
||||
{
|
||||
free(re);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
* Copy the query string to the regular expression, handling basic
|
||||
@@ -162,7 +167,9 @@ cgiCompileSearch(const char *query) /* I - Query string */
|
||||
* string + RE overhead...
|
||||
*/
|
||||
|
||||
wlen = (sptr - s) + 4 * wlen + 2 * strlen(prefix) + 4;
|
||||
wlen = (sptr - s) + 2 * 4 * wlen + 2 * strlen(prefix) + 11;
|
||||
if (lword)
|
||||
wlen += strlen(lword);
|
||||
|
||||
if (wlen > slen)
|
||||
{
|
||||
@@ -227,7 +234,13 @@ cgiCompileSearch(const char *query) /* I - Query string */
|
||||
char *lword2; /* New "last word" */
|
||||
|
||||
|
||||
lword2 = strdup(sword);
|
||||
if ((lword2 = strdup(sword)) == NULL)
|
||||
{
|
||||
free(lword);
|
||||
free(s);
|
||||
free(re);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
strcpy(sptr, ".*|.*");
|
||||
sptr += 5;
|
||||
|
||||
+27
-20
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* CGI template function.
|
||||
*
|
||||
* Copyright 2007 by Apple Inc.
|
||||
* Copyright 2007-2008 by Apple Inc.
|
||||
* Copyright 1997-2006 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -53,6 +53,13 @@ cgiCopyTemplateFile(FILE *out, /* I - Output file */
|
||||
fprintf(stderr, "DEBUG2: cgiCopyTemplateFile(out=%p, tmpl=\"%s\")\n", out,
|
||||
tmpl ? tmpl : "(null)");
|
||||
|
||||
/*
|
||||
* Range check input...
|
||||
*/
|
||||
|
||||
if (!tmpl || !out)
|
||||
return;
|
||||
|
||||
/*
|
||||
* Open the template file...
|
||||
*/
|
||||
@@ -85,9 +92,9 @@ cgiCopyTemplateFile(FILE *out, /* I - Output file */
|
||||
void
|
||||
cgiCopyTemplateLang(const char *tmpl) /* I - Base filename */
|
||||
{
|
||||
int i; /* Looping var */
|
||||
char filename[1024], /* Filename */
|
||||
locale[16]; /* Locale name */
|
||||
locale[16], /* Locale name */
|
||||
*locptr; /* Pointer into locale name */
|
||||
const char *directory, /* Directory for templates */
|
||||
*lang; /* Language */
|
||||
FILE *in; /* Input file */
|
||||
@@ -100,22 +107,19 @@ cgiCopyTemplateLang(const char *tmpl) /* I - Base filename */
|
||||
* Convert the language to a locale name...
|
||||
*/
|
||||
|
||||
locale[0] = '\0';
|
||||
|
||||
if ((lang = getenv("LANG")) != NULL)
|
||||
{
|
||||
for (i = 0; lang[i] && i < 15; i ++)
|
||||
if (isalnum(lang[i] & 255) || lang[i] == '_')
|
||||
locale[i] = tolower(lang[i]);
|
||||
else if (lang[i] == '-')
|
||||
locale[i] = '_';
|
||||
else
|
||||
break;
|
||||
locale[0] = '/';
|
||||
strlcpy(locale + 1, lang, sizeof(locale) - 1);
|
||||
|
||||
locale[i] = '\0';
|
||||
if ((locptr = strchr(locale, '.')) != NULL)
|
||||
*locptr = '\0'; /* Strip charset */
|
||||
}
|
||||
else
|
||||
locale[0] = '\0';
|
||||
|
||||
fprintf(stderr, "DEBUG2: locale=\"%s\"...\n", locale);
|
||||
fprintf(stderr, "DEBUG: lang=\"%s\", locale=\"%s\"...\n",
|
||||
lang ? lang : "(null)", locale);
|
||||
|
||||
/*
|
||||
* See if we have a template file for this language...
|
||||
@@ -123,14 +127,17 @@ cgiCopyTemplateLang(const char *tmpl) /* I - Base filename */
|
||||
|
||||
directory = cgiGetTemplateDir();
|
||||
|
||||
snprintf(filename, sizeof(filename), "%s/%s/%s", directory, locale, tmpl);
|
||||
if (access(filename, 0))
|
||||
snprintf(filename, sizeof(filename), "%s%s/%s", directory, locale, tmpl);
|
||||
if ((in = fopen(filename, "r")) == NULL)
|
||||
{
|
||||
locale[2] = '\0';
|
||||
locale[3] = '\0';
|
||||
|
||||
snprintf(filename, sizeof(filename), "%s/%s/%s", directory, locale, tmpl);
|
||||
if (access(filename, 0))
|
||||
snprintf(filename, sizeof(filename), "%s%s/%s", directory, locale, tmpl);
|
||||
if ((in = fopen(filename, "r")) == NULL)
|
||||
{
|
||||
snprintf(filename, sizeof(filename), "%s/%s", directory, tmpl);
|
||||
in = fopen(filename, "r");
|
||||
}
|
||||
}
|
||||
|
||||
fprintf(stderr, "DEBUG2: Template file is \"%s\"...\n", filename);
|
||||
@@ -139,7 +146,7 @@ cgiCopyTemplateLang(const char *tmpl) /* I - Base filename */
|
||||
* Open the template file...
|
||||
*/
|
||||
|
||||
if ((in = fopen(filename, "r")) == NULL)
|
||||
if (!in)
|
||||
{
|
||||
fprintf(stderr, "ERROR: Unable to open template file \"%s\" - %s\n",
|
||||
filename, strerror(errno));
|
||||
|
||||
+38
-12
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* CGI form variable and array functions.
|
||||
*
|
||||
* Copyright 2007 by Apple Inc.
|
||||
* Copyright 2007-2008 by Apple Inc.
|
||||
* Copyright 1997-2005 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -322,9 +322,15 @@ cgiSetArray(const char *name, /* I - Name of variable */
|
||||
{
|
||||
if (element >= var->avalues)
|
||||
{
|
||||
const char **temp; /* Temporary pointer */
|
||||
|
||||
temp = (const char **)realloc((void *)(var->values),
|
||||
sizeof(char *) * (element + 16));
|
||||
if (!temp)
|
||||
return;
|
||||
|
||||
var->avalues = element + 16;
|
||||
var->values = (const char **)realloc((void *)(var->values),
|
||||
sizeof(char *) * var->avalues);
|
||||
var->values = temp;
|
||||
}
|
||||
|
||||
if (element >= var->nvalues)
|
||||
@@ -362,9 +368,15 @@ cgiSetSize(const char *name, /* I - Name of variable */
|
||||
|
||||
if (size >= var->avalues)
|
||||
{
|
||||
const char **temp; /* Temporary pointer */
|
||||
|
||||
temp = (const char **)realloc((void *)(var->values),
|
||||
sizeof(char *) * (size + 16));
|
||||
if (!temp)
|
||||
return;
|
||||
|
||||
var->avalues = size + 16;
|
||||
var->values = (const char **)realloc((void *)(var->values),
|
||||
sizeof(char *) * var->avalues);
|
||||
var->values = temp;
|
||||
}
|
||||
|
||||
if (size > var->nvalues)
|
||||
@@ -426,7 +438,7 @@ cgi_add_variable(const char *name, /* I - Variable name */
|
||||
int element, /* I - Array element number */
|
||||
const char *value) /* I - Variable value */
|
||||
{
|
||||
_cgi_var_t *var; /* New variable */
|
||||
_cgi_var_t *var; /* New variable */
|
||||
|
||||
|
||||
if (name == NULL || value == NULL || element < 0 || element > 100000)
|
||||
@@ -438,19 +450,29 @@ cgi_add_variable(const char *name, /* I - Variable name */
|
||||
|
||||
if (form_count >= form_alloc)
|
||||
{
|
||||
if (form_alloc == 0)
|
||||
form_vars = malloc(sizeof(_cgi_var_t) * 16);
|
||||
else
|
||||
form_vars = realloc(form_vars, (form_alloc + 16) * sizeof(_cgi_var_t));
|
||||
_cgi_var_t *temp_vars; /* Temporary form pointer */
|
||||
|
||||
|
||||
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));
|
||||
|
||||
if (!temp_vars)
|
||||
return;
|
||||
|
||||
form_vars = temp_vars;
|
||||
form_alloc += 16;
|
||||
}
|
||||
|
||||
var = form_vars + form_count;
|
||||
var = form_vars + form_count;
|
||||
|
||||
if ((var->values = calloc(element + 1, sizeof(char *))) == NULL)
|
||||
return;
|
||||
|
||||
var->name = strdup(name);
|
||||
var->nvalues = element + 1;
|
||||
var->avalues = element + 1;
|
||||
var->values = calloc(element + 1, sizeof(char *));
|
||||
var->values[element] = strdup(value);
|
||||
|
||||
form_count ++;
|
||||
@@ -784,11 +806,15 @@ cgi_initialize_post(void)
|
||||
|
||||
for (tbytes = 0; tbytes < length; tbytes += nbytes)
|
||||
if ((nbytes = read(0, data + tbytes, length - tbytes)) < 0)
|
||||
{
|
||||
if (errno != EAGAIN)
|
||||
{
|
||||
free(data);
|
||||
return (0);
|
||||
}
|
||||
else
|
||||
nbytes = 0;
|
||||
}
|
||||
|
||||
data[length] = '\0';
|
||||
|
||||
|
||||
@@ -49,7 +49,6 @@ depend:
|
||||
#
|
||||
|
||||
install: all
|
||||
$(INSTALL_DIR) -m 755 $(SERVERROOT)
|
||||
for file in $(KEEP); do \
|
||||
if test -r $(SERVERROOT)/$$file ; then \
|
||||
$(INSTALL_CONFIG) $$file $(SERVERROOT)/$$file.N ; \
|
||||
|
||||
@@ -29,14 +29,12 @@ DefaultAuthType Basic
|
||||
# Restrict access to the server...
|
||||
<Location />
|
||||
Order allow,deny
|
||||
Allow localhost
|
||||
</Location>
|
||||
|
||||
# Restrict access to the admin pages...
|
||||
<Location /admin>
|
||||
@ENCRYPTION_REQUIRED@
|
||||
Order allow,deny
|
||||
Allow localhost
|
||||
</Location>
|
||||
|
||||
# Restrict access to configuration files...
|
||||
@@ -44,7 +42,6 @@ DefaultAuthType Basic
|
||||
AuthType Default
|
||||
Require user @SYSTEM
|
||||
Order allow,deny
|
||||
Allow localhost
|
||||
</Location>
|
||||
|
||||
# Set the default printer/job policies...
|
||||
|
||||
@@ -95,8 +95,8 @@ image/x-xpixmap application/vnd.cups-raster 100 imagetoraster
|
||||
#image/x-xwindowdump application/vnd.cups-raster 100 imagetoraster
|
||||
image/x-sun-raster application/vnd.cups-raster 100 imagetoraster
|
||||
|
||||
# pstoraster is now part of ESP Ghostscript...
|
||||
#application/vnd.cups-postscript application/vnd.cups-raster 100 pstoraster
|
||||
# pstoraster is part of GPL Ghostscript...
|
||||
application/vnd.cups-postscript application/vnd.cups-raster 100 pstoraster
|
||||
|
||||
########################################################################
|
||||
#
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# "$Id$"
|
||||
#
|
||||
# Sample SNMP configuration file for CUPS. See "man smnp.conf" for a
|
||||
# Sample SNMP configuration file for CUPS. See "man cups-smnp.conf" for a
|
||||
# complete description of this file.
|
||||
#
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
dnl
|
||||
dnl "$Id: cups-common.m4 6720 2007-07-25 00:40:03Z mike $"
|
||||
dnl "$Id: cups-common.m4 7778 2008-07-23 00:06:46Z mike $"
|
||||
dnl
|
||||
dnl Common configuration stuff for the Common UNIX Printing System (CUPS).
|
||||
dnl
|
||||
dnl Copyright 2007 by Apple Inc.
|
||||
dnl Copyright 2007-2008 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
|
||||
@@ -13,18 +13,15 @@ dnl which should have been included with this file. If this file is
|
||||
dnl file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl
|
||||
|
||||
dnl We need at least autoconf 2.50...
|
||||
AC_PREREQ(2.50)
|
||||
dnl We need at least autoconf 2.60...
|
||||
AC_PREREQ(2.60)
|
||||
|
||||
dnl Set the name of the config header file...
|
||||
AC_CONFIG_HEADER(config.h)
|
||||
|
||||
dnl Versio number information...
|
||||
CUPS_VERSION="1.3rc1"
|
||||
dnl Version number information...
|
||||
CUPS_VERSION="1.3.9"
|
||||
CUPS_REVISION=""
|
||||
#if test -z "$CUPS_REVISION" -a -d .svn; then
|
||||
# CUPS_REVISION="-r`svnversion . | awk -F: '{print $NF}' | sed -e '1,$s/[[a-zA-Z]]*//g'`"
|
||||
#fi
|
||||
|
||||
AC_SUBST(CUPS_VERSION)
|
||||
AC_SUBST(CUPS_REVISION)
|
||||
@@ -123,6 +120,7 @@ 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))
|
||||
|
||||
@@ -182,37 +180,66 @@ esac
|
||||
|
||||
AC_SUBST(ARFLAGS)
|
||||
|
||||
dnl Extra platform-specific libraries...
|
||||
dnl Prep libraries specifically for cupsd and backends...
|
||||
BACKLIBS=""
|
||||
CUPSDLIBS=""
|
||||
DBUSDIR=""
|
||||
CUPS_DEFAULT_PRINTADMIN_AUTH="@SYSTEM"
|
||||
CUPS_SYSTEM_AUTHKEY=""
|
||||
AC_SUBST(BACKLIBS)
|
||||
AC_SUBST(CUPSDLIBS)
|
||||
|
||||
dnl See if we have POSIX ACL support...
|
||||
SAVELIBS="$LIBS"
|
||||
LIBS=""
|
||||
AC_SEARCH_LIBS(acl_init, acl, AC_DEFINE(HAVE_ACL_INIT))
|
||||
CUPSDLIBS="$CUPSDLIBS $LIBS"
|
||||
LIBS="$SAVELIBS"
|
||||
|
||||
dnl Check for DBUS support
|
||||
if test -d /etc/dbus-1; then
|
||||
DBUSDIR="/etc/dbus-1"
|
||||
else
|
||||
DBUSDIR=""
|
||||
fi
|
||||
|
||||
AC_ARG_ENABLE(dbus, [ --enable-dbus enable DBUS support, default=auto])
|
||||
AC_ARG_WITH(dbusdir, [ --with-dbusdir set DBUS configuration directory ],
|
||||
DBUSDIR="$withval")
|
||||
|
||||
if test "x$enable_dbus" != xno; then
|
||||
AC_PATH_PROG(PKGCONFIG, pkg-config)
|
||||
if test "x$PKGCONFIG" != x; then
|
||||
AC_MSG_CHECKING(for DBUS)
|
||||
if $PKGCONFIG --exists dbus-1; then
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_DBUS)
|
||||
CFLAGS="$CFLAGS `$PKGCONFIG --cflags dbus-1` -DDBUS_API_SUBJECT_TO_CHANGE"
|
||||
CUPSDLIBS="$CUPSDLIBS `$PKGCONFIG --libs dbus-1`"
|
||||
AC_CHECK_LIB(dbus-1,
|
||||
dbus_message_iter_init_append,
|
||||
AC_DEFINE(HAVE_DBUS_MESSAGE_ITER_INIT_APPEND),,
|
||||
`$PKGCONFIG --libs dbus-1`)
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
DBUSDIR=""
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_SUBST(DBUSDIR)
|
||||
|
||||
dnl Extra platform-specific libraries...
|
||||
CUPS_DEFAULT_PRINTADMIN_AUTH="@SYSTEM"
|
||||
CUPS_SYSTEM_AUTHKEY=""
|
||||
FONTS="fonts"
|
||||
AC_SUBST(FONTS)
|
||||
LEGACY_BACKENDS="parallel scsi"
|
||||
AC_SUBST(LEGACY_BACKENDS)
|
||||
|
||||
case $uname in
|
||||
Darwin*)
|
||||
FONTS=""
|
||||
LEGACY_BACKENDS=""
|
||||
BACKLIBS="-framework IOKit"
|
||||
CUPSDLIBS="-sectorder __TEXT __text cupsd.order -e start -framework IOKit -framework SystemConfiguration"
|
||||
BACKLIBS="$BACKLIBS -framework IOKit"
|
||||
CUPSDLIBS="$CUPSDLIBS -sectorder __TEXT __text cupsd.order -e start -framework IOKit -framework SystemConfiguration"
|
||||
LIBS="-framework CoreFoundation $LIBS"
|
||||
|
||||
dnl Check for CFLocaleCreateCanonicalLocaleIdentifierFromString...
|
||||
AC_MSG_CHECKING(for CFLocaleCreateCanonicalLocaleIdentifierFromString)
|
||||
if test "$uname" = "Darwin" -a $uversion -ge 70; then
|
||||
AC_DEFINE(HAVE_CF_LOCALE_ID)
|
||||
AC_MSG_RESULT(yes)
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
|
||||
dnl Check for framework headers...
|
||||
AC_CHECK_HEADER(CoreFoundation/CoreFoundation.h,AC_DEFINE(HAVE_COREFOUNDATION_H))
|
||||
AC_CHECK_HEADER(CoreFoundation/CFPriv.h,AC_DEFINE(HAVE_CFPRIV_H))
|
||||
@@ -231,60 +258,41 @@ case $uname in
|
||||
AC_CHECK_FUNCS(notify_post)
|
||||
|
||||
dnl Check for Authorization Services support
|
||||
AC_ARG_WITH(adminkey, [ --with-adminkey set the default SystemAuthKey value],
|
||||
default_adminkey="$withval",
|
||||
default_adminkey="default")
|
||||
AC_ARG_WITH(operkey, [ --with-operkey set the default operator @AUTHKEY value],
|
||||
default_operkey="$withval",
|
||||
default_operkey="default")
|
||||
|
||||
AC_CHECK_HEADER(Security/Authorization.h, [
|
||||
AC_DEFINE(HAVE_AUTHORIZATION_H)
|
||||
CUPS_DEFAULT_PRINTADMIN_AUTH="@AUTHKEY(system.print.admin) @admin @lpadmin"
|
||||
CUPS_SYSTEM_AUTHKEY="SystemGroupAuthKey system.preferences"])
|
||||
|
||||
if test "x$default_adminkey" != xdefault; then
|
||||
CUPS_SYSTEM_AUTHKEY="SystemGroupAuthKey $default_adminkey"
|
||||
elif grep -q system.print.operator /etc/authorization; then
|
||||
CUPS_SYSTEM_AUTHKEY="SystemGroupAuthKey system.print.admin"
|
||||
else
|
||||
CUPS_SYSTEM_AUTHKEY="SystemGroupAuthKey system.preferences"
|
||||
fi
|
||||
|
||||
if test "x$default_operkey" != xdefault; then
|
||||
CUPS_DEFAULT_PRINTADMIN_AUTH="@AUTHKEY($default_operkey) @admin @lpadmin"
|
||||
elif grep -q system.print.operator /etc/authorization; then
|
||||
CUPS_DEFAULT_PRINTADMIN_AUTH="@AUTHKEY(system.print.operator) @admin @lpadmin"
|
||||
else
|
||||
CUPS_DEFAULT_PRINTADMIN_AUTH="@AUTHKEY(system.print.admin) @admin @lpadmin"
|
||||
fi])
|
||||
AC_CHECK_HEADER(Security/SecBasePriv.h,AC_DEFINE(HAVE_SECBASEPRIV_H))
|
||||
;;
|
||||
|
||||
Linux*)
|
||||
dnl Check for DBUS support
|
||||
if test "x$enable_dbus" != xno; then
|
||||
AC_PATH_PROG(PKGCONFIG, pkg-config)
|
||||
if test "x$PKGCONFIG" != x; then
|
||||
AC_MSG_CHECKING(for DBUS)
|
||||
if $PKGCONFIG --exists dbus-1; then
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_DBUS)
|
||||
CFLAGS="$CFLAGS `$PKGCONFIG --cflags dbus-1` -DDBUS_API_SUBJECT_TO_CHANGE"
|
||||
CUPSDLIBS="`$PKGCONFIG --libs dbus-1`"
|
||||
AC_ARG_WITH(dbusdir, [ --with-dbusdir set DBUS configuration directory ], dbusdir="$withval", dbusdir="/etc/dbus-1")
|
||||
DBUSDIR="$dbusdir"
|
||||
AC_CHECK_LIB(dbus-1,
|
||||
dbus_message_iter_init_append,
|
||||
AC_DEFINE(HAVE_DBUS_MESSAGE_ITER_INIT_APPEND))
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
AC_SUBST(CUPS_DEFAULT_PRINTADMIN_AUTH)
|
||||
AC_DEFINE_UNQUOTED(CUPS_DEFAULT_PRINTADMIN_AUTH, "$CUPS_DEFAULT_PRINTADMIN_AUTH")
|
||||
AC_SUBST(CUPS_SYSTEM_AUTHKEY)
|
||||
|
||||
dnl See if we have POSIX ACL support...
|
||||
SAVELIBS="$LIBS"
|
||||
LIBS=""
|
||||
AC_SEARCH_LIBS(acl_init, acl, AC_DEFINE(HAVE_ACL_INIT))
|
||||
CUPSDLIBS="$CUPSDLIBS $LIBS"
|
||||
LIBS="$SAVELIBS"
|
||||
|
||||
AC_SUBST(BACKLIBS)
|
||||
AC_SUBST(CUPSDLIBS)
|
||||
AC_SUBST(DBUSDIR)
|
||||
|
||||
dnl New default port definition for IPP...
|
||||
AC_ARG_WITH(ipp-port, [ --with-ipp-port set default port number for IPP ],
|
||||
DEFAULT_IPP_PORT="$withval",
|
||||
DEFAULT_IPP_PORT="631")
|
||||
|
||||
AC_SUBST(DEFAULT_IPP_PORT)
|
||||
AC_DEFINE_UNQUOTED(CUPS_DEFAULT_IPP_PORT,$DEFAULT_IPP_PORT)
|
||||
AC_SUBST(FONTS)
|
||||
AC_SUBST(LEGACY_BACKENDS)
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-common.m4 6720 2007-07-25 00:40:03Z mike $".
|
||||
dnl End of "$Id: cups-common.m4 7778 2008-07-23 00:06:46Z mike $".
|
||||
dnl
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
dnl
|
||||
dnl "$Id: cups-compiler.m4 6698 2007-07-20 14:15:44Z mike $"
|
||||
dnl "$Id: cups-compiler.m4 7648 2008-06-16 17:41:11Z mike $"
|
||||
dnl
|
||||
dnl Compiler stuff for the Common UNIX Printing System (CUPS).
|
||||
dnl
|
||||
dnl Copyright 2007 by Apple Inc.
|
||||
dnl Copyright 2007-2008 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
|
||||
@@ -98,36 +98,61 @@ if test -n "$GCC"; then
|
||||
fi
|
||||
fi
|
||||
|
||||
# Generate position-independent code as needed...
|
||||
if test $PICFLAG = 1 -a $uname != AIX; then
|
||||
OPTIM="-fPIC $OPTIM"
|
||||
fi
|
||||
|
||||
case $uname in
|
||||
Linux*)
|
||||
if test x$enable_pie = xyes; then
|
||||
PIEFLAGS="-pie -fPIE"
|
||||
fi
|
||||
# The -fstack-protector option is available with some versions of
|
||||
# GCC and adds "stack canaries" which detect when the return address
|
||||
# has been overwritten, preventing many types of exploit attacks.
|
||||
AC_MSG_CHECKING(if GCC supports -fstack-protector)
|
||||
OLDCFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS -fstack-protector"
|
||||
AC_TRY_COMPILE(,,
|
||||
OPTIM="$OPTIM -fstack-protector"
|
||||
AC_MSG_RESULT(yes),
|
||||
AC_MSG_RESULT(no))
|
||||
CFLAGS="$OLDCFLAGS"
|
||||
|
||||
if test x$enable_relro = xyes; then
|
||||
RELROFLAGS="-Wl,-z,relro"
|
||||
fi
|
||||
;;
|
||||
|
||||
*)
|
||||
if test x$enable_pie = xyes; then
|
||||
echo "Sorry, --enable-pie is not supported on this OS!"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
# The -pie option is available with some versions of GCC and adds
|
||||
# randomization of addresses, which avoids another class of exploits
|
||||
# that depend on a fixed address for common functions.
|
||||
if test x$enable_pie = xyes; then
|
||||
AC_MSG_CHECKING(if GCC supports -pie)
|
||||
OLDCFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS -pie -fPIE"
|
||||
AC_TRY_COMPILE(,,
|
||||
PIEFLAGS="-pie -fPIE"
|
||||
AC_MSG_RESULT(yes),
|
||||
AC_MSG_RESULT(no, ignoring --enable-pie))
|
||||
CFLAGS="$OLDCFLAGS"
|
||||
fi
|
||||
|
||||
if test "x$with_optim" = x; then
|
||||
# Add useful warning options for tracking down problems...
|
||||
OPTIM="-Wall -Wno-format-y2k $OPTIM"
|
||||
# Additional warning options for alpha testing...
|
||||
OPTIM="-Wshadow -Wunused $OPTIM"
|
||||
# Additional warning options for development testing...
|
||||
if test -d .svn; then
|
||||
OPTIM="-Wshadow -Wunused $OPTIM"
|
||||
fi
|
||||
fi
|
||||
|
||||
case "$uname" in
|
||||
Darwin*)
|
||||
# -D_FORTIFY_SOURCE=2 adds additional object size
|
||||
# checking, basically wrapping all string functions
|
||||
# with buffer-limited ones. Not strictly needed for
|
||||
# CUPS since we already use buffer-limited calls, but
|
||||
# this will catch any additions that are broken.
|
||||
CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2"
|
||||
|
||||
if test x$enable_pie = xyes; then
|
||||
# GCC 4 on Mac OS X needs -Wl,-pie as well
|
||||
LDFLAGS="$LDFLAGS -Wl,-pie"
|
||||
fi
|
||||
;;
|
||||
|
||||
HP-UX*)
|
||||
if test "x$enable_32bit" = xyes; then
|
||||
# Build 32-bit libraries, 64-bit base...
|
||||
@@ -201,6 +226,12 @@ if test -n "$GCC"; then
|
||||
;;
|
||||
|
||||
Linux*)
|
||||
# The -z relro option is provided by the Linux linker command to
|
||||
# make relocatable data read-only.
|
||||
if test x$enable_relro = xyes; then
|
||||
RELROFLAGS="-Wl,-z,relro"
|
||||
fi
|
||||
|
||||
if test "x$enable_32bit" = xyes; then
|
||||
# Build 32-bit libraries, 64-bit base...
|
||||
if test -z "$with_arch32flags"; then
|
||||
@@ -301,6 +332,40 @@ else
|
||||
if test $PICFLAG = 1; then
|
||||
OPTIM="+z $OPTIM"
|
||||
fi
|
||||
|
||||
if test "x$enable_32bit" = xyes; then
|
||||
# Build 32-bit libraries, 64-bit base...
|
||||
if test -z "$with_arch32flags"; then
|
||||
ARCH32FLAGS="+DD32"
|
||||
else
|
||||
ARCH32FLAGS="$with_arch32flags"
|
||||
fi
|
||||
|
||||
if test -z "$with_archflags"; then
|
||||
if test -z "$with_arch64flags"; then
|
||||
ARCHFLAGS="+DD64"
|
||||
else
|
||||
ARCHFLAGS="$with_arch64flags"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "x$enable_64bit" = xyes; then
|
||||
# Build 64-bit libraries, 32-bit base...
|
||||
if test -z "$with_arch64flags"; then
|
||||
ARCH64FLAGS="+DD64"
|
||||
else
|
||||
ARCH64FLAGS="$with_arch64flags"
|
||||
fi
|
||||
|
||||
if test -z "$with_archflags"; then
|
||||
if test -z "$with_arch32flags"; then
|
||||
ARCHFLAGS="+DD32"
|
||||
else
|
||||
ARCHFLAGS="$with_arch32flags"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
IRIX)
|
||||
if test -z "$OPTIM"; then
|
||||
@@ -434,8 +499,8 @@ else
|
||||
# cups-support@cups.org...
|
||||
echo "Building CUPS with default compiler optimizations; contact"
|
||||
echo "cups-bugs@cups.org with uname and compiler options needed"
|
||||
echo "for your platform, or set the CFLAGS and CXXFLAGS"
|
||||
echo "environment variable before running configure."
|
||||
echo "for your platform, or set the CFLAGS, CXXFLAGS, and LDFLAGS"
|
||||
echo "environment variables before running configure."
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
@@ -456,6 +521,12 @@ case $uname in
|
||||
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...
|
||||
@@ -464,5 +535,5 @@ case $uname in
|
||||
esac
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-compiler.m4 6698 2007-07-20 14:15:44Z mike $".
|
||||
dnl End of "$Id: cups-compiler.m4 7648 2008-06-16 17:41:11Z mike $".
|
||||
dnl
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
dnl
|
||||
dnl "$Id: cups-defaults.m4 6740 2007-07-26 23:07:46Z mike $"
|
||||
dnl "$Id: cups-defaults.m4 7448 2008-04-14 18:10:27Z mike $"
|
||||
dnl
|
||||
dnl Default cupsd configuration settings for the Common UNIX Printing System
|
||||
dnl (CUPS).
|
||||
dnl
|
||||
dnl Copyright 2007 by Apple Inc.
|
||||
dnl Copyright 2007-2008 by Apple Inc.
|
||||
dnl Copyright 2006-2007 by Easy Software Products, all rights reserved.
|
||||
dnl
|
||||
dnl These coded instructions, statements, and computer programs are the
|
||||
@@ -165,6 +165,7 @@ AC_ARG_WITH(cups_user, [ --with-cups-user set default user for CUPS],
|
||||
else
|
||||
CUPS_USER="_lp";
|
||||
fi
|
||||
AC_MSG_RESULT($CUPS_USER)
|
||||
elif test -f /etc/passwd; then
|
||||
CUPS_USER=""
|
||||
for user in lp lpd guest daemon nobody; do
|
||||
@@ -193,6 +194,7 @@ AC_ARG_WITH(cups_group, [ --with-cups-group set default group for CUPS],
|
||||
else
|
||||
CUPS_GROUP="_lp";
|
||||
fi
|
||||
AC_MSG_RESULT($CUPS_GROUP)
|
||||
elif test -f /etc/group; then
|
||||
GROUP_LIST="_lp lp nobody"
|
||||
CUPS_GROUP=""
|
||||
@@ -288,10 +290,10 @@ fi
|
||||
AC_DEFINE_UNQUOTED(CUPS_DEFAULT_PRINTCAP, "$CUPS_DEFAULT_PRINTCAP")
|
||||
|
||||
dnl Default MaxCopies value...
|
||||
AC_ARG_WITH(max-copies, [ --with-max-copies set max copies value, default=100 ],
|
||||
AC_ARG_WITH(max-copies, [ --with-max-copies set default max copies value, default=auto ],
|
||||
CUPS_MAX_COPIES="$withval",
|
||||
if test "x$uname" = xDarwin; then
|
||||
CUPS_MAX_COPIES="999"
|
||||
CUPS_MAX_COPIES="9999"
|
||||
else
|
||||
CUPS_MAX_COPIES="100"
|
||||
fi)
|
||||
@@ -335,6 +337,14 @@ AC_ARG_WITH(snmp-community, [ --with-snmp-community set SNMP community, defau
|
||||
AC_SUBST(CUPS_SNMP_ADDRESS)
|
||||
AC_SUBST(CUPS_SNMP_COMMUNITY)
|
||||
|
||||
dnl New default port definition for IPP...
|
||||
AC_ARG_WITH(ipp-port, [ --with-ipp-port set default port number for IPP ],
|
||||
DEFAULT_IPP_PORT="$withval",
|
||||
DEFAULT_IPP_PORT="631")
|
||||
|
||||
AC_SUBST(DEFAULT_IPP_PORT)
|
||||
AC_DEFINE_UNQUOTED(CUPS_DEFAULT_IPP_PORT,$DEFAULT_IPP_PORT)
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-defaults.m4 6740 2007-07-26 23:07:46Z mike $".
|
||||
dnl End of "$Id: cups-defaults.m4 7448 2008-04-14 18:10:27Z mike $".
|
||||
dnl
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
dnl
|
||||
dnl "$Id: cups-directories.m4 6649 2007-07-11 21:46:42Z mike $"
|
||||
dnl "$Id: cups-directories.m4 6976 2007-09-18 20:39:31Z mike $"
|
||||
dnl
|
||||
dnl Directory stuff for the Common UNIX Printing System (CUPS).
|
||||
dnl
|
||||
@@ -99,17 +99,23 @@ if test "$sysconfdir" = "\${prefix}/etc"; then
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl Fix "libdir" variable for IRIX 6.x...
|
||||
dnl Fix "libdir" variable...
|
||||
if test "$libdir" = "\${exec_prefix}/lib"; then
|
||||
if test "$uname" = "IRIX"; then
|
||||
libdir="$exec_prefix/lib32"
|
||||
else
|
||||
if test "$uname" = Linux -a -d /usr/lib64; then
|
||||
libdir="$exec_prefix/lib64"
|
||||
else
|
||||
libdir="$exec_prefix/lib"
|
||||
fi
|
||||
fi
|
||||
case "$uname" in
|
||||
IRIX*)
|
||||
libdir="$exec_prefix/lib32"
|
||||
;;
|
||||
Linux*)
|
||||
if test -d /usr/lib64; then
|
||||
libdir="$exec_prefix/lib64"
|
||||
fi
|
||||
;;
|
||||
HP-UX*)
|
||||
if test -d /usr/lib/hpux32; then
|
||||
libdir="$exec_prefix/lib/hpux32"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
dnl Setup init.d locations...
|
||||
@@ -146,8 +152,8 @@ if test x$rcdir = x; then
|
||||
HP-UX*)
|
||||
INITDIR="/sbin"
|
||||
RCLEVELS="2"
|
||||
RCSTART="620"
|
||||
RCSTOP="380"
|
||||
RCSTART="380"
|
||||
RCSTOP="620"
|
||||
;;
|
||||
|
||||
IRIX*)
|
||||
@@ -291,21 +297,26 @@ fi
|
||||
AC_SUBST(CUPS_FONTPATH)
|
||||
AC_DEFINE_UNQUOTED(CUPS_FONTPATH, "$CUPS_FONTPATH")
|
||||
|
||||
# Locale data
|
||||
case "$uname" in
|
||||
Linux | GNU | *BSD* | Darwin*)
|
||||
CUPS_LOCALEDIR="$datadir/locale"
|
||||
;;
|
||||
# Locale data (initial assignment allows us not to require autoconf 2.60)
|
||||
localedir="${localedir:=}"
|
||||
if test "$localedir" = "\${datarootdir}/locale" -o "$localedir" = ""; then
|
||||
case "$uname" in
|
||||
Linux | GNU | *BSD* | Darwin*)
|
||||
CUPS_LOCALEDIR="$datadir/locale"
|
||||
;;
|
||||
|
||||
OSF1* | AIX*)
|
||||
CUPS_LOCALEDIR="$exec_prefix/lib/nls/msg"
|
||||
;;
|
||||
OSF1* | AIX*)
|
||||
CUPS_LOCALEDIR="$exec_prefix/lib/nls/msg"
|
||||
;;
|
||||
|
||||
*)
|
||||
# This is the standard System V location...
|
||||
CUPS_LOCALEDIR="$exec_prefix/lib/locale"
|
||||
;;
|
||||
esac
|
||||
*)
|
||||
# This is the standard System V location...
|
||||
CUPS_LOCALEDIR="$exec_prefix/lib/locale"
|
||||
;;
|
||||
esac
|
||||
else
|
||||
CUPS_LOCALEDIR="$localedir"
|
||||
fi
|
||||
|
||||
AC_DEFINE_UNQUOTED(CUPS_LOCALEDIR, "$CUPS_LOCALEDIR")
|
||||
AC_SUBST(CUPS_LOCALEDIR)
|
||||
@@ -356,5 +367,5 @@ AC_DEFINE_UNQUOTED(CUPS_STATEDIR, "$localstatedir/run/cups")
|
||||
AC_SUBST(CUPS_STATEDIR)
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-directories.m4 6649 2007-07-11 21:46:42Z mike $".
|
||||
dnl End of "$Id: cups-directories.m4 6976 2007-09-18 20:39:31Z mike $".
|
||||
dnl
|
||||
|
||||
@@ -23,14 +23,26 @@ LIBGSSAPI=""
|
||||
if test x$enable_gssapi != xno; then
|
||||
AC_PATH_PROG(KRB5CONFIG, krb5-config)
|
||||
if test "x$KRB5CONFIG" != x; then
|
||||
if test "x$uname" = "xDarwin"; then
|
||||
# Mac OS X weak-links to the Kerberos framework...
|
||||
LIBGSSAPI="-weak_framework Kerberos"
|
||||
else
|
||||
CFLAGS="`$KRB5CONFIG --cflags gssapi` $CFLAGS"
|
||||
CPPFLAGS="`$KRB5CONFIG --cflags gssapi` $CPPFLAGS"
|
||||
LIBGSSAPI="`$KRB5CONFIG --libs gssapi`"
|
||||
fi
|
||||
case "$uname" in
|
||||
Darwin)
|
||||
# Mac OS X weak-links to the Kerberos framework...
|
||||
LIBGSSAPI="-weak_framework Kerberos"
|
||||
;;
|
||||
SunOS*)
|
||||
# Solaris has a non-standard krb5-config, don't use it!
|
||||
AC_CHECK_LIB(gss, gss_display_status,
|
||||
AC_DEFINE(HAVE_GSSAPI, 1, [Whether GSSAPI is available])
|
||||
CFLAGS="`$KRB5CONFIG --cflags` $CFLAGS"
|
||||
CPPFLAGS="`$KRB5CONFIG --cflags` $CPPFLAGS"
|
||||
LIBGSSAPI="-lgss `$KRB5CONFIG --libs`")
|
||||
;;
|
||||
*)
|
||||
# Other platforms just ask for GSSAPI
|
||||
CFLAGS="`$KRB5CONFIG --cflags gssapi` $CFLAGS"
|
||||
CPPFLAGS="`$KRB5CONFIG --cflags gssapi` $CPPFLAGS"
|
||||
LIBGSSAPI="`$KRB5CONFIG --libs gssapi`"
|
||||
;;
|
||||
esac
|
||||
AC_DEFINE(HAVE_GSSAPI, 1, [Whether GSSAPI is available])
|
||||
else
|
||||
# Check for vendor-specific implementations...
|
||||
@@ -60,7 +72,7 @@ if test x$enable_gssapi != xno; then
|
||||
|
||||
AC_CHECK_FUNC(gsskrb5_register_acceptor_identity,
|
||||
AC_DEFINE(HAVE_GSSKRB5_REGISTER_ACCEPTOR_IDENTITY))
|
||||
AC_CHECK_FUNC(krb5_cc_resolve, AC_DEFINE(HAVE_KRB5_CC_RESOLVE))
|
||||
AC_CHECK_FUNC(krb5_cc_new_unique, AC_DEFINE(HAVE_KRB5_CC_NEW_UNIQUE))
|
||||
|
||||
AC_MSG_CHECKING(for GSS_C_NT_HOSTBASED_SERVICE)
|
||||
if test $ac_cv_header_gssapi_gssapi_h = yes; then
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
dnl
|
||||
dnl "$Id: cups-network.m4 6649 2007-07-11 21:46:42Z mike $"
|
||||
dnl "$Id: cups-network.m4 7919 2008-09-09 22:03:27Z mike $"
|
||||
dnl
|
||||
dnl Networking stuff for the Common UNIX Printing System (CUPS).
|
||||
dnl
|
||||
dnl Copyright 2007 by Apple Inc.
|
||||
dnl Copyright 2007-2008 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
|
||||
@@ -13,11 +13,15 @@ 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))
|
||||
AC_SEARCH_LIBS(socket, socket)
|
||||
AC_SEARCH_LIBS(gethostbyaddr, nsl)
|
||||
AC_SEARCH_LIBS(getifaddrs, nsl, AC_DEFINE(HAVE_GETIFADDRS))
|
||||
AC_SEARCH_LIBS(hstrerror, nsl socket resolv, AC_DEFINE(HAVE_HSTRERROR))
|
||||
AC_SEARCH_LIBS(rresvport_af, nsl, AC_DEFINE(HAVE_RRESVPORT_AF))
|
||||
AC_SEARCH_LIBS(__res_init, resolv bind, AC_DEFINE(HAVE_RES_INIT),
|
||||
AC_SEARCH_LIBS(res_9_init, resolv bind, AC_DEFINE(HAVE_RES_INIT),
|
||||
AC_SEARCH_LIBS(res_init, resolv bind, AC_DEFINE(HAVE_RES_INIT))))
|
||||
|
||||
# Tru64 5.1b leaks file descriptors with these functions; disable until
|
||||
# we can come up with a test for this...
|
||||
@@ -29,24 +33,6 @@ fi
|
||||
AC_CHECK_MEMBER(struct sockaddr.sa_len,,, [#include <sys/socket.h>])
|
||||
AC_CHECK_HEADER(sys/sockio.h, AC_DEFINE(HAVE_SYS_SOCKIO_H))
|
||||
|
||||
if test "$uname" = "SunOS"; then
|
||||
case "$uversion" in
|
||||
55* | 56*)
|
||||
maxfiles=1024
|
||||
;;
|
||||
*)
|
||||
maxfiles=4096
|
||||
;;
|
||||
esac
|
||||
else
|
||||
maxfiles=4096
|
||||
fi
|
||||
|
||||
AC_ARG_WITH(maxfiles, [ --with-maxfiles=N set maximum number of file descriptors for scheduler ],
|
||||
maxfiles=$withval)
|
||||
|
||||
AC_DEFINE_UNQUOTED(CUPS_MAX_FDS, $maxfiles)
|
||||
|
||||
CUPS_DEFAULT_DOMAINSOCKET=""
|
||||
|
||||
dnl Domain socket support...
|
||||
@@ -84,5 +70,5 @@ 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 6649 2007-07-11 21:46:42Z mike $".
|
||||
dnl End of "$Id: cups-network.m4 7919 2008-09-09 22:03:27Z mike $".
|
||||
dnl
|
||||
|
||||
+22
-15
@@ -76,13 +76,6 @@
|
||||
#define CUPS_DEFAULT_MAX_COPIES 100
|
||||
|
||||
|
||||
/*
|
||||
* Maximum number of file descriptors to support.
|
||||
*/
|
||||
|
||||
#define CUPS_MAX_FDS 4096
|
||||
|
||||
|
||||
/*
|
||||
* Do we have domain socket support?
|
||||
*/
|
||||
@@ -378,6 +371,20 @@
|
||||
#undef HAVE_HSTRERROR
|
||||
|
||||
|
||||
/*
|
||||
* Do we have res_init()?
|
||||
*/
|
||||
|
||||
#undef HAVE_RES_INIT
|
||||
|
||||
|
||||
/*
|
||||
* Do we have <resolv.h>
|
||||
*/
|
||||
|
||||
#undef HAVE_RESOLV_H
|
||||
|
||||
|
||||
/*
|
||||
* Do we have the <sys/sockio.h> header file?
|
||||
*/
|
||||
@@ -445,13 +452,6 @@
|
||||
#undef HAVE_CFBUNDLEPRIV_H
|
||||
|
||||
|
||||
/*
|
||||
* Do we have CFLocaleCreateCanonicalLocaleIdentifierFromString()?
|
||||
*/
|
||||
|
||||
#undef HAVE_CF_LOCALE_ID
|
||||
|
||||
|
||||
/*
|
||||
* Do we have MacOSX 10.4's mbr_XXX functions()?
|
||||
*/
|
||||
@@ -495,7 +495,7 @@
|
||||
#undef HAVE_GSSAPI_GSSAPI_KRB5_H
|
||||
#undef HAVE_GSSKRB5_REGISTER_ACCEPTOR_IDENTITY
|
||||
#undef HAVE_GSS_C_NT_HOSTBASED_SERVICE
|
||||
#undef HAVE_KRB5_CC_RESOLVE
|
||||
#undef HAVE_KRB5_CC_NEW_UNIQUE
|
||||
#undef HAVE_KRB5_H
|
||||
#undef HAVE_HEIMDAL
|
||||
|
||||
@@ -523,6 +523,13 @@
|
||||
#undef HAVE_DLFCN_H
|
||||
|
||||
|
||||
/*
|
||||
* Do we have <sys/param.h>?
|
||||
*/
|
||||
|
||||
#undef HAVE_SYS_PARAM_H
|
||||
|
||||
|
||||
/*
|
||||
* Do we have <sys/ucred.h>?
|
||||
*/
|
||||
|
||||
+303
-324
@@ -1,324 +1,303 @@
|
||||
# DO NOT DELETE THIS LINE -- make depend depends on it.
|
||||
adminutil.o: adminutil.c adminutil.h cups.h ipp.h http.h string.h \
|
||||
../config.h ppd.h array.h file.h language.h globals.h string.h \
|
||||
http-private.h md5.h ipp-private.h i18n.h transcode.h debug.h
|
||||
array.o: array.c array.h string.h ../config.h string.h debug.h
|
||||
attr.o: attr.c ppd.h array.h file.h debug.h string.h ../config.h string.h
|
||||
auth.o: auth.c globals.h string.h ../config.h string.h http-private.h \
|
||||
http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h \
|
||||
i18n.h transcode.h debug.h
|
||||
backchannel.o: backchannel.c cups.h ipp.h http.h string.h ../config.h \
|
||||
ppd.h array.h file.h language.h
|
||||
backend.o: backend.c backend.h string.h ../config.h string.h
|
||||
custom.o: custom.c globals.h string.h ../config.h string.h http-private.h \
|
||||
http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h \
|
||||
i18n.h transcode.h debug.h
|
||||
dest.o: dest.c globals.h string.h ../config.h string.h http-private.h \
|
||||
http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h \
|
||||
i18n.h transcode.h
|
||||
dir.o: dir.c dir.h string.h ../config.h string.h debug.h
|
||||
emit.o: emit.c ppd.h array.h file.h string.h ../config.h string.h debug.h
|
||||
encode.o: encode.c cups.h ipp.h http.h string.h ../config.h ppd.h array.h \
|
||||
file.h language.h ipp-private.h string.h debug.h
|
||||
file.o: file.c http-private.h ../config.h http.h string.h md5.h \
|
||||
ipp-private.h ipp.h globals.h string.h cups.h ppd.h array.h file.h \
|
||||
language.h i18n.h transcode.h debug.h
|
||||
getifaddrs.o: getifaddrs.c http-private.h ../config.h http.h string.h \
|
||||
md5.h ipp-private.h ipp.h
|
||||
getputfile.o: getputfile.c http-private.h ../config.h http.h string.h \
|
||||
md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h \
|
||||
string.h debug.h
|
||||
globals.o: globals.c http-private.h ../config.h http.h string.h md5.h \
|
||||
ipp-private.h ipp.h globals.h string.h cups.h ppd.h array.h file.h \
|
||||
language.h i18n.h transcode.h debug.h
|
||||
http.o: http.c http-private.h ../config.h http.h string.h md5.h \
|
||||
ipp-private.h ipp.h globals.h string.h cups.h ppd.h array.h file.h \
|
||||
language.h i18n.h transcode.h debug.h
|
||||
http-addr.o: http-addr.c globals.h string.h ../config.h string.h \
|
||||
http-private.h http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h \
|
||||
file.h language.h i18n.h transcode.h debug.h
|
||||
http-addrlist.o: http-addrlist.c http-private.h ../config.h http.h \
|
||||
string.h md5.h ipp-private.h ipp.h globals.h string.h cups.h ppd.h \
|
||||
array.h file.h language.h i18n.h transcode.h debug.h
|
||||
http-support.o: http-support.c debug.h globals.h string.h ../config.h \
|
||||
string.h http-private.h http.h md5.h ipp-private.h ipp.h cups.h ppd.h \
|
||||
array.h file.h language.h i18n.h transcode.h
|
||||
ipp.o: ipp.c http-private.h ../config.h http.h string.h md5.h \
|
||||
ipp-private.h ipp.h globals.h string.h cups.h ppd.h array.h file.h \
|
||||
language.h i18n.h transcode.h debug.h
|
||||
ipp-support.o: ipp-support.c globals.h string.h ../config.h string.h \
|
||||
http-private.h http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h \
|
||||
file.h language.h i18n.h transcode.h debug.h
|
||||
langprintf.o: langprintf.c globals.h string.h ../config.h string.h \
|
||||
http-private.h http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h \
|
||||
file.h language.h i18n.h transcode.h
|
||||
language.o: language.c globals.h string.h ../config.h string.h \
|
||||
http-private.h http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h \
|
||||
file.h language.h i18n.h transcode.h debug.h
|
||||
localize.o: localize.c globals.h string.h ../config.h string.h \
|
||||
http-private.h http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h \
|
||||
file.h language.h i18n.h transcode.h debug.h
|
||||
mark.o: mark.c cups.h ipp.h http.h string.h ../config.h ppd.h array.h \
|
||||
file.h language.h string.h debug.h
|
||||
md5.o: md5.c md5.h string.h ../config.h string.h
|
||||
md5passwd.o: md5passwd.c http-private.h ../config.h http.h string.h md5.h \
|
||||
ipp-private.h ipp.h string.h
|
||||
notify.o: notify.c globals.h string.h ../config.h string.h http-private.h \
|
||||
http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h \
|
||||
i18n.h transcode.h
|
||||
options.o: options.c cups.h ipp.h http.h string.h ../config.h ppd.h \
|
||||
array.h file.h language.h string.h debug.h
|
||||
page.o: page.c ppd.h array.h file.h string.h ../config.h string.h
|
||||
ppd.o: ppd.c globals.h string.h ../config.h string.h http-private.h \
|
||||
http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h \
|
||||
i18n.h transcode.h debug.h
|
||||
request.o: request.c globals.h string.h ../config.h string.h \
|
||||
http-private.h http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h \
|
||||
file.h language.h i18n.h transcode.h debug.h
|
||||
sidechannel.o: sidechannel.c sidechannel.h string.h ../config.h string.h
|
||||
snprintf.o: snprintf.c string.h ../config.h string.h
|
||||
string.o: string.c array.h debug.h string.h ../config.h string.h
|
||||
tempfile.o: tempfile.c globals.h string.h ../config.h string.h \
|
||||
http-private.h http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h \
|
||||
file.h language.h i18n.h transcode.h debug.h
|
||||
transcode.o: transcode.c globals.h string.h ../config.h string.h \
|
||||
http-private.h http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h \
|
||||
file.h language.h i18n.h transcode.h debug.h
|
||||
usersys.o: usersys.c http-private.h ../config.h http.h string.h md5.h \
|
||||
ipp-private.h ipp.h globals.h string.h cups.h ppd.h array.h file.h \
|
||||
language.h i18n.h transcode.h debug.h
|
||||
util.o: util.c globals.h string.h ../config.h string.h http-private.h \
|
||||
http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h \
|
||||
i18n.h transcode.h debug.h
|
||||
testadmin.o: testadmin.c adminutil.h cups.h ipp.h http.h string.h \
|
||||
../config.h ppd.h array.h file.h language.h string.h
|
||||
testarray.o: testarray.c ../cups/string.h ../config.h string.h array.h \
|
||||
dir.h debug.h
|
||||
testcups.o: testcups.c cups.h ipp.h http.h string.h ../config.h ppd.h \
|
||||
array.h file.h language.h
|
||||
testfile.o: testfile.c string.h ../config.h string.h file.h debug.h
|
||||
testhttp.o: testhttp.c http.h string.h ../config.h string.h
|
||||
testi18n.o: testi18n.c i18n.h transcode.h language.h array.h string.h \
|
||||
../config.h string.h
|
||||
testipp.o: testipp.c ../cups/string.h ../config.h string.h ipp-private.h \
|
||||
ipp.h http.h
|
||||
testlang.o: testlang.c i18n.h transcode.h language.h array.h string.h \
|
||||
../config.h string.h
|
||||
testppd.o: testppd.c ../cups/string.h ../config.h string.h ppd.h array.h \
|
||||
file.h
|
||||
# DO NOT DELETE THIS LINE -- make depend depends on it.
|
||||
adminutil.32.o: adminutil.c adminutil.c adminutil.h cups.h ipp.h http.h string.h \
|
||||
../config.h ppd.h array.h file.h language.h globals.h string.h \
|
||||
http-private.h md5.h ipp-private.h i18n.h transcode.h debug.h
|
||||
array.32.o: array.c array.c array.h string.h ../config.h string.h debug.h
|
||||
attr.32.o: attr.c attr.c ppd.h array.h file.h debug.h string.h ../config.h string.h
|
||||
auth.32.o: auth.c auth.c globals.h string.h ../config.h string.h http-private.h \
|
||||
http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h \
|
||||
i18n.h transcode.h debug.h
|
||||
backchannel.32.o: backchannel.c backchannel.c cups.h ipp.h http.h string.h ../config.h \
|
||||
ppd.h array.h file.h language.h
|
||||
backend.32.o: backend.c backend.c backend.h string.h ../config.h string.h
|
||||
custom.32.o: custom.c custom.c globals.h string.h ../config.h string.h http-private.h \
|
||||
http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h \
|
||||
i18n.h transcode.h debug.h
|
||||
dest.32.o: dest.c dest.c globals.h string.h ../config.h string.h http-private.h \
|
||||
http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h \
|
||||
i18n.h transcode.h
|
||||
dir.32.o: dir.c dir.c dir.h string.h ../config.h string.h debug.h
|
||||
emit.32.o: emit.c emit.c ppd.h array.h file.h string.h ../config.h string.h debug.h
|
||||
encode.32.o: encode.c encode.c cups.h ipp.h http.h string.h ../config.h ppd.h array.h \
|
||||
file.h language.h ipp-private.h string.h debug.h
|
||||
file.32.o: file.c file.c http-private.h ../config.h http.h string.h md5.h \
|
||||
ipp-private.h ipp.h globals.h string.h cups.h ppd.h array.h file.h \
|
||||
language.h i18n.h transcode.h debug.h
|
||||
getifaddrs.32.o: getifaddrs.c getifaddrs.c http-private.h ../config.h http.h string.h \
|
||||
md5.h ipp-private.h ipp.h
|
||||
getputfile.32.o: getputfile.c getputfile.c http-private.h ../config.h http.h string.h \
|
||||
md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h \
|
||||
string.h debug.h
|
||||
globals.32.o: globals.c globals.c http-private.h ../config.h http.h string.h md5.h \
|
||||
ipp-private.h ipp.h globals.h string.h cups.h ppd.h array.h file.h \
|
||||
language.h i18n.h transcode.h debug.h
|
||||
http.32.o: http.c http.c http-private.h ../config.h http.h string.h md5.h \
|
||||
ipp-private.h ipp.h globals.h string.h cups.h ppd.h array.h file.h \
|
||||
language.h i18n.h transcode.h debug.h
|
||||
http-addr.32.o: http-addr.c http-addr.c globals.h string.h ../config.h string.h \
|
||||
http-private.h http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h \
|
||||
file.h language.h i18n.h transcode.h debug.h
|
||||
http-addrlist.32.o: http-addrlist.c http-addrlist.c http-private.h ../config.h http.h \
|
||||
string.h md5.h ipp-private.h ipp.h globals.h string.h cups.h ppd.h \
|
||||
array.h file.h language.h i18n.h transcode.h debug.h
|
||||
http-support.32.o: http-support.c http-support.c debug.h globals.h string.h ../config.h \
|
||||
string.h http-private.h http.h md5.h ipp-private.h ipp.h cups.h ppd.h \
|
||||
array.h file.h language.h i18n.h transcode.h
|
||||
ipp.32.o: ipp.c ipp.c http-private.h ../config.h http.h string.h md5.h \
|
||||
ipp-private.h ipp.h globals.h string.h cups.h ppd.h array.h file.h \
|
||||
language.h i18n.h transcode.h debug.h
|
||||
ipp-support.32.o: ipp-support.c ipp-support.c globals.h string.h ../config.h string.h \
|
||||
http-private.h http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h \
|
||||
file.h language.h i18n.h transcode.h debug.h
|
||||
langprintf.32.o: langprintf.c langprintf.c globals.h string.h ../config.h string.h \
|
||||
http-private.h http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h \
|
||||
file.h language.h i18n.h transcode.h
|
||||
language.32.o: language.c language.c globals.h string.h ../config.h string.h \
|
||||
http-private.h http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h \
|
||||
file.h language.h i18n.h transcode.h debug.h
|
||||
localize.32.o: localize.c localize.c globals.h string.h ../config.h string.h \
|
||||
http-private.h http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h \
|
||||
file.h language.h i18n.h transcode.h debug.h
|
||||
mark.32.o: mark.c mark.c cups.h ipp.h http.h string.h ../config.h ppd.h array.h \
|
||||
file.h language.h string.h debug.h
|
||||
md5.32.o: md5.c md5.c md5.h string.h ../config.h string.h
|
||||
md5passwd.32.o: md5passwd.c md5passwd.c http-private.h ../config.h http.h string.h md5.h \
|
||||
ipp-private.h ipp.h string.h
|
||||
notify.32.o: notify.c notify.c globals.h string.h ../config.h string.h http-private.h \
|
||||
http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h \
|
||||
i18n.h transcode.h
|
||||
options.32.o: options.c options.c cups.h ipp.h http.h string.h ../config.h ppd.h \
|
||||
array.h file.h language.h string.h debug.h
|
||||
page.32.o: page.c page.c ppd.h array.h file.h string.h ../config.h string.h
|
||||
ppd.32.o: ppd.c ppd.c globals.h string.h ../config.h string.h http-private.h \
|
||||
http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h \
|
||||
i18n.h transcode.h debug.h
|
||||
request.32.o: request.c request.c globals.h string.h ../config.h string.h \
|
||||
http-private.h http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h \
|
||||
file.h language.h i18n.h transcode.h debug.h
|
||||
sidechannel.32.o: sidechannel.c sidechannel.c sidechannel.h string.h ../config.h string.h
|
||||
snprintf.32.o: snprintf.c snprintf.c string.h ../config.h string.h
|
||||
string.32.o: string.c string.c array.h debug.h string.h ../config.h string.h
|
||||
tempfile.32.o: tempfile.c tempfile.c globals.h string.h ../config.h string.h \
|
||||
http-private.h http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h \
|
||||
file.h language.h i18n.h transcode.h debug.h
|
||||
transcode.32.o: transcode.c transcode.c globals.h string.h ../config.h string.h \
|
||||
http-private.h http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h \
|
||||
file.h language.h i18n.h transcode.h debug.h
|
||||
usersys.32.o: usersys.c usersys.c http-private.h ../config.h http.h string.h md5.h \
|
||||
ipp-private.h ipp.h globals.h string.h cups.h ppd.h array.h file.h \
|
||||
language.h i18n.h transcode.h debug.h
|
||||
util.32.o: util.c util.c globals.h string.h ../config.h string.h http-private.h \
|
||||
http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h \
|
||||
i18n.h transcode.h debug.h
|
||||
testadmin.32.o: testadmin.c testadmin.c adminutil.h cups.h ipp.h http.h string.h \
|
||||
../config.h ppd.h array.h file.h language.h string.h
|
||||
testarray.32.o: testarray.c testarray.c ../cups/string.h ../config.h string.h array.h \
|
||||
dir.h debug.h
|
||||
testcups.32.o: testcups.c testcups.c cups.h ipp.h http.h string.h ../config.h ppd.h \
|
||||
array.h file.h language.h
|
||||
testfile.32.o: testfile.c testfile.c string.h ../config.h string.h file.h debug.h
|
||||
testhttp.32.o: testhttp.c testhttp.c http.h string.h ../config.h string.h
|
||||
testi18n.32.o: testi18n.c testi18n.c i18n.h transcode.h language.h array.h string.h \
|
||||
../config.h string.h
|
||||
testipp.32.o: testipp.c testipp.c ../cups/string.h ../config.h string.h ipp-private.h \
|
||||
ipp.h http.h
|
||||
testlang.32.o: testlang.c testlang.c i18n.h transcode.h language.h array.h string.h \
|
||||
../config.h string.h
|
||||
testppd.32.o: testppd.c testppd.c ../cups/string.h ../config.h string.h ppd.h array.h \
|
||||
file.h
|
||||
# DO NOT DELETE THIS LINE -- make depend depends on it.
|
||||
adminutil.64.o: adminutil.c adminutil.c adminutil.h cups.h ipp.h http.h string.h \
|
||||
../config.h ppd.h array.h file.h language.h globals.h string.h \
|
||||
http-private.h md5.h ipp-private.h i18n.h transcode.h debug.h
|
||||
array.64.o: array.c array.c array.h string.h ../config.h string.h debug.h
|
||||
attr.64.o: attr.c attr.c ppd.h array.h file.h debug.h string.h ../config.h string.h
|
||||
auth.64.o: auth.c auth.c globals.h string.h ../config.h string.h http-private.h \
|
||||
http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h \
|
||||
i18n.h transcode.h debug.h
|
||||
backchannel.64.o: backchannel.c backchannel.c cups.h ipp.h http.h string.h ../config.h \
|
||||
ppd.h array.h file.h language.h
|
||||
backend.64.o: backend.c backend.c backend.h string.h ../config.h string.h
|
||||
custom.64.o: custom.c custom.c globals.h string.h ../config.h string.h http-private.h \
|
||||
http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h \
|
||||
i18n.h transcode.h debug.h
|
||||
dest.64.o: dest.c dest.c globals.h string.h ../config.h string.h http-private.h \
|
||||
http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h \
|
||||
i18n.h transcode.h
|
||||
dir.64.o: dir.c dir.c dir.h string.h ../config.h string.h debug.h
|
||||
emit.64.o: emit.c emit.c ppd.h array.h file.h string.h ../config.h string.h debug.h
|
||||
encode.64.o: encode.c encode.c cups.h ipp.h http.h string.h ../config.h ppd.h array.h \
|
||||
file.h language.h ipp-private.h string.h debug.h
|
||||
file.64.o: file.c file.c http-private.h ../config.h http.h string.h md5.h \
|
||||
ipp-private.h ipp.h globals.h string.h cups.h ppd.h array.h file.h \
|
||||
language.h i18n.h transcode.h debug.h
|
||||
getifaddrs.64.o: getifaddrs.c getifaddrs.c http-private.h ../config.h http.h string.h \
|
||||
md5.h ipp-private.h ipp.h
|
||||
getputfile.64.o: getputfile.c getputfile.c http-private.h ../config.h http.h string.h \
|
||||
md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h \
|
||||
string.h debug.h
|
||||
globals.64.o: globals.c globals.c http-private.h ../config.h http.h string.h md5.h \
|
||||
ipp-private.h ipp.h globals.h string.h cups.h ppd.h array.h file.h \
|
||||
language.h i18n.h transcode.h debug.h
|
||||
http.64.o: http.c http.c http-private.h ../config.h http.h string.h md5.h \
|
||||
ipp-private.h ipp.h globals.h string.h cups.h ppd.h array.h file.h \
|
||||
language.h i18n.h transcode.h debug.h
|
||||
http-addr.64.o: http-addr.c http-addr.c globals.h string.h ../config.h string.h \
|
||||
http-private.h http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h \
|
||||
file.h language.h i18n.h transcode.h debug.h
|
||||
http-addrlist.64.o: http-addrlist.c http-addrlist.c http-private.h ../config.h http.h \
|
||||
string.h md5.h ipp-private.h ipp.h globals.h string.h cups.h ppd.h \
|
||||
array.h file.h language.h i18n.h transcode.h debug.h
|
||||
http-support.64.o: http-support.c http-support.c debug.h globals.h string.h ../config.h \
|
||||
string.h http-private.h http.h md5.h ipp-private.h ipp.h cups.h ppd.h \
|
||||
array.h file.h language.h i18n.h transcode.h
|
||||
ipp.64.o: ipp.c ipp.c http-private.h ../config.h http.h string.h md5.h \
|
||||
ipp-private.h ipp.h globals.h string.h cups.h ppd.h array.h file.h \
|
||||
language.h i18n.h transcode.h debug.h
|
||||
ipp-support.64.o: ipp-support.c ipp-support.c globals.h string.h ../config.h string.h \
|
||||
http-private.h http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h \
|
||||
file.h language.h i18n.h transcode.h debug.h
|
||||
langprintf.64.o: langprintf.c langprintf.c globals.h string.h ../config.h string.h \
|
||||
http-private.h http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h \
|
||||
file.h language.h i18n.h transcode.h
|
||||
language.64.o: language.c language.c globals.h string.h ../config.h string.h \
|
||||
http-private.h http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h \
|
||||
file.h language.h i18n.h transcode.h debug.h
|
||||
localize.64.o: localize.c localize.c globals.h string.h ../config.h string.h \
|
||||
http-private.h http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h \
|
||||
file.h language.h i18n.h transcode.h debug.h
|
||||
mark.64.o: mark.c mark.c cups.h ipp.h http.h string.h ../config.h ppd.h array.h \
|
||||
file.h language.h string.h debug.h
|
||||
md5.64.o: md5.c md5.c md5.h string.h ../config.h string.h
|
||||
md5passwd.64.o: md5passwd.c md5passwd.c http-private.h ../config.h http.h string.h md5.h \
|
||||
ipp-private.h ipp.h string.h
|
||||
notify.64.o: notify.c notify.c globals.h string.h ../config.h string.h http-private.h \
|
||||
http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h \
|
||||
i18n.h transcode.h
|
||||
options.64.o: options.c options.c cups.h ipp.h http.h string.h ../config.h ppd.h \
|
||||
array.h file.h language.h string.h debug.h
|
||||
page.64.o: page.c page.c ppd.h array.h file.h string.h ../config.h string.h
|
||||
ppd.64.o: ppd.c ppd.c globals.h string.h ../config.h string.h http-private.h \
|
||||
http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h \
|
||||
i18n.h transcode.h debug.h
|
||||
request.64.o: request.c request.c globals.h string.h ../config.h string.h \
|
||||
http-private.h http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h \
|
||||
file.h language.h i18n.h transcode.h debug.h
|
||||
sidechannel.64.o: sidechannel.c sidechannel.c sidechannel.h string.h ../config.h string.h
|
||||
snprintf.64.o: snprintf.c snprintf.c string.h ../config.h string.h
|
||||
string.64.o: string.c string.c array.h debug.h string.h ../config.h string.h
|
||||
tempfile.64.o: tempfile.c tempfile.c globals.h string.h ../config.h string.h \
|
||||
http-private.h http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h \
|
||||
file.h language.h i18n.h transcode.h debug.h
|
||||
transcode.64.o: transcode.c transcode.c globals.h string.h ../config.h string.h \
|
||||
http-private.h http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h \
|
||||
file.h language.h i18n.h transcode.h debug.h
|
||||
usersys.64.o: usersys.c usersys.c http-private.h ../config.h http.h string.h md5.h \
|
||||
ipp-private.h ipp.h globals.h string.h cups.h ppd.h array.h file.h \
|
||||
language.h i18n.h transcode.h debug.h
|
||||
util.64.o: util.c util.c globals.h string.h ../config.h string.h http-private.h \
|
||||
http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h \
|
||||
i18n.h transcode.h debug.h
|
||||
testadmin.64.o: testadmin.c testadmin.c adminutil.h cups.h ipp.h http.h string.h \
|
||||
../config.h ppd.h array.h file.h language.h string.h
|
||||
testarray.64.o: testarray.c testarray.c ../cups/string.h ../config.h string.h array.h \
|
||||
dir.h debug.h
|
||||
testcups.64.o: testcups.c testcups.c cups.h ipp.h http.h string.h ../config.h ppd.h \
|
||||
array.h file.h language.h
|
||||
testfile.64.o: testfile.c testfile.c string.h ../config.h string.h file.h debug.h
|
||||
testhttp.64.o: testhttp.c testhttp.c http.h string.h ../config.h string.h
|
||||
testi18n.64.o: testi18n.c testi18n.c i18n.h transcode.h language.h array.h string.h \
|
||||
../config.h string.h
|
||||
testipp.64.o: testipp.c testipp.c ../cups/string.h ../config.h string.h ipp-private.h \
|
||||
ipp.h http.h
|
||||
testlang.64.o: testlang.c testlang.c i18n.h transcode.h language.h array.h string.h \
|
||||
../config.h string.h
|
||||
testppd.64.o: testppd.c testppd.c ../cups/string.h ../config.h string.h ppd.h array.h \
|
||||
file.h
|
||||
# DO NOT DELETE
|
||||
|
||||
adminutil.o: adminutil.h cups.h ipp.h http.h ppd.h array.h file.h language.h
|
||||
adminutil.o: globals.h string.h ../config.h http-private.h md5.h
|
||||
adminutil.o: ipp-private.h i18n.h transcode.h debug.h
|
||||
array.o: array.h string.h ../config.h debug.h
|
||||
attr.o: ppd.h array.h file.h debug.h string.h ../config.h
|
||||
auth.o: globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
auth.o: ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
|
||||
auth.o: transcode.h debug.h
|
||||
backchannel.o: cups.h ipp.h http.h ppd.h array.h file.h language.h
|
||||
backend.o: backend.h string.h ../config.h
|
||||
custom.o: globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
custom.o: ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
|
||||
custom.o: transcode.h debug.h
|
||||
dest.o: globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
dest.o: ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
|
||||
dest.o: transcode.h
|
||||
dir.o: dir.h string.h ../config.h debug.h
|
||||
emit.o: ppd.h array.h file.h string.h ../config.h debug.h
|
||||
encode.o: cups.h ipp.h http.h ppd.h array.h file.h language.h ipp-private.h
|
||||
encode.o: string.h ../config.h debug.h
|
||||
file.o: http-private.h ../config.h http.h md5.h ipp-private.h ipp.h globals.h
|
||||
file.o: string.h cups.h ppd.h array.h file.h language.h i18n.h transcode.h
|
||||
file.o: debug.h
|
||||
getifaddrs.o: http-private.h ../config.h http.h md5.h ipp-private.h ipp.h
|
||||
getputfile.o: globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
getputfile.o: ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h
|
||||
getputfile.o: i18n.h transcode.h debug.h
|
||||
globals.o: http-private.h ../config.h http.h md5.h ipp-private.h ipp.h
|
||||
globals.o: globals.h string.h cups.h ppd.h array.h file.h language.h i18n.h
|
||||
globals.o: transcode.h debug.h
|
||||
http.o: http-private.h ../config.h http.h md5.h ipp-private.h ipp.h globals.h
|
||||
http.o: string.h cups.h ppd.h array.h file.h language.h i18n.h transcode.h
|
||||
http.o: debug.h
|
||||
http-addr.o: http-private.h ../config.h http.h md5.h ipp-private.h ipp.h
|
||||
http-addr.o: globals.h string.h cups.h ppd.h array.h file.h language.h i18n.h
|
||||
http-addr.o: transcode.h debug.h
|
||||
http-addrlist.o: http-private.h ../config.h http.h md5.h ipp-private.h ipp.h
|
||||
http-addrlist.o: globals.h string.h cups.h ppd.h array.h file.h language.h
|
||||
http-addrlist.o: i18n.h transcode.h debug.h
|
||||
http-support.o: debug.h globals.h string.h ../config.h http-private.h http.h
|
||||
http-support.o: md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h
|
||||
http-support.o: language.h i18n.h transcode.h
|
||||
ipp.o: http-private.h ../config.h http.h md5.h ipp-private.h ipp.h globals.h
|
||||
ipp.o: string.h cups.h ppd.h array.h file.h language.h i18n.h transcode.h
|
||||
ipp.o: debug.h
|
||||
ipp-support.o: globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
ipp-support.o: ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h
|
||||
ipp-support.o: i18n.h transcode.h debug.h
|
||||
langprintf.o: globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
langprintf.o: ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h
|
||||
langprintf.o: i18n.h transcode.h
|
||||
language.o: globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
language.o: ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
|
||||
language.o: transcode.h debug.h
|
||||
localize.o: globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
localize.o: ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
|
||||
localize.o: transcode.h debug.h
|
||||
mark.o: cups.h ipp.h http.h ppd.h array.h file.h language.h string.h
|
||||
mark.o: ../config.h debug.h
|
||||
md5.o: md5.h string.h ../config.h
|
||||
md5passwd.o: http-private.h ../config.h http.h md5.h ipp-private.h ipp.h
|
||||
md5passwd.o: string.h
|
||||
notify.o: globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
notify.o: ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
|
||||
notify.o: transcode.h
|
||||
options.o: cups.h ipp.h http.h ppd.h array.h file.h language.h string.h
|
||||
options.o: ../config.h debug.h
|
||||
page.o: ppd.h array.h file.h string.h ../config.h
|
||||
ppd.o: globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
ppd.o: ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
|
||||
ppd.o: transcode.h debug.h
|
||||
request.o: globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
request.o: ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
|
||||
request.o: transcode.h debug.h
|
||||
sidechannel.o: sidechannel.h string.h ../config.h
|
||||
snprintf.o: string.h ../config.h
|
||||
string.o: array.h debug.h string.h ../config.h
|
||||
tempfile.o: globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
tempfile.o: ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
|
||||
tempfile.o: transcode.h debug.h
|
||||
transcode.o: globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
transcode.o: ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h
|
||||
transcode.o: i18n.h transcode.h debug.h
|
||||
usersys.o: http-private.h ../config.h http.h md5.h ipp-private.h ipp.h
|
||||
usersys.o: globals.h string.h cups.h ppd.h array.h file.h language.h i18n.h
|
||||
usersys.o: transcode.h debug.h
|
||||
util.o: globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
util.o: ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
|
||||
util.o: transcode.h debug.h
|
||||
testadmin.o: adminutil.h cups.h ipp.h http.h ppd.h array.h file.h language.h
|
||||
testadmin.o: string.h ../config.h
|
||||
testarray.o: ../cups/string.h ../config.h string.h array.h dir.h debug.h
|
||||
testcups.o: cups.h ipp.h http.h ppd.h array.h file.h language.h
|
||||
testfile.o: string.h ../config.h file.h debug.h
|
||||
testhttp.o: http.h string.h ../config.h
|
||||
testi18n.o: i18n.h transcode.h language.h array.h string.h ../config.h
|
||||
testipp.o: ../cups/string.h ../config.h string.h ipp-private.h ipp.h http.h
|
||||
testlang.o: i18n.h transcode.h language.h array.h string.h ../config.h
|
||||
testppd.o: ../cups/string.h ../config.h string.h ppd.h array.h file.h
|
||||
# DO NOT DELETE
|
||||
|
||||
adminutil.32.o: adminutil.c adminutil.h cups.h ipp.h http.h ppd.h array.h file.h language.h
|
||||
adminutil.32.o: adminutil.c globals.h string.h ../config.h http-private.h md5.h
|
||||
adminutil.32.o: adminutil.c ipp-private.h i18n.h transcode.h debug.h
|
||||
array.32.o: array.c array.h string.h ../config.h debug.h
|
||||
attr.32.o: attr.c ppd.h array.h file.h debug.h string.h ../config.h
|
||||
auth.32.o: auth.c globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
auth.32.o: auth.c ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
|
||||
auth.32.o: auth.c transcode.h debug.h
|
||||
backchannel.32.o: backchannel.c cups.h ipp.h http.h ppd.h array.h file.h language.h
|
||||
backend.32.o: backend.c backend.h string.h ../config.h
|
||||
custom.32.o: custom.c globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
custom.32.o: custom.c ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
|
||||
custom.32.o: custom.c transcode.h debug.h
|
||||
dest.32.o: dest.c globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
dest.32.o: dest.c ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
|
||||
dest.32.o: dest.c transcode.h
|
||||
dir.32.o: dir.c dir.h string.h ../config.h debug.h
|
||||
emit.32.o: emit.c ppd.h array.h file.h string.h ../config.h debug.h
|
||||
encode.32.o: encode.c cups.h ipp.h http.h ppd.h array.h file.h language.h ipp-private.h
|
||||
encode.32.o: encode.c string.h ../config.h debug.h
|
||||
file.32.o: file.c http-private.h ../config.h http.h md5.h ipp-private.h ipp.h globals.h
|
||||
file.32.o: file.c string.h cups.h ppd.h array.h file.h language.h i18n.h transcode.h
|
||||
file.32.o: file.c debug.h
|
||||
getifaddrs.32.o: getifaddrs.c http-private.h ../config.h http.h md5.h ipp-private.h ipp.h
|
||||
getputfile.32.o: getputfile.c globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
getputfile.32.o: getputfile.c ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h
|
||||
getputfile.32.o: getputfile.c i18n.h transcode.h debug.h
|
||||
globals.32.o: globals.c http-private.h ../config.h http.h md5.h ipp-private.h ipp.h
|
||||
globals.32.o: globals.c globals.h string.h cups.h ppd.h array.h file.h language.h i18n.h
|
||||
globals.32.o: globals.c transcode.h debug.h
|
||||
http.32.o: http.c http-private.h ../config.h http.h md5.h ipp-private.h ipp.h globals.h
|
||||
http.32.o: http.c string.h cups.h ppd.h array.h file.h language.h i18n.h transcode.h
|
||||
http.32.o: http.c debug.h
|
||||
http-addr.32.o: http-addr.c http-private.h ../config.h http.h md5.h ipp-private.h ipp.h
|
||||
http-addr.32.o: http-addr.c globals.h string.h cups.h ppd.h array.h file.h language.h i18n.h
|
||||
http-addr.32.o: http-addr.c transcode.h debug.h
|
||||
http-addrlist.32.o: http-addrlist.c http-private.h ../config.h http.h md5.h ipp-private.h ipp.h
|
||||
http-addrlist.32.o: http-addrlist.c globals.h string.h cups.h ppd.h array.h file.h language.h
|
||||
http-addrlist.32.o: http-addrlist.c i18n.h transcode.h debug.h
|
||||
http-support.32.o: http-support.c debug.h globals.h string.h ../config.h http-private.h http.h
|
||||
http-support.32.o: http-support.c md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h
|
||||
http-support.32.o: http-support.c language.h i18n.h transcode.h
|
||||
ipp.32.o: ipp.c http-private.h ../config.h http.h md5.h ipp-private.h ipp.h globals.h
|
||||
ipp.32.o: ipp.c string.h cups.h ppd.h array.h file.h language.h i18n.h transcode.h
|
||||
ipp.32.o: ipp.c debug.h
|
||||
ipp-support.32.o: ipp-support.c globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
ipp-support.32.o: ipp-support.c ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h
|
||||
ipp-support.32.o: ipp-support.c i18n.h transcode.h debug.h
|
||||
langprintf.32.o: langprintf.c globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
langprintf.32.o: langprintf.c ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h
|
||||
langprintf.32.o: langprintf.c i18n.h transcode.h
|
||||
language.32.o: language.c globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
language.32.o: language.c ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
|
||||
language.32.o: language.c transcode.h debug.h
|
||||
localize.32.o: localize.c globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
localize.32.o: localize.c ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
|
||||
localize.32.o: localize.c transcode.h debug.h
|
||||
mark.32.o: mark.c cups.h ipp.h http.h ppd.h array.h file.h language.h string.h
|
||||
mark.32.o: mark.c ../config.h debug.h
|
||||
md5.32.o: md5.c md5.h string.h ../config.h
|
||||
md5passwd.32.o: md5passwd.c http-private.h ../config.h http.h md5.h ipp-private.h ipp.h
|
||||
md5passwd.32.o: md5passwd.c string.h
|
||||
notify.32.o: notify.c globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
notify.32.o: notify.c ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
|
||||
notify.32.o: notify.c transcode.h
|
||||
options.32.o: options.c cups.h ipp.h http.h ppd.h array.h file.h language.h string.h
|
||||
options.32.o: options.c ../config.h debug.h
|
||||
page.32.o: page.c ppd.h array.h file.h string.h ../config.h
|
||||
ppd.32.o: ppd.c globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
ppd.32.o: ppd.c ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
|
||||
ppd.32.o: ppd.c transcode.h debug.h
|
||||
request.32.o: request.c globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
request.32.o: request.c ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
|
||||
request.32.o: request.c transcode.h debug.h
|
||||
sidechannel.32.o: sidechannel.c sidechannel.h string.h ../config.h
|
||||
snprintf.32.o: snprintf.c string.h ../config.h
|
||||
string.32.o: string.c array.h debug.h string.h ../config.h
|
||||
tempfile.32.o: tempfile.c globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
tempfile.32.o: tempfile.c ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
|
||||
tempfile.32.o: tempfile.c transcode.h debug.h
|
||||
transcode.32.o: transcode.c globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
transcode.32.o: transcode.c ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h
|
||||
transcode.32.o: transcode.c i18n.h transcode.h debug.h
|
||||
usersys.32.o: usersys.c http-private.h ../config.h http.h md5.h ipp-private.h ipp.h
|
||||
usersys.32.o: usersys.c globals.h string.h cups.h ppd.h array.h file.h language.h i18n.h
|
||||
usersys.32.o: usersys.c transcode.h debug.h
|
||||
util.32.o: util.c globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
util.32.o: util.c ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
|
||||
util.32.o: util.c transcode.h debug.h
|
||||
testadmin.32.o: testadmin.c adminutil.h cups.h ipp.h http.h ppd.h array.h file.h language.h
|
||||
testadmin.32.o: testadmin.c string.h ../config.h
|
||||
testarray.32.o: testarray.c ../cups/string.h ../config.h string.h array.h dir.h debug.h
|
||||
testcups.32.o: testcups.c cups.h ipp.h http.h ppd.h array.h file.h language.h
|
||||
testfile.32.o: testfile.c string.h ../config.h file.h debug.h
|
||||
testhttp.32.o: testhttp.c http.h string.h ../config.h
|
||||
testi18n.32.o: testi18n.c i18n.h transcode.h language.h array.h string.h ../config.h
|
||||
testipp.32.o: testipp.c ../cups/string.h ../config.h string.h ipp-private.h ipp.h http.h
|
||||
testlang.32.o: testlang.c i18n.h transcode.h language.h array.h string.h ../config.h
|
||||
testppd.32.o: testppd.c ../cups/string.h ../config.h string.h ppd.h array.h file.h
|
||||
# DO NOT DELETE
|
||||
|
||||
adminutil.64.o: adminutil.c adminutil.h cups.h ipp.h http.h ppd.h array.h file.h language.h
|
||||
adminutil.64.o: adminutil.c globals.h string.h ../config.h http-private.h md5.h
|
||||
adminutil.64.o: adminutil.c ipp-private.h i18n.h transcode.h debug.h
|
||||
array.64.o: array.c array.h string.h ../config.h debug.h
|
||||
attr.64.o: attr.c ppd.h array.h file.h debug.h string.h ../config.h
|
||||
auth.64.o: auth.c globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
auth.64.o: auth.c ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
|
||||
auth.64.o: auth.c transcode.h debug.h
|
||||
backchannel.64.o: backchannel.c cups.h ipp.h http.h ppd.h array.h file.h language.h
|
||||
backend.64.o: backend.c backend.h string.h ../config.h
|
||||
custom.64.o: custom.c globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
custom.64.o: custom.c ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
|
||||
custom.64.o: custom.c transcode.h debug.h
|
||||
dest.64.o: dest.c globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
dest.64.o: dest.c ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
|
||||
dest.64.o: dest.c transcode.h
|
||||
dir.64.o: dir.c dir.h string.h ../config.h debug.h
|
||||
emit.64.o: emit.c ppd.h array.h file.h string.h ../config.h debug.h
|
||||
encode.64.o: encode.c cups.h ipp.h http.h ppd.h array.h file.h language.h ipp-private.h
|
||||
encode.64.o: encode.c string.h ../config.h debug.h
|
||||
file.64.o: file.c http-private.h ../config.h http.h md5.h ipp-private.h ipp.h globals.h
|
||||
file.64.o: file.c string.h cups.h ppd.h array.h file.h language.h i18n.h transcode.h
|
||||
file.64.o: file.c debug.h
|
||||
getifaddrs.64.o: getifaddrs.c http-private.h ../config.h http.h md5.h ipp-private.h ipp.h
|
||||
getputfile.64.o: getputfile.c globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
getputfile.64.o: getputfile.c ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h
|
||||
getputfile.64.o: getputfile.c i18n.h transcode.h debug.h
|
||||
globals.64.o: globals.c http-private.h ../config.h http.h md5.h ipp-private.h ipp.h
|
||||
globals.64.o: globals.c globals.h string.h cups.h ppd.h array.h file.h language.h i18n.h
|
||||
globals.64.o: globals.c transcode.h debug.h
|
||||
http.64.o: http.c http-private.h ../config.h http.h md5.h ipp-private.h ipp.h globals.h
|
||||
http.64.o: http.c string.h cups.h ppd.h array.h file.h language.h i18n.h transcode.h
|
||||
http.64.o: http.c debug.h
|
||||
http-addr.64.o: http-addr.c http-private.h ../config.h http.h md5.h ipp-private.h ipp.h
|
||||
http-addr.64.o: http-addr.c globals.h string.h cups.h ppd.h array.h file.h language.h i18n.h
|
||||
http-addr.64.o: http-addr.c transcode.h debug.h
|
||||
http-addrlist.64.o: http-addrlist.c http-private.h ../config.h http.h md5.h ipp-private.h ipp.h
|
||||
http-addrlist.64.o: http-addrlist.c globals.h string.h cups.h ppd.h array.h file.h language.h
|
||||
http-addrlist.64.o: http-addrlist.c i18n.h transcode.h debug.h
|
||||
http-support.64.o: http-support.c debug.h globals.h string.h ../config.h http-private.h http.h
|
||||
http-support.64.o: http-support.c md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h
|
||||
http-support.64.o: http-support.c language.h i18n.h transcode.h
|
||||
ipp.64.o: ipp.c http-private.h ../config.h http.h md5.h ipp-private.h ipp.h globals.h
|
||||
ipp.64.o: ipp.c string.h cups.h ppd.h array.h file.h language.h i18n.h transcode.h
|
||||
ipp.64.o: ipp.c debug.h
|
||||
ipp-support.64.o: ipp-support.c globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
ipp-support.64.o: ipp-support.c ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h
|
||||
ipp-support.64.o: ipp-support.c i18n.h transcode.h debug.h
|
||||
langprintf.64.o: langprintf.c globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
langprintf.64.o: langprintf.c ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h
|
||||
langprintf.64.o: langprintf.c i18n.h transcode.h
|
||||
language.64.o: language.c globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
language.64.o: language.c ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
|
||||
language.64.o: language.c transcode.h debug.h
|
||||
localize.64.o: localize.c globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
localize.64.o: localize.c ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
|
||||
localize.64.o: localize.c transcode.h debug.h
|
||||
mark.64.o: mark.c cups.h ipp.h http.h ppd.h array.h file.h language.h string.h
|
||||
mark.64.o: mark.c ../config.h debug.h
|
||||
md5.64.o: md5.c md5.h string.h ../config.h
|
||||
md5passwd.64.o: md5passwd.c http-private.h ../config.h http.h md5.h ipp-private.h ipp.h
|
||||
md5passwd.64.o: md5passwd.c string.h
|
||||
notify.64.o: notify.c globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
notify.64.o: notify.c ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
|
||||
notify.64.o: notify.c transcode.h
|
||||
options.64.o: options.c cups.h ipp.h http.h ppd.h array.h file.h language.h string.h
|
||||
options.64.o: options.c ../config.h debug.h
|
||||
page.64.o: page.c ppd.h array.h file.h string.h ../config.h
|
||||
ppd.64.o: ppd.c globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
ppd.64.o: ppd.c ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
|
||||
ppd.64.o: ppd.c transcode.h debug.h
|
||||
request.64.o: request.c globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
request.64.o: request.c ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
|
||||
request.64.o: request.c transcode.h debug.h
|
||||
sidechannel.64.o: sidechannel.c sidechannel.h string.h ../config.h
|
||||
snprintf.64.o: snprintf.c string.h ../config.h
|
||||
string.64.o: string.c array.h debug.h string.h ../config.h
|
||||
tempfile.64.o: tempfile.c globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
tempfile.64.o: tempfile.c ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
|
||||
tempfile.64.o: tempfile.c transcode.h debug.h
|
||||
transcode.64.o: transcode.c globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
transcode.64.o: transcode.c ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h
|
||||
transcode.64.o: transcode.c i18n.h transcode.h debug.h
|
||||
usersys.64.o: usersys.c http-private.h ../config.h http.h md5.h ipp-private.h ipp.h
|
||||
usersys.64.o: usersys.c globals.h string.h cups.h ppd.h array.h file.h language.h i18n.h
|
||||
usersys.64.o: usersys.c transcode.h debug.h
|
||||
util.64.o: util.c globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
util.64.o: util.c ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
|
||||
util.64.o: util.c transcode.h debug.h
|
||||
testadmin.64.o: testadmin.c adminutil.h cups.h ipp.h http.h ppd.h array.h file.h language.h
|
||||
testadmin.64.o: testadmin.c string.h ../config.h
|
||||
testarray.64.o: testarray.c ../cups/string.h ../config.h string.h array.h dir.h debug.h
|
||||
testcups.64.o: testcups.c cups.h ipp.h http.h ppd.h array.h file.h language.h
|
||||
testfile.64.o: testfile.c string.h ../config.h file.h debug.h
|
||||
testhttp.64.o: testhttp.c http.h string.h ../config.h
|
||||
testi18n.64.o: testi18n.c i18n.h transcode.h language.h array.h string.h ../config.h
|
||||
testipp.64.o: testipp.c ../cups/string.h ../config.h string.h ipp-private.h ipp.h http.h
|
||||
testlang.64.o: testlang.c i18n.h transcode.h language.h array.h string.h ../config.h
|
||||
testppd.64.o: testppd.c ../cups/string.h ../config.h string.h ppd.h array.h file.h
|
||||
|
||||
+2
-3
@@ -91,7 +91,6 @@ HEADERS = \
|
||||
dir.h \
|
||||
file.h \
|
||||
http.h \
|
||||
i18n.h \
|
||||
ipp.h \
|
||||
language.h \
|
||||
ppd.h \
|
||||
@@ -145,8 +144,8 @@ depend:
|
||||
makedepend -Y -I.. -fDependencies.tmp $(OBJS:.o=.c) >/dev/null 2>&1
|
||||
$(RM) Dependencies
|
||||
cp Dependencies.tmp Dependencies
|
||||
sed -r -e '1,$$s/^([^.]+)\.o:/\1\.32.o: \1\.c /' Dependencies.tmp >>Dependencies
|
||||
sed -r -e '1,$$s/^([^.]+)\.o:/\1\.64.o: \1\.c /' Dependencies.tmp >>Dependencies
|
||||
sed -E -e '1,$$s/^([^.]+)\.o:/\1\.32.o: \1\.c /' Dependencies.tmp >>Dependencies
|
||||
sed -E -e '1,$$s/^([^.]+)\.o:/\1\.64.o: \1\.c /' Dependencies.tmp >>Dependencies
|
||||
$(RM) Dependencies.tmp
|
||||
|
||||
|
||||
|
||||
+20
-28
@@ -4,7 +4,7 @@
|
||||
* Administration utility API definitions for the Common UNIX Printing
|
||||
* System (CUPS).
|
||||
*
|
||||
* Copyright 2007 by Apple Inc.
|
||||
* Copyright 2007-2008 by Apple Inc.
|
||||
* Copyright 2001-2007 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -291,7 +291,7 @@ cupsAdminCreateWindowsPPD(
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
if (sscanf(line, "*%40s%*[ \t]%40[^/]", option, choice) != 2)
|
||||
if (sscanf(line, "*%40s%*[ \t]%40[^:/]", option, choice) != 2)
|
||||
{
|
||||
snprintf(line, sizeof(line),
|
||||
_cupsLangString(language,
|
||||
@@ -386,7 +386,7 @@ cupsAdminCreateWindowsPPD(
|
||||
{
|
||||
write_option(dstfp, jclorder ++, "cupsJobSheetsStart", "Start Banner",
|
||||
"job-sheets", suppattr, defattr, 0, 2);
|
||||
write_option(dstfp, jclorder ++, "cupsJobSheetsEnd", "End Banner",
|
||||
write_option(dstfp, jclorder, "cupsJobSheetsEnd", "End Banner",
|
||||
"job-sheets", suppattr, defattr, 1, 2);
|
||||
}
|
||||
|
||||
@@ -808,6 +808,9 @@ cupsAdminExportSamba(
|
||||
if (have_drivers == 0)
|
||||
{
|
||||
_cupsSetError(IPP_NOT_FOUND, message);
|
||||
|
||||
unlink(authfile);
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
@@ -956,9 +959,9 @@ _cupsAdminGetServerSettings(
|
||||
while (cupsFileGetConf(cupsd, line, sizeof(line), &value, &linenum))
|
||||
{
|
||||
if (!value && strncmp(line, "</", 2))
|
||||
continue;
|
||||
value = line + strlen(line);
|
||||
|
||||
if (!strcasecmp(line, "Port") || !strcasecmp(line, "Listen"))
|
||||
if ((!strcasecmp(line, "Port") || !strcasecmp(line, "Listen")) && value)
|
||||
{
|
||||
char *port; /* Pointer to port number, if any */
|
||||
|
||||
@@ -1014,7 +1017,7 @@ _cupsAdminGetServerSettings(
|
||||
{
|
||||
in_policy = 0;
|
||||
}
|
||||
else if (!strcasecmp(line, "<Limit") && in_policy)
|
||||
else if (!strcasecmp(line, "<Limit") && in_policy && value)
|
||||
{
|
||||
/*
|
||||
* See if the policy limit is for the Cancel-Job operation...
|
||||
@@ -1047,7 +1050,7 @@ _cupsAdminGetServerSettings(
|
||||
{
|
||||
cancel_policy = 0;
|
||||
}
|
||||
else if (!strcasecmp(line, "<Location"))
|
||||
else if (!strcasecmp(line, "<Location") && value)
|
||||
{
|
||||
in_admin_location = !strcasecmp(value, "/admin");
|
||||
in_location = 1;
|
||||
@@ -1057,7 +1060,7 @@ _cupsAdminGetServerSettings(
|
||||
in_admin_location = 0;
|
||||
in_location = 0;
|
||||
}
|
||||
else if (!strcasecmp(line, "Allow") && in_admin_location &&
|
||||
else if (!strcasecmp(line, "Allow") && value &&
|
||||
strcasecmp(value, "localhost") && strcasecmp(value, "127.0.0.1")
|
||||
#ifdef AF_LOCAL
|
||||
&& *value != '/'
|
||||
@@ -1067,9 +1070,9 @@ _cupsAdminGetServerSettings(
|
||||
#endif /* AF_INET6 */
|
||||
)
|
||||
{
|
||||
remote_admin = 1;
|
||||
|
||||
if (!strcasecmp(value, "all"))
|
||||
if (in_admin_location)
|
||||
remote_admin = 1;
|
||||
else if (!strcasecmp(value, "all"))
|
||||
remote_any = 1;
|
||||
}
|
||||
else if (line[0] != '<' && !in_location && !in_policy)
|
||||
@@ -1221,8 +1224,8 @@ _cupsAdminSetServerSettings(
|
||||
* Get the cupsd.conf file...
|
||||
*/
|
||||
|
||||
if ((status = get_cupsd_conf(http, cg, 0, cupsdconf, sizeof(cupsdconf),
|
||||
&remote)) == HTTP_OK)
|
||||
if (get_cupsd_conf(http, cg, 0, cupsdconf, sizeof(cupsdconf),
|
||||
&remote) == HTTP_OK)
|
||||
{
|
||||
if ((cupsd = cupsFileOpen(cupsdconf, "r")) == NULL)
|
||||
{
|
||||
@@ -1578,8 +1581,6 @@ _cupsAdminSetServerSettings(
|
||||
if (remote_admin)
|
||||
cupsFilePrintf(temp, " Allow %s\n",
|
||||
remote_any > 0 ? "all" : "@LOCAL");
|
||||
else
|
||||
cupsFilePuts(temp, " Allow localhost\n");
|
||||
}
|
||||
else if (in_conf_location && remote_admin >= 0)
|
||||
{
|
||||
@@ -1597,8 +1598,6 @@ _cupsAdminSetServerSettings(
|
||||
if (remote_admin)
|
||||
cupsFilePrintf(temp, " Allow %s\n",
|
||||
remote_any > 0 ? "all" : "@LOCAL");
|
||||
else
|
||||
cupsFilePuts(temp, " Allow localhost\n");
|
||||
}
|
||||
else if (in_root_location && (remote_admin >= 0 || share_printers >= 0))
|
||||
{
|
||||
@@ -1619,8 +1618,6 @@ _cupsAdminSetServerSettings(
|
||||
if (remote_admin > 0 || share_printers > 0)
|
||||
cupsFilePrintf(temp, " Allow %s\n",
|
||||
remote_any > 0 ? "all" : "@LOCAL");
|
||||
else
|
||||
cupsFilePuts(temp, " Allow localhost\n");
|
||||
}
|
||||
|
||||
in_admin_location = 0;
|
||||
@@ -1699,7 +1696,8 @@ _cupsAdminSetServerSettings(
|
||||
else if ((((in_admin_location || in_conf_location || in_root_location) &&
|
||||
remote_admin >= 0) ||
|
||||
(in_root_location && share_printers >= 0)) &&
|
||||
(!strcasecmp(line, "Allow") || !strcasecmp(line, "Deny") ||
|
||||
(((!strcasecmp(line, "Allow") || !strcasecmp(line, "Deny")) &&
|
||||
!strcasecmp(value, "@LOCAL")) ||
|
||||
!strcasecmp(line, "Order")))
|
||||
continue;
|
||||
else if (in_cancel_job == 2)
|
||||
@@ -1840,8 +1838,6 @@ _cupsAdminSetServerSettings(
|
||||
|
||||
if (remote_admin > 0 || share_printers > 0)
|
||||
cupsFilePrintf(temp, " Allow %s\n", remote_any > 0 ? "all" : "@LOCAL");
|
||||
else
|
||||
cupsFilePuts(temp, " Allow localhost\n");
|
||||
|
||||
cupsFilePuts(temp, "</Location>\n");
|
||||
}
|
||||
@@ -1858,8 +1854,6 @@ _cupsAdminSetServerSettings(
|
||||
|
||||
if (remote_admin)
|
||||
cupsFilePrintf(temp, " Allow %s\n", remote_any > 0 ? "all" : "@LOCAL");
|
||||
else
|
||||
cupsFilePuts(temp, " Allow localhost\n");
|
||||
|
||||
cupsFilePuts(temp, "</Location>\n");
|
||||
}
|
||||
@@ -1873,14 +1867,12 @@ _cupsAdminSetServerSettings(
|
||||
cupsFilePuts(temp, "# Restrict access to the configuration files...\n");
|
||||
|
||||
cupsFilePuts(temp, "<Location /admin/conf>\n"
|
||||
" AuthType Basic\n"
|
||||
" AuthType Default\n"
|
||||
" Require user @SYSTEM\n"
|
||||
" Order allow,deny\n");
|
||||
|
||||
if (remote_admin)
|
||||
cupsFilePrintf(temp, " Allow %s\n", remote_any > 0 ? "all" : "@LOCAL");
|
||||
else
|
||||
cupsFilePuts(temp, " Allow localhost\n");
|
||||
|
||||
cupsFilePuts(temp, "</Location>\n");
|
||||
}
|
||||
@@ -1911,7 +1903,7 @@ _cupsAdminSetServerSettings(
|
||||
"CUPS-Add-Class CUPS-Delete-Class "
|
||||
"CUPS-Accept-Jobs CUPS-Reject-Jobs "
|
||||
"CUPS-Set-Default CUPS-Add-Device CUPS-Delete-Device>\n"
|
||||
" AuthType Basic\n"
|
||||
" AuthType Default\n"
|
||||
" Require user @SYSTEM\n"
|
||||
" Order deny,allow\n"
|
||||
"</Limit>\n");
|
||||
|
||||
+41
-11
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Authentication functions for the Common UNIX Printing System (CUPS).
|
||||
*
|
||||
* Copyright 2007 by Apple Inc.
|
||||
* Copyright 2007-2008 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products.
|
||||
*
|
||||
* This file contains Kerberos support code, copyright 2006 by
|
||||
@@ -91,8 +91,7 @@ cupsDoAuthentication(http_t *http, /* I - HTTP connection to server */
|
||||
const char *password; /* Password string */
|
||||
char prompt[1024], /* Prompt for user */
|
||||
realm[HTTP_MAX_VALUE], /* realm="xyz" string */
|
||||
nonce[HTTP_MAX_VALUE], /* nonce="xyz" string */
|
||||
encode[2048]; /* Encoded username:password */
|
||||
nonce[HTTP_MAX_VALUE]; /* nonce="xyz" string */
|
||||
int localauth; /* Local authentication result */
|
||||
_cups_globals_t *cg; /* Global data */
|
||||
|
||||
@@ -271,8 +270,7 @@ cupsDoAuthentication(http_t *http, /* I - HTTP connection to server */
|
||||
|
||||
if (http->gssctx != GSS_C_NO_CONTEXT)
|
||||
{
|
||||
major_status = gss_delete_sec_context(&minor_status, &http->gssctx,
|
||||
GSS_C_NO_BUFFER);
|
||||
gss_delete_sec_context(&minor_status, &http->gssctx, GSS_C_NO_BUFFER);
|
||||
http->gssctx = GSS_C_NO_CONTEXT;
|
||||
}
|
||||
|
||||
@@ -293,7 +291,7 @@ cupsDoAuthentication(http_t *http, /* I - HTTP connection to server */
|
||||
{
|
||||
# ifdef DEBUG
|
||||
DEBUG_gss_printf(major_status, minor_status,
|
||||
"Unable to initialise security context");
|
||||
"Unable to initialize security context");
|
||||
# endif /* DEBUG */
|
||||
return (-1);
|
||||
}
|
||||
@@ -301,13 +299,39 @@ cupsDoAuthentication(http_t *http, /* I - HTTP connection to server */
|
||||
if (major_status == GSS_S_CONTINUE_NEEDED)
|
||||
DEBUG_gss_printf(major_status, minor_status, "Continuation needed!");
|
||||
|
||||
if (output_token.length)
|
||||
if (output_token.length > 0 && output_token.length <= 65536)
|
||||
{
|
||||
httpEncode64_2(encode, sizeof(encode), output_token.value,
|
||||
/*
|
||||
* Allocate the authorization string since Windows KDCs can have
|
||||
* arbitrarily large credentials...
|
||||
*/
|
||||
|
||||
int authsize = 10 + /* "Negotiate " */
|
||||
output_token.length * 4 / 3 + 1 + /* Base64 */
|
||||
1; /* nul */
|
||||
|
||||
httpSetAuthString(http, NULL, NULL);
|
||||
|
||||
if ((http->authstring = malloc(authsize)) == NULL)
|
||||
{
|
||||
http->authstring = http->_authstring;
|
||||
authsize = sizeof(http->_authstring);
|
||||
}
|
||||
|
||||
strcpy(http->authstring, "Negotiate ");
|
||||
httpEncode64_2(http->authstring + 10, authsize - 10, output_token.value,
|
||||
output_token.length);
|
||||
httpSetAuthString(http, "Negotiate", encode);
|
||||
|
||||
major_status = gss_release_buffer(&minor_status, &output_token);
|
||||
gss_release_buffer(&minor_status, &output_token);
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_printf(("cupsDoAuthentication: Kerberos credentials too large - "
|
||||
"%d bytes!\n", output_token.length));
|
||||
|
||||
gss_release_buffer(&minor_status, &output_token);
|
||||
|
||||
return (-1);
|
||||
}
|
||||
#endif /* HAVE_GSSAPI */
|
||||
}
|
||||
@@ -317,6 +341,9 @@ cupsDoAuthentication(http_t *http, /* I - HTTP connection to server */
|
||||
* Basic authentication...
|
||||
*/
|
||||
|
||||
char encode[256]; /* Base64 buffer */
|
||||
|
||||
|
||||
httpEncode64_2(encode, sizeof(encode), http->userpass,
|
||||
(int)strlen(http->userpass));
|
||||
httpSetAuthString(http, "Basic", encode);
|
||||
@@ -327,7 +354,8 @@ cupsDoAuthentication(http_t *http, /* I - HTTP connection to server */
|
||||
* Digest authentication...
|
||||
*/
|
||||
|
||||
char digest[1024]; /* Digest auth data */
|
||||
char encode[33], /* MD5 buffer */
|
||||
digest[1024]; /* Digest auth data */
|
||||
|
||||
|
||||
httpGetSubField(http, HTTP_FIELD_WWW_AUTHENTICATE, "realm", realm);
|
||||
@@ -425,6 +453,8 @@ cups_get_gss_creds(
|
||||
|
||||
snprintf(buf, sizeof(buf), "%s@%s", service_name, fqdn);
|
||||
|
||||
DEBUG_printf(("cups_get_gss_creds: Looking up %s...\n", buf));
|
||||
|
||||
token.value = buf;
|
||||
token.length = strlen(buf);
|
||||
server_name = GSS_C_NO_NAME;
|
||||
|
||||
+2
-2
@@ -59,10 +59,10 @@ extern "C" {
|
||||
* Constants...
|
||||
*/
|
||||
|
||||
# define CUPS_VERSION 1.0300
|
||||
# define CUPS_VERSION 1.0309
|
||||
# define CUPS_VERSION_MAJOR 1
|
||||
# define CUPS_VERSION_MINOR 3
|
||||
# define CUPS_VERSION_PATCH 0
|
||||
# define CUPS_VERSION_PATCH 9
|
||||
# define CUPS_DATE_ANY -1
|
||||
|
||||
|
||||
|
||||
+11
-3
@@ -4,7 +4,7 @@
|
||||
* User-defined destination (and option) support for the Common UNIX
|
||||
* Printing System (CUPS).
|
||||
*
|
||||
* Copyright 2007 by Apple Inc.
|
||||
* Copyright 2007-2008 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -89,7 +89,7 @@ cupsAddDest(const char *name, /* I - Destination name */
|
||||
if (!name || !dests)
|
||||
return (0);
|
||||
|
||||
if ((dest = cupsGetDest(name, instance, num_dests, *dests)) != NULL)
|
||||
if (cupsGetDest(name, instance, num_dests, *dests))
|
||||
return (num_dests);
|
||||
|
||||
/*
|
||||
@@ -331,7 +331,15 @@ cupsGetDests2(http_t *http, /* I - HTTP connection */
|
||||
*/
|
||||
|
||||
num_dests = cups_get_sdests(http, CUPS_GET_PRINTERS, num_dests, dests);
|
||||
num_dests = cups_get_sdests(http, CUPS_GET_CLASSES, num_dests, dests);
|
||||
if (cupsLastError() < IPP_REDIRECTION_OTHER_SITE)
|
||||
num_dests = cups_get_sdests(http, CUPS_GET_CLASSES, num_dests, dests);
|
||||
|
||||
if (cupsLastError() >= IPP_REDIRECTION_OTHER_SITE)
|
||||
{
|
||||
cupsFreeDests(num_dests, *dests);
|
||||
*dests = (cups_dest_t *)0;
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
* Make a copy of the "real" queues for a later sanity check...
|
||||
|
||||
+173
-25
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* PPD code emission routines for the Common UNIX Printing System (CUPS).
|
||||
*
|
||||
* Copyright 2007 by Apple Inc.
|
||||
* Copyright 2007-2008 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -18,19 +18,21 @@
|
||||
*
|
||||
* 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_handle_media() - Handle media selection...
|
||||
* ppd_sort() - Sort options by ordering numbers...
|
||||
* 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...
|
||||
* ppd_sort() - Sort options by ordering numbers...
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -54,6 +56,7 @@
|
||||
* Local functions...
|
||||
*/
|
||||
|
||||
static int ppd_compare_cparams(ppd_cparam_t *a, ppd_cparam_t *b);
|
||||
static void ppd_handle_media(ppd_file_t *ppd);
|
||||
static int ppd_sort(ppd_choice_t **c1, ppd_choice_t **c2);
|
||||
|
||||
@@ -106,15 +109,24 @@ ppdCollect2(ppd_file_t *ppd, /* I - PPD file data */
|
||||
DEBUG_printf(("ppdCollect2(ppd=%p, section=%d, min_order=%f, choices=%p)\n",
|
||||
ppd, section, min_order, choices));
|
||||
|
||||
if (ppd == NULL)
|
||||
if (!ppd || !choices)
|
||||
{
|
||||
if (choices)
|
||||
*choices = NULL;
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
* Allocate memory for up to 1000 selected choices...
|
||||
*/
|
||||
|
||||
count = 0;
|
||||
collect = calloc(sizeof(ppd_choice_t *), 1000);
|
||||
count = 0;
|
||||
if ((collect = calloc(sizeof(ppd_choice_t *), 1000)) == NULL)
|
||||
{
|
||||
*choices = NULL;
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
* Loop through all options and add choices as needed...
|
||||
@@ -466,7 +478,7 @@ ppdEmitJCLEnd(ppd_file_t *ppd, /* I - PPD file record */
|
||||
*/
|
||||
|
||||
fputs("\033%-12345X@PJL\n", fp);
|
||||
fputs("@PJL RDYMSG DISPLAY = \"READY\"\n", fp);
|
||||
fputs("@PJL RDYMSG DISPLAY = \"\"\n", fp);
|
||||
fputs(ppd->jcl_end + 9, fp);
|
||||
}
|
||||
else
|
||||
@@ -538,7 +550,40 @@ ppdEmitString(ppd_file_t *ppd, /* I - PPD file record */
|
||||
|
||||
for (i = 0, bufsize = 1; i < count; i ++)
|
||||
{
|
||||
if (section != PPD_ORDER_EXIT && section != PPD_ORDER_JCL)
|
||||
if (section == PPD_ORDER_JCL)
|
||||
{
|
||||
if (!strcasecmp(choices[i]->choice, "Custom") &&
|
||||
(coption = ppdFindCustomOption(ppd, choices[i]->option->keyword))
|
||||
!= NULL)
|
||||
{
|
||||
/*
|
||||
* Add space to account for custom parameter substitution...
|
||||
*/
|
||||
|
||||
for (cparam = (ppd_cparam_t *)cupsArrayFirst(coption->params);
|
||||
cparam;
|
||||
cparam = (ppd_cparam_t *)cupsArrayNext(coption->params))
|
||||
{
|
||||
switch (cparam->type)
|
||||
{
|
||||
case PPD_CUSTOM_CURVE :
|
||||
case PPD_CUSTOM_INVCURVE :
|
||||
case PPD_CUSTOM_POINTS :
|
||||
case PPD_CUSTOM_REAL :
|
||||
case PPD_CUSTOM_INT :
|
||||
bufsize += 10;
|
||||
break;
|
||||
|
||||
case PPD_CUSTOM_PASSCODE :
|
||||
case PPD_CUSTOM_PASSWORD :
|
||||
case PPD_CUSTOM_STRING :
|
||||
bufsize += strlen(cparam->current.custom_string);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (section != PPD_ORDER_EXIT)
|
||||
{
|
||||
bufsize += 3; /* [{\n */
|
||||
|
||||
@@ -617,7 +662,89 @@ ppdEmitString(ppd_file_t *ppd, /* I - PPD file record */
|
||||
*/
|
||||
|
||||
for (i = 0, bufptr = buffer; i < count; i ++, bufptr += strlen(bufptr))
|
||||
if (section != PPD_ORDER_EXIT && section != PPD_ORDER_JCL)
|
||||
if (section == PPD_ORDER_JCL)
|
||||
{
|
||||
if (!strcasecmp(choices[i]->choice, "Custom") &&
|
||||
(coption = ppdFindCustomOption(ppd, choices[i]->option->keyword))
|
||||
!= NULL)
|
||||
{
|
||||
/*
|
||||
* Handle substitutions in custom JCL options...
|
||||
*/
|
||||
|
||||
char *cptr; /* Pointer into code */
|
||||
int pnum; /* Parameter number */
|
||||
|
||||
|
||||
for (cptr = choices[i]->code; *cptr && bufptr < bufend;)
|
||||
{
|
||||
if (*cptr == '\\')
|
||||
{
|
||||
cptr ++;
|
||||
|
||||
if (isdigit(*cptr & 255))
|
||||
{
|
||||
/*
|
||||
* Substitute parameter...
|
||||
*/
|
||||
|
||||
pnum = *cptr++ - '0';
|
||||
while (isalnum(*cptr & 255))
|
||||
pnum = pnum * 10 + *cptr - '0';
|
||||
|
||||
for (cparam = (ppd_cparam_t *)cupsArrayFirst(coption->params);
|
||||
cparam;
|
||||
cparam = (ppd_cparam_t *)cupsArrayNext(coption->params))
|
||||
if (cparam->order == pnum)
|
||||
break;
|
||||
|
||||
if (cparam)
|
||||
{
|
||||
switch (cparam->type)
|
||||
{
|
||||
case PPD_CUSTOM_CURVE :
|
||||
case PPD_CUSTOM_INVCURVE :
|
||||
case PPD_CUSTOM_POINTS :
|
||||
case PPD_CUSTOM_REAL :
|
||||
bufptr = _cupsStrFormatd(bufptr, bufend,
|
||||
cparam->current.custom_real,
|
||||
loc);
|
||||
break;
|
||||
|
||||
case PPD_CUSTOM_INT :
|
||||
snprintf(bufptr, bufend - bufptr, "%d",
|
||||
cparam->current.custom_int);
|
||||
bufptr += strlen(bufptr);
|
||||
break;
|
||||
|
||||
case PPD_CUSTOM_PASSCODE :
|
||||
case PPD_CUSTOM_PASSWORD :
|
||||
case PPD_CUSTOM_STRING :
|
||||
strlcpy(bufptr, cparam->current.custom_string,
|
||||
bufend - bufptr);
|
||||
bufptr += strlen(bufptr);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (*cptr)
|
||||
*bufptr++ = *cptr++;
|
||||
}
|
||||
else
|
||||
*bufptr++ = *cptr++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* Otherwise just copy the option code directly...
|
||||
*/
|
||||
|
||||
strlcpy(bufptr, choices[i]->code, bufend - bufptr + 1);
|
||||
bufptr += strlen(bufptr);
|
||||
}
|
||||
}
|
||||
else if (section != PPD_ORDER_EXIT)
|
||||
{
|
||||
/*
|
||||
* Add wrapper commands to prevent printer errors for unsupported
|
||||
@@ -750,8 +877,7 @@ ppdEmitString(ppd_file_t *ppd, /* I - PPD file record */
|
||||
}
|
||||
}
|
||||
else if (!strcasecmp(choices[i]->choice, "Custom") &&
|
||||
(coption = ppdFindCustomOption(ppd,
|
||||
choices[i]->option->keyword))
|
||||
(coption = ppdFindCustomOption(ppd, choices[i]->option->keyword))
|
||||
!= NULL)
|
||||
{
|
||||
/*
|
||||
@@ -759,15 +885,23 @@ ppdEmitString(ppd_file_t *ppd, /* I - PPD file record */
|
||||
*/
|
||||
|
||||
const char *s; /* Pointer into string value */
|
||||
cups_array_t *params; /* Parameters in the correct output order */
|
||||
|
||||
|
||||
params = cupsArrayNew((cups_array_func_t)ppd_compare_cparams, NULL);
|
||||
|
||||
for (cparam = (ppd_cparam_t *)cupsArrayFirst(coption->params);
|
||||
cparam;
|
||||
cparam = (ppd_cparam_t *)cupsArrayNext(coption->params))
|
||||
cupsArrayAdd(params, cparam);
|
||||
|
||||
snprintf(bufptr, bufend - bufptr + 1,
|
||||
"%%%%BeginFeature: *Custom%s True\n", coption->keyword);
|
||||
bufptr += strlen(bufptr);
|
||||
|
||||
for (cparam = (ppd_cparam_t *)cupsArrayFirst(coption->params);
|
||||
for (cparam = (ppd_cparam_t *)cupsArrayFirst(params);
|
||||
cparam;
|
||||
cparam = (ppd_cparam_t *)cupsArrayNext(coption->params))
|
||||
cparam = (ppd_cparam_t *)cupsArrayNext(params))
|
||||
{
|
||||
switch (cparam->type)
|
||||
{
|
||||
@@ -805,6 +939,8 @@ ppdEmitString(ppd_file_t *ppd, /* I - PPD file record */
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
cupsArrayDelete(params);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -848,12 +984,24 @@ ppdEmitString(ppd_file_t *ppd, /* I - PPD file record */
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'ppd_compare_cparams()' - Compare the order of two custom parameters.
|
||||
*/
|
||||
|
||||
static int /* O - Result of comparison */
|
||||
ppd_compare_cparams(ppd_cparam_t *a, /* I - First parameter */
|
||||
ppd_cparam_t *b) /* I - Second parameter */
|
||||
{
|
||||
return (a->order - b->order);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'ppd_handle_media()' - Handle media selection...
|
||||
*/
|
||||
|
||||
static void
|
||||
ppd_handle_media(ppd_file_t *ppd)
|
||||
ppd_handle_media(ppd_file_t *ppd) /* I - PPD file */
|
||||
{
|
||||
ppd_choice_t *manual_feed, /* ManualFeed choice, if any */
|
||||
*input_slot, /* InputSlot choice, if any */
|
||||
|
||||
+155
-133
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Option encoding routines for the Common UNIX Printing System (CUPS).
|
||||
*
|
||||
* Copyright 2007 by Apple Inc.
|
||||
* Copyright 2007-2008 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -43,97 +43,100 @@
|
||||
|
||||
static const _ipp_option_t ipp_options[] =
|
||||
{
|
||||
{ "auth-info", IPP_TAG_TEXT, IPP_TAG_JOB },
|
||||
{ "auth-info-required", IPP_TAG_KEYWORD, IPP_TAG_PRINTER },
|
||||
{ "blackplot", IPP_TAG_BOOLEAN, IPP_TAG_JOB },
|
||||
{ "blackplot-default", IPP_TAG_BOOLEAN, IPP_TAG_PRINTER },
|
||||
{ "brightness", IPP_TAG_INTEGER, IPP_TAG_JOB },
|
||||
{ "brightness-default", IPP_TAG_INTEGER, IPP_TAG_PRINTER },
|
||||
{ "columns", IPP_TAG_INTEGER, IPP_TAG_JOB },
|
||||
{ "columns-default", IPP_TAG_INTEGER, IPP_TAG_PRINTER },
|
||||
{ "copies", IPP_TAG_INTEGER, IPP_TAG_JOB },
|
||||
{ "copies-default", IPP_TAG_INTEGER, IPP_TAG_PRINTER },
|
||||
{ "document-format", IPP_TAG_MIMETYPE, IPP_TAG_OPERATION },
|
||||
{ "document-format-default", IPP_TAG_MIMETYPE, IPP_TAG_PRINTER },
|
||||
{ "finishings", IPP_TAG_ENUM, IPP_TAG_JOB },
|
||||
{ "finishings-default", IPP_TAG_ENUM, IPP_TAG_PRINTER },
|
||||
{ "fitplot", IPP_TAG_BOOLEAN, IPP_TAG_JOB },
|
||||
{ "fitplot-default", IPP_TAG_BOOLEAN, IPP_TAG_PRINTER },
|
||||
{ "gamma", IPP_TAG_INTEGER, IPP_TAG_JOB },
|
||||
{ "gamma-default", IPP_TAG_INTEGER, IPP_TAG_PRINTER },
|
||||
{ "hue", IPP_TAG_INTEGER, IPP_TAG_JOB },
|
||||
{ "hue-default", IPP_TAG_INTEGER, IPP_TAG_PRINTER },
|
||||
{ "job-k-limit", IPP_TAG_INTEGER, IPP_TAG_JOB },
|
||||
{ "job-page-limit", IPP_TAG_INTEGER, IPP_TAG_JOB },
|
||||
{ "job-priority", IPP_TAG_INTEGER, IPP_TAG_JOB },
|
||||
{ "job-quota-period", IPP_TAG_INTEGER, IPP_TAG_JOB },
|
||||
{ "job-uuid", IPP_TAG_URI, IPP_TAG_JOB },
|
||||
{ "landscape", IPP_TAG_BOOLEAN, IPP_TAG_JOB },
|
||||
{ "media", IPP_TAG_KEYWORD, IPP_TAG_JOB },
|
||||
{ "mirror", IPP_TAG_BOOLEAN, IPP_TAG_JOB },
|
||||
{ "mirror-default", IPP_TAG_BOOLEAN, IPP_TAG_PRINTER },
|
||||
{ "natural-scaling", IPP_TAG_INTEGER, IPP_TAG_JOB },
|
||||
{ "natural-scaling-default", IPP_TAG_INTEGER, IPP_TAG_PRINTER },
|
||||
{ "notify-charset", IPP_TAG_CHARSET, IPP_TAG_SUBSCRIPTION },
|
||||
{ "notify-events", IPP_TAG_KEYWORD, IPP_TAG_SUBSCRIPTION },
|
||||
{ "notify-events-default", IPP_TAG_KEYWORD, IPP_TAG_PRINTER },
|
||||
{ "notify-lease-duration", IPP_TAG_INTEGER, IPP_TAG_SUBSCRIPTION },
|
||||
{ "notify-lease-duration-default", IPP_TAG_INTEGER, IPP_TAG_PRINTER },
|
||||
{ "notify-natural-language", IPP_TAG_LANGUAGE, IPP_TAG_SUBSCRIPTION },
|
||||
{ "notify-pull-method", IPP_TAG_KEYWORD, IPP_TAG_SUBSCRIPTION },
|
||||
{ "notify-recipient-uri", IPP_TAG_URI, IPP_TAG_SUBSCRIPTION },
|
||||
{ "notify-time-interval", IPP_TAG_INTEGER, IPP_TAG_SUBSCRIPTION },
|
||||
{ "notify-user-data", IPP_TAG_STRING, IPP_TAG_SUBSCRIPTION },
|
||||
{ "number-up", IPP_TAG_INTEGER, IPP_TAG_JOB },
|
||||
{ "number-up-default", IPP_TAG_INTEGER, IPP_TAG_PRINTER },
|
||||
{ "orientation-requested", IPP_TAG_ENUM, IPP_TAG_JOB },
|
||||
{ "orientation-requested-default", IPP_TAG_ENUM, IPP_TAG_PRINTER },
|
||||
{ "page-bottom", IPP_TAG_INTEGER, IPP_TAG_JOB },
|
||||
{ "page-bottom-default", IPP_TAG_INTEGER, IPP_TAG_PRINTER },
|
||||
{ "page-left", IPP_TAG_INTEGER, IPP_TAG_JOB },
|
||||
{ "page-left-default", IPP_TAG_INTEGER, IPP_TAG_PRINTER },
|
||||
{ "page-ranges", IPP_TAG_RANGE, IPP_TAG_JOB },
|
||||
{ "page-ranges-default", IPP_TAG_RANGE, IPP_TAG_PRINTER },
|
||||
{ "page-right", IPP_TAG_INTEGER, IPP_TAG_JOB },
|
||||
{ "page-right-default", IPP_TAG_INTEGER, IPP_TAG_PRINTER },
|
||||
{ "page-top", IPP_TAG_INTEGER, IPP_TAG_JOB },
|
||||
{ "page-top-default", IPP_TAG_INTEGER, IPP_TAG_PRINTER },
|
||||
{ "penwidth", IPP_TAG_INTEGER, IPP_TAG_JOB },
|
||||
{ "penwidth-default", IPP_TAG_INTEGER, IPP_TAG_PRINTER },
|
||||
{ "ppi", IPP_TAG_INTEGER, IPP_TAG_JOB },
|
||||
{ "ppi-default", IPP_TAG_INTEGER, IPP_TAG_PRINTER },
|
||||
{ "prettyprint", IPP_TAG_BOOLEAN, IPP_TAG_JOB },
|
||||
{ "prettyprint-default", IPP_TAG_BOOLEAN, IPP_TAG_PRINTER },
|
||||
{ "print-quality", IPP_TAG_ENUM, IPP_TAG_JOB },
|
||||
{ "print-quality-default", IPP_TAG_ENUM, IPP_TAG_PRINTER },
|
||||
{ "printer-error-policy", IPP_TAG_NAME, IPP_TAG_PRINTER },
|
||||
{ "printer-info", IPP_TAG_TEXT, IPP_TAG_PRINTER },
|
||||
{ "printer-is-accepting-jobs",IPP_TAG_BOOLEAN, IPP_TAG_PRINTER },
|
||||
{ "printer-is-shared", IPP_TAG_BOOLEAN, IPP_TAG_PRINTER },
|
||||
{ "printer-location", IPP_TAG_TEXT, IPP_TAG_PRINTER },
|
||||
{ "printer-make-and-model", IPP_TAG_TEXT, IPP_TAG_PRINTER },
|
||||
{ "printer-more-info", IPP_TAG_URI, IPP_TAG_PRINTER },
|
||||
{ "printer-op-policy", IPP_TAG_NAME, IPP_TAG_PRINTER },
|
||||
{ "printer-resolution", IPP_TAG_RESOLUTION, IPP_TAG_JOB },
|
||||
{ "printer-state", IPP_TAG_ENUM, IPP_TAG_PRINTER },
|
||||
{ "printer-state-change-time",IPP_TAG_INTEGER, IPP_TAG_PRINTER },
|
||||
{ "printer-state-reasons", IPP_TAG_KEYWORD, IPP_TAG_PRINTER },
|
||||
{ "printer-type", IPP_TAG_ENUM, IPP_TAG_PRINTER },
|
||||
{ "printer-uri", IPP_TAG_URI, IPP_TAG_OPERATION },
|
||||
{ "queued-job-count", IPP_TAG_INTEGER, IPP_TAG_PRINTER },
|
||||
{ "raw", IPP_TAG_MIMETYPE, IPP_TAG_OPERATION },
|
||||
{ "requesting-user-name-allowed", IPP_TAG_NAME, IPP_TAG_PRINTER },
|
||||
{ "requesting-user-name-denied", IPP_TAG_NAME, IPP_TAG_PRINTER },
|
||||
{ "resolution", IPP_TAG_RESOLUTION, IPP_TAG_JOB },
|
||||
{ "resolution-default", IPP_TAG_RESOLUTION, IPP_TAG_PRINTER },
|
||||
{ "saturation", IPP_TAG_INTEGER, IPP_TAG_JOB },
|
||||
{ "saturation-default", IPP_TAG_INTEGER, IPP_TAG_PRINTER },
|
||||
{ "scaling", IPP_TAG_INTEGER, IPP_TAG_JOB },
|
||||
{ "scaling-default", IPP_TAG_INTEGER, IPP_TAG_PRINTER },
|
||||
{ "sides", IPP_TAG_KEYWORD, IPP_TAG_JOB },
|
||||
{ "sides-default", IPP_TAG_KEYWORD, IPP_TAG_PRINTER },
|
||||
{ "wrap", IPP_TAG_BOOLEAN, IPP_TAG_JOB },
|
||||
{ "wrap-default", IPP_TAG_BOOLEAN, IPP_TAG_PRINTER }
|
||||
{ 1, "auth-info", IPP_TAG_TEXT, IPP_TAG_JOB },
|
||||
{ 1, "auth-info-required", IPP_TAG_KEYWORD, IPP_TAG_PRINTER },
|
||||
{ 0, "blackplot", IPP_TAG_BOOLEAN, IPP_TAG_JOB },
|
||||
{ 0, "blackplot-default", IPP_TAG_BOOLEAN, IPP_TAG_PRINTER },
|
||||
{ 0, "brightness", IPP_TAG_INTEGER, IPP_TAG_JOB },
|
||||
{ 0, "brightness-default", IPP_TAG_INTEGER, IPP_TAG_PRINTER },
|
||||
{ 0, "columns", IPP_TAG_INTEGER, IPP_TAG_JOB },
|
||||
{ 0, "columns-default", IPP_TAG_INTEGER, IPP_TAG_PRINTER },
|
||||
{ 0, "copies", IPP_TAG_INTEGER, IPP_TAG_JOB },
|
||||
{ 0, "copies-default", IPP_TAG_INTEGER, IPP_TAG_PRINTER },
|
||||
{ 0, "document-format", IPP_TAG_MIMETYPE, IPP_TAG_OPERATION },
|
||||
{ 0, "document-format-default", IPP_TAG_MIMETYPE, IPP_TAG_PRINTER },
|
||||
{ 1, "finishings", IPP_TAG_ENUM, IPP_TAG_JOB },
|
||||
{ 1, "finishings-default", IPP_TAG_ENUM, IPP_TAG_PRINTER },
|
||||
{ 0, "fitplot", IPP_TAG_BOOLEAN, IPP_TAG_JOB },
|
||||
{ 0, "fitplot-default", IPP_TAG_BOOLEAN, IPP_TAG_PRINTER },
|
||||
{ 0, "gamma", IPP_TAG_INTEGER, IPP_TAG_JOB },
|
||||
{ 0, "gamma-default", IPP_TAG_INTEGER, IPP_TAG_PRINTER },
|
||||
{ 0, "hue", IPP_TAG_INTEGER, IPP_TAG_JOB },
|
||||
{ 0, "hue-default", IPP_TAG_INTEGER, IPP_TAG_PRINTER },
|
||||
{ 0, "job-k-limit", IPP_TAG_INTEGER, IPP_TAG_JOB },
|
||||
{ 0, "job-page-limit", IPP_TAG_INTEGER, IPP_TAG_JOB },
|
||||
{ 0, "job-priority", IPP_TAG_INTEGER, IPP_TAG_JOB },
|
||||
{ 0, "job-quota-period", IPP_TAG_INTEGER, IPP_TAG_JOB },
|
||||
{ 1, "job-sheets", IPP_TAG_NAME, IPP_TAG_JOB },
|
||||
{ 1, "job-sheets-default", IPP_TAG_NAME, IPP_TAG_PRINTER },
|
||||
{ 0, "job-uuid", IPP_TAG_URI, IPP_TAG_JOB },
|
||||
{ 0, "landscape", IPP_TAG_BOOLEAN, IPP_TAG_JOB },
|
||||
{ 1, "media", IPP_TAG_KEYWORD, IPP_TAG_JOB },
|
||||
{ 0, "mirror", IPP_TAG_BOOLEAN, IPP_TAG_JOB },
|
||||
{ 0, "mirror-default", IPP_TAG_BOOLEAN, IPP_TAG_PRINTER },
|
||||
{ 0, "natural-scaling", IPP_TAG_INTEGER, IPP_TAG_JOB },
|
||||
{ 0, "natural-scaling-default", IPP_TAG_INTEGER, IPP_TAG_PRINTER },
|
||||
{ 0, "notify-charset", IPP_TAG_CHARSET, IPP_TAG_SUBSCRIPTION },
|
||||
{ 1, "notify-events", IPP_TAG_KEYWORD, IPP_TAG_SUBSCRIPTION },
|
||||
{ 1, "notify-events-default", IPP_TAG_KEYWORD, IPP_TAG_PRINTER },
|
||||
{ 0, "notify-lease-duration", IPP_TAG_INTEGER, IPP_TAG_SUBSCRIPTION },
|
||||
{ 0, "notify-lease-duration-default", IPP_TAG_INTEGER, IPP_TAG_PRINTER },
|
||||
{ 0, "notify-natural-language", IPP_TAG_LANGUAGE, IPP_TAG_SUBSCRIPTION },
|
||||
{ 0, "notify-pull-method", IPP_TAG_KEYWORD, IPP_TAG_SUBSCRIPTION },
|
||||
{ 0, "notify-recipient-uri", IPP_TAG_URI, IPP_TAG_SUBSCRIPTION },
|
||||
{ 0, "notify-time-interval", IPP_TAG_INTEGER, IPP_TAG_SUBSCRIPTION },
|
||||
{ 0, "notify-user-data", IPP_TAG_STRING, IPP_TAG_SUBSCRIPTION },
|
||||
{ 0, "number-up", IPP_TAG_INTEGER, IPP_TAG_JOB },
|
||||
{ 0, "number-up-default", IPP_TAG_INTEGER, IPP_TAG_PRINTER },
|
||||
{ 0, "orientation-requested", IPP_TAG_ENUM, IPP_TAG_JOB },
|
||||
{ 0, "orientation-requested-default", IPP_TAG_ENUM, IPP_TAG_PRINTER },
|
||||
{ 0, "page-bottom", IPP_TAG_INTEGER, IPP_TAG_JOB },
|
||||
{ 0, "page-bottom-default", IPP_TAG_INTEGER, IPP_TAG_PRINTER },
|
||||
{ 0, "page-left", IPP_TAG_INTEGER, IPP_TAG_JOB },
|
||||
{ 0, "page-left-default", IPP_TAG_INTEGER, IPP_TAG_PRINTER },
|
||||
{ 1, "page-ranges", IPP_TAG_RANGE, IPP_TAG_JOB },
|
||||
{ 1, "page-ranges-default", IPP_TAG_RANGE, IPP_TAG_PRINTER },
|
||||
{ 0, "page-right", IPP_TAG_INTEGER, IPP_TAG_JOB },
|
||||
{ 0, "page-right-default", IPP_TAG_INTEGER, IPP_TAG_PRINTER },
|
||||
{ 0, "page-top", IPP_TAG_INTEGER, IPP_TAG_JOB },
|
||||
{ 0, "page-top-default", IPP_TAG_INTEGER, IPP_TAG_PRINTER },
|
||||
{ 0, "penwidth", IPP_TAG_INTEGER, IPP_TAG_JOB },
|
||||
{ 0, "penwidth-default", IPP_TAG_INTEGER, IPP_TAG_PRINTER },
|
||||
{ 0, "port-monitor", IPP_TAG_NAME, IPP_TAG_PRINTER },
|
||||
{ 0, "ppi", IPP_TAG_INTEGER, IPP_TAG_JOB },
|
||||
{ 0, "ppi-default", IPP_TAG_INTEGER, IPP_TAG_PRINTER },
|
||||
{ 0, "prettyprint", IPP_TAG_BOOLEAN, IPP_TAG_JOB },
|
||||
{ 0, "prettyprint-default", IPP_TAG_BOOLEAN, IPP_TAG_PRINTER },
|
||||
{ 0, "print-quality", IPP_TAG_ENUM, IPP_TAG_JOB },
|
||||
{ 0, "print-quality-default", IPP_TAG_ENUM, IPP_TAG_PRINTER },
|
||||
{ 0, "printer-error-policy", IPP_TAG_NAME, IPP_TAG_PRINTER },
|
||||
{ 0, "printer-info", IPP_TAG_TEXT, IPP_TAG_PRINTER },
|
||||
{ 0, "printer-is-accepting-jobs", IPP_TAG_BOOLEAN, IPP_TAG_PRINTER },
|
||||
{ 0, "printer-is-shared", IPP_TAG_BOOLEAN, IPP_TAG_PRINTER },
|
||||
{ 0, "printer-location", IPP_TAG_TEXT, IPP_TAG_PRINTER },
|
||||
{ 0, "printer-make-and-model", IPP_TAG_TEXT, IPP_TAG_PRINTER },
|
||||
{ 0, "printer-more-info", IPP_TAG_URI, IPP_TAG_PRINTER },
|
||||
{ 0, "printer-op-policy", IPP_TAG_NAME, IPP_TAG_PRINTER },
|
||||
{ 0, "printer-resolution", IPP_TAG_RESOLUTION, IPP_TAG_JOB },
|
||||
{ 0, "printer-state", IPP_TAG_ENUM, IPP_TAG_PRINTER },
|
||||
{ 0, "printer-state-change-time", IPP_TAG_INTEGER, IPP_TAG_PRINTER },
|
||||
{ 1, "printer-state-reasons", IPP_TAG_KEYWORD, IPP_TAG_PRINTER },
|
||||
{ 0, "printer-type", IPP_TAG_ENUM, IPP_TAG_PRINTER },
|
||||
{ 0, "printer-uri", IPP_TAG_URI, IPP_TAG_OPERATION },
|
||||
{ 0, "queued-job-count", IPP_TAG_INTEGER, IPP_TAG_PRINTER },
|
||||
{ 0, "raw", IPP_TAG_MIMETYPE, IPP_TAG_OPERATION },
|
||||
{ 1, "requesting-user-name-allowed", IPP_TAG_NAME, IPP_TAG_PRINTER },
|
||||
{ 1, "requesting-user-name-denied", IPP_TAG_NAME, IPP_TAG_PRINTER },
|
||||
{ 0, "resolution", IPP_TAG_RESOLUTION, IPP_TAG_JOB },
|
||||
{ 0, "resolution-default", IPP_TAG_RESOLUTION, IPP_TAG_PRINTER },
|
||||
{ 0, "saturation", IPP_TAG_INTEGER, IPP_TAG_JOB },
|
||||
{ 0, "saturation-default", IPP_TAG_INTEGER, IPP_TAG_PRINTER },
|
||||
{ 0, "scaling", IPP_TAG_INTEGER, IPP_TAG_JOB },
|
||||
{ 0, "scaling-default", IPP_TAG_INTEGER, IPP_TAG_PRINTER },
|
||||
{ 0, "sides", IPP_TAG_KEYWORD, IPP_TAG_JOB },
|
||||
{ 0, "sides-default", IPP_TAG_KEYWORD, IPP_TAG_PRINTER },
|
||||
{ 0, "wrap", IPP_TAG_BOOLEAN, IPP_TAG_JOB },
|
||||
{ 0, "wrap-default", IPP_TAG_BOOLEAN, IPP_TAG_PRINTER }
|
||||
};
|
||||
|
||||
|
||||
@@ -191,7 +194,8 @@ cupsEncodeOptions2(
|
||||
char *s, /* Pointer into option value */
|
||||
*val, /* Pointer to option value */
|
||||
*copy, /* Copy of option value */
|
||||
*sep; /* Option separator */
|
||||
*sep, /* Option separator */
|
||||
quote; /* Quote character */
|
||||
ipp_attribute_t *attr; /* IPP attribute */
|
||||
ipp_tag_t value_tag; /* IPP value tag */
|
||||
cups_option_t *option; /* Current option */
|
||||
@@ -283,41 +287,28 @@ cupsEncodeOptions2(
|
||||
* Count the number of values...
|
||||
*/
|
||||
|
||||
for (count = 1, sep = option->value; *sep; sep ++)
|
||||
if (match && match->multivalue)
|
||||
{
|
||||
if (*sep == '\'')
|
||||
for (count = 1, sep = option->value, quote = 0; *sep; sep ++)
|
||||
{
|
||||
/*
|
||||
* Skip quoted option value...
|
||||
*/
|
||||
if (*sep == quote)
|
||||
quote = 0;
|
||||
else if (!quote && (*sep == '\'' || *sep == '\"'))
|
||||
{
|
||||
/*
|
||||
* Skip quoted option value...
|
||||
*/
|
||||
|
||||
sep ++;
|
||||
|
||||
while (*sep && *sep != '\'')
|
||||
quote = *sep++;
|
||||
}
|
||||
else if (*sep == ',' && !quote)
|
||||
count ++;
|
||||
else if (*sep == '\\' && sep[1])
|
||||
sep ++;
|
||||
|
||||
if (!*sep)
|
||||
sep --;
|
||||
}
|
||||
else if (*sep == '\"')
|
||||
{
|
||||
/*
|
||||
* Skip quoted option value...
|
||||
*/
|
||||
|
||||
sep ++;
|
||||
|
||||
while (*sep && *sep != '\"')
|
||||
sep ++;
|
||||
|
||||
if (!*sep)
|
||||
sep --;
|
||||
}
|
||||
else if (*sep == ',')
|
||||
count ++;
|
||||
else if (*sep == '\\' && sep[1])
|
||||
sep ++;
|
||||
}
|
||||
else
|
||||
count = 1;
|
||||
|
||||
DEBUG_printf(("cupsEncodeOptions2: option = \'%s\', count = %d\n",
|
||||
option->name, count));
|
||||
@@ -389,16 +380,47 @@ cupsEncodeOptions2(
|
||||
* Scan the value string for values...
|
||||
*/
|
||||
|
||||
for (j = 0; j < count; val = sep, j ++)
|
||||
for (j = 0, sep = val; j < count; val = sep, j ++)
|
||||
{
|
||||
/*
|
||||
* Find the end of this value and mark it if needed...
|
||||
*/
|
||||
|
||||
if ((sep = strchr(val, ',')) != NULL)
|
||||
*sep++ = '\0';
|
||||
else
|
||||
sep = val + strlen(val);
|
||||
if (count > 1)
|
||||
{
|
||||
for (quote = 0; *sep; sep ++)
|
||||
{
|
||||
if (*sep == quote)
|
||||
{
|
||||
/*
|
||||
* Finish quoted value...
|
||||
*/
|
||||
|
||||
quote = 0;
|
||||
}
|
||||
else if (!quote && (*sep == '\'' || *sep == '\"'))
|
||||
{
|
||||
/*
|
||||
* Handle quoted option value...
|
||||
*/
|
||||
|
||||
quote = *sep;
|
||||
}
|
||||
else if (*sep == ',' && count > 1)
|
||||
break;
|
||||
else if (*sep == '\\' && sep[1])
|
||||
{
|
||||
/*
|
||||
* Skip quoted character...
|
||||
*/
|
||||
|
||||
sep ++;
|
||||
}
|
||||
}
|
||||
|
||||
if (*sep == ',')
|
||||
*sep++ = '\0';
|
||||
}
|
||||
|
||||
/*
|
||||
* Copy the option value(s) over as needed by the type...
|
||||
@@ -412,7 +434,7 @@ cupsEncodeOptions2(
|
||||
* Integer/enumeration value...
|
||||
*/
|
||||
|
||||
attr->values[j].integer = strtol(val, &s, 0);
|
||||
attr->values[j].integer = strtol(val, &s, 10);
|
||||
|
||||
DEBUG_printf(("cupsEncodeOptions2: Added integer option value %d...\n",
|
||||
attr->values[j].integer));
|
||||
@@ -454,12 +476,12 @@ cupsEncodeOptions2(
|
||||
s = val;
|
||||
}
|
||||
else
|
||||
attr->values[j].range.lower = strtol(val, &s, 0);
|
||||
attr->values[j].range.lower = strtol(val, &s, 10);
|
||||
|
||||
if (*s == '-')
|
||||
{
|
||||
if (s[1])
|
||||
attr->values[j].range.upper = strtol(s + 1, NULL, 0);
|
||||
attr->values[j].range.upper = strtol(s + 1, NULL, 10);
|
||||
else
|
||||
attr->values[j].range.upper = 2147483647;
|
||||
}
|
||||
@@ -476,10 +498,10 @@ cupsEncodeOptions2(
|
||||
* Resolution...
|
||||
*/
|
||||
|
||||
attr->values[j].resolution.xres = strtol(val, &s, 0);
|
||||
attr->values[j].resolution.xres = strtol(val, &s, 10);
|
||||
|
||||
if (*s == 'x')
|
||||
attr->values[j].resolution.yres = strtol(s + 1, &s, 0);
|
||||
attr->values[j].resolution.yres = strtol(s + 1, &s, 10);
|
||||
else
|
||||
attr->values[j].resolution.yres = attr->values[j].resolution.xres;
|
||||
|
||||
@@ -498,7 +520,7 @@ cupsEncodeOptions2(
|
||||
*/
|
||||
|
||||
attr->values[j].unknown.length = (int)strlen(val);
|
||||
attr->values[j].unknown.data = _cupsStrAlloc(val);
|
||||
attr->values[j].unknown.data = strdup(val);
|
||||
|
||||
DEBUG_printf(("cupsEncodeOptions2: Added octet-string value \"%s\"...\n",
|
||||
attr->values[j].unknown.data));
|
||||
|
||||
+169
-85
@@ -110,7 +110,8 @@ struct _cups_file_s /**** CUPS file structure... ****/
|
||||
buf[4096], /* Buffer */
|
||||
*ptr, /* Pointer into buffer */
|
||||
*end; /* End of buffer data */
|
||||
off_t pos; /* File position for start of buffer */
|
||||
off_t pos, /* Position in file */
|
||||
bufpos; /* File position for start of buffer */
|
||||
|
||||
#ifdef HAVE_LIBZ
|
||||
z_stream stream; /* (De)compression stream */
|
||||
@@ -402,13 +403,14 @@ cupsFileFlush(cups_file_t *fp) /* I - CUPS file */
|
||||
|
||||
if (!fp || fp->mode != 'w')
|
||||
{
|
||||
DEBUG_puts(" Attempt to flush a read-only file...");
|
||||
DEBUG_puts("cupsFileFlush: Attempt to flush a read-only file...");
|
||||
return (-1);
|
||||
}
|
||||
|
||||
bytes = (ssize_t)(fp->ptr - fp->buf);
|
||||
|
||||
DEBUG_printf((" Flushing %ld bytes...\n", (long)bytes));
|
||||
DEBUG_printf(("cupsFileFlush: Flushing " CUPS_LLFMT " bytes...\n",
|
||||
CUPS_LLCAST bytes));
|
||||
|
||||
if (bytes > 0)
|
||||
{
|
||||
@@ -440,6 +442,8 @@ cupsFileGetChar(cups_file_t *fp) /* I - CUPS file */
|
||||
* Range check input...
|
||||
*/
|
||||
|
||||
DEBUG_printf(("cupsFileGetChar(fp=%p)\n", fp));
|
||||
|
||||
if (!fp || (fp->mode != 'r' && fp->mode != 's'))
|
||||
{
|
||||
DEBUG_puts("cupsFileGetChar: Bad arguments!");
|
||||
@@ -463,6 +467,10 @@ cupsFileGetChar(cups_file_t *fp) /* I - CUPS file */
|
||||
|
||||
DEBUG_printf(("cupsFileGetChar: Returning %d...\n", *(fp->ptr) & 255));
|
||||
|
||||
fp->pos ++;
|
||||
|
||||
DEBUG_printf(("cupsFileGetChar: pos=" CUPS_LLFMT "\n", CUPS_LLCAST fp->pos));
|
||||
|
||||
return (*(fp->ptr)++ & 255);
|
||||
}
|
||||
|
||||
@@ -485,6 +493,10 @@ cupsFileGetConf(cups_file_t *fp, /* I - CUPS file */
|
||||
* Range check input...
|
||||
*/
|
||||
|
||||
DEBUG_printf(("cupsFileGetConf(fp=%p, buf=%p, buflen=" CUPS_LLFMT
|
||||
", value=%p, linenum=%p)\n", fp, buf, CUPS_LLCAST buflen,
|
||||
value, linenum));
|
||||
|
||||
if (!fp || (fp->mode != 'r' && fp->mode != 's') ||
|
||||
!buf || buflen < 2 || !value)
|
||||
{
|
||||
@@ -623,6 +635,9 @@ cupsFileGetLine(cups_file_t *fp, /* I - File to read from */
|
||||
* Range check input...
|
||||
*/
|
||||
|
||||
DEBUG_printf(("cupsFileGetLine(fp=%p, buf=%p, buflen=" CUPS_LLFMT ")\n",
|
||||
fp, buf, CUPS_LLCAST buflen));
|
||||
|
||||
if (!fp || (fp->mode != 'r' && fp->mode != 's') || !buf || buflen < 3)
|
||||
return (0);
|
||||
|
||||
@@ -637,6 +652,7 @@ cupsFileGetLine(cups_file_t *fp, /* I - File to read from */
|
||||
break;
|
||||
|
||||
*ptr++ = ch = *(fp->ptr)++;
|
||||
fp->pos ++;
|
||||
|
||||
if (ch == '\r')
|
||||
{
|
||||
@@ -649,7 +665,10 @@ cupsFileGetLine(cups_file_t *fp, /* I - File to read from */
|
||||
break;
|
||||
|
||||
if (*(fp->ptr) == '\n')
|
||||
{
|
||||
*ptr++ = *(fp->ptr)++;
|
||||
fp->pos ++;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -665,6 +684,8 @@ cupsFileGetLine(cups_file_t *fp, /* I - File to read from */
|
||||
|
||||
*ptr = '\0';
|
||||
|
||||
DEBUG_printf(("cupsFileGetLine: pos=" CUPS_LLFMT "\n", CUPS_LLCAST fp->pos));
|
||||
|
||||
return (ptr - buf);
|
||||
}
|
||||
|
||||
@@ -687,6 +708,9 @@ cupsFileGets(cups_file_t *fp, /* I - CUPS file */
|
||||
* Range check input...
|
||||
*/
|
||||
|
||||
DEBUG_printf(("cupsFileGets(fp=%p, buf=%p, buflen=" CUPS_LLFMT ")\n", fp, buf,
|
||||
CUPS_LLCAST buflen));
|
||||
|
||||
if (!fp || (fp->mode != 'r' && fp->mode != 's') || !buf || buflen < 2)
|
||||
return (NULL);
|
||||
|
||||
@@ -706,6 +730,7 @@ cupsFileGets(cups_file_t *fp, /* I - CUPS file */
|
||||
}
|
||||
|
||||
ch = *(fp->ptr)++;
|
||||
fp->pos ++;
|
||||
|
||||
if (ch == '\r')
|
||||
{
|
||||
@@ -718,7 +743,10 @@ cupsFileGets(cups_file_t *fp, /* I - CUPS file */
|
||||
break;
|
||||
|
||||
if (*(fp->ptr) == '\n')
|
||||
fp->ptr ++;
|
||||
{
|
||||
fp->ptr ++;
|
||||
fp->pos ++;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -736,6 +764,8 @@ cupsFileGets(cups_file_t *fp, /* I - CUPS file */
|
||||
|
||||
*ptr = '\0';
|
||||
|
||||
DEBUG_printf(("cupsFileGets: pos=" CUPS_LLFMT "\n", CUPS_LLCAST fp->pos));
|
||||
|
||||
return (buf);
|
||||
}
|
||||
|
||||
@@ -801,7 +831,8 @@ cupsFileOpen(const char *filename, /* I - Name of file */
|
||||
*/
|
||||
|
||||
if (!filename || !mode ||
|
||||
(*mode != 'r' && *mode != 'w' && *mode != 'a' && *mode != 's'))
|
||||
(*mode != 'r' && *mode != 'w' && *mode != 'a' && *mode != 's') ||
|
||||
(*mode == 'a' && isdigit(mode[1] & 255)))
|
||||
return (NULL);
|
||||
|
||||
/*
|
||||
@@ -893,7 +924,8 @@ cupsFileOpenFd(int fd, /* I - File descriptor */
|
||||
*/
|
||||
|
||||
if (fd < 0 || !mode ||
|
||||
(*mode != 'r' && *mode != 'w' && *mode != 'a' && *mode != 's'))
|
||||
(*mode != 'r' && *mode != 'w' && *mode != 'a' && *mode != 's') ||
|
||||
(*mode == 'a' && isdigit(mode[1] & 255)))
|
||||
return (NULL);
|
||||
|
||||
/*
|
||||
@@ -911,8 +943,10 @@ cupsFileOpenFd(int fd, /* I - File descriptor */
|
||||
|
||||
switch (*mode)
|
||||
{
|
||||
case 'w' :
|
||||
case 'a' :
|
||||
fp->pos = lseek(fd, 0, SEEK_END);
|
||||
|
||||
case 'w' :
|
||||
fp->mode = 'w';
|
||||
fp->ptr = fp->buf;
|
||||
fp->end = fp->buf + sizeof(fp->buf);
|
||||
@@ -1039,7 +1073,16 @@ cupsFilePrintf(cups_file_t *fp, /* I - CUPS file */
|
||||
return (-1);
|
||||
|
||||
if (fp->mode == 's')
|
||||
return (cups_write(fp, buf, bytes));
|
||||
{
|
||||
if (cups_write(fp, buf, bytes) < 0)
|
||||
return (-1);
|
||||
|
||||
fp->pos += bytes;
|
||||
|
||||
DEBUG_printf(("cupsFilePrintf: pos=" CUPS_LLFMT "\n", CUPS_LLCAST fp->pos));
|
||||
|
||||
return (bytes);
|
||||
}
|
||||
|
||||
if ((fp->ptr + bytes) > fp->end)
|
||||
if (cupsFileFlush(fp))
|
||||
@@ -1047,6 +1090,8 @@ cupsFilePrintf(cups_file_t *fp, /* I - CUPS file */
|
||||
|
||||
fp->pos += bytes;
|
||||
|
||||
DEBUG_printf(("cupsFilePrintf: pos=" CUPS_LLFMT "\n", CUPS_LLCAST fp->pos));
|
||||
|
||||
if (bytes > sizeof(fp->buf))
|
||||
{
|
||||
#ifdef HAVE_LIBZ
|
||||
@@ -1109,6 +1154,8 @@ cupsFilePutChar(cups_file_t *fp, /* I - CUPS file */
|
||||
|
||||
fp->pos ++;
|
||||
|
||||
DEBUG_printf(("cupsFilePutChar: pos=" CUPS_LLFMT "\n", CUPS_LLCAST fp->pos));
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
@@ -1144,6 +1191,8 @@ cupsFilePuts(cups_file_t *fp, /* I - CUPS file */
|
||||
|
||||
fp->pos += bytes;
|
||||
|
||||
DEBUG_printf(("cupsFilePuts: pos=" CUPS_LLFMT "\n", CUPS_LLCAST fp->pos));
|
||||
|
||||
return (bytes);
|
||||
}
|
||||
|
||||
@@ -1153,6 +1202,8 @@ cupsFilePuts(cups_file_t *fp, /* I - CUPS file */
|
||||
|
||||
fp->pos += bytes;
|
||||
|
||||
DEBUG_printf(("cupsFilePuts: pos=" CUPS_LLFMT "\n", CUPS_LLCAST fp->pos));
|
||||
|
||||
if (bytes > sizeof(fp->buf))
|
||||
{
|
||||
#ifdef HAVE_LIBZ
|
||||
@@ -1184,8 +1235,8 @@ cupsFileRead(cups_file_t *fp, /* I - CUPS file */
|
||||
ssize_t count; /* Bytes read */
|
||||
|
||||
|
||||
DEBUG_printf(("cupsFileRead(fp=%p, buf=%p, bytes=%ld)\n", fp, buf,
|
||||
(long)bytes));
|
||||
DEBUG_printf(("cupsFileRead(fp=%p, buf=%p, bytes=" CUPS_LLFMT ")\n", fp, buf,
|
||||
CUPS_LLCAST bytes));
|
||||
|
||||
/*
|
||||
* Range check input...
|
||||
@@ -1207,7 +1258,8 @@ cupsFileRead(cups_file_t *fp, /* I - CUPS file */
|
||||
if (fp->ptr >= fp->end)
|
||||
if (cups_fill(fp) <= 0)
|
||||
{
|
||||
DEBUG_printf((" cups_fill() returned -1, total=%d\n", total));
|
||||
DEBUG_printf(("cupsFileRead: cups_fill() returned -1, total=" CUPS_LLFMT "\n",
|
||||
CUPS_LLCAST total));
|
||||
|
||||
if (total > 0)
|
||||
return ((ssize_t)total);
|
||||
@@ -1221,6 +1273,9 @@ cupsFileRead(cups_file_t *fp, /* I - CUPS file */
|
||||
|
||||
memcpy(buf, fp->ptr, count);
|
||||
fp->ptr += count;
|
||||
fp->pos += count;
|
||||
|
||||
DEBUG_printf(("cupsFileRead: pos=" CUPS_LLFMT "\n", CUPS_LLCAST fp->pos));
|
||||
|
||||
/*
|
||||
* Update the counts for the last read...
|
||||
@@ -1235,7 +1290,7 @@ cupsFileRead(cups_file_t *fp, /* I - CUPS file */
|
||||
* Return the total number of bytes read...
|
||||
*/
|
||||
|
||||
DEBUG_printf((" total=%d\n", total));
|
||||
DEBUG_printf(("cupsFileRead: total=%d\n", (int)total));
|
||||
|
||||
return ((ssize_t)total);
|
||||
}
|
||||
@@ -1252,6 +1307,9 @@ cupsFileRewind(cups_file_t *fp) /* I - CUPS file */
|
||||
* Range check input...
|
||||
*/
|
||||
|
||||
DEBUG_printf(("cupsFileRewind(fp=%p)\n", fp));
|
||||
DEBUG_printf(("cupsFileRewind: pos=" CUPS_LLFMT "\n", CUPS_LLCAST fp->pos));
|
||||
|
||||
if (!fp || fp->mode != 'r')
|
||||
return (-1);
|
||||
|
||||
@@ -1259,18 +1317,22 @@ cupsFileRewind(cups_file_t *fp) /* I - CUPS file */
|
||||
* Handle special cases...
|
||||
*/
|
||||
|
||||
if (fp->pos == 0)
|
||||
if (fp->bufpos == 0)
|
||||
{
|
||||
/*
|
||||
* No seeking necessary...
|
||||
*/
|
||||
|
||||
fp->pos = 0;
|
||||
|
||||
if (fp->ptr)
|
||||
{
|
||||
fp->ptr = fp->buf;
|
||||
fp->eof = 0;
|
||||
}
|
||||
|
||||
DEBUG_printf(("cupsFileRewind: pos=" CUPS_LLFMT "\n", CUPS_LLCAST fp->pos));
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
@@ -1288,10 +1350,13 @@ cupsFileRewind(cups_file_t *fp) /* I - CUPS file */
|
||||
|
||||
lseek(fp->fd, 0, SEEK_SET);
|
||||
|
||||
fp->pos = 0;
|
||||
fp->ptr = NULL;
|
||||
fp->end = NULL;
|
||||
fp->eof = 0;
|
||||
fp->bufpos = 0;
|
||||
fp->pos = 0;
|
||||
fp->ptr = NULL;
|
||||
fp->end = NULL;
|
||||
fp->eof = 0;
|
||||
|
||||
DEBUG_printf(("cupsFileRewind: pos=" CUPS_LLFMT "\n", CUPS_LLCAST fp->pos));
|
||||
|
||||
return (0);
|
||||
}
|
||||
@@ -1308,9 +1373,10 @@ cupsFileSeek(cups_file_t *fp, /* I - CUPS file */
|
||||
ssize_t bytes; /* Number bytes in buffer */
|
||||
|
||||
|
||||
DEBUG_printf(("cupsFileSeek(fp=%p, pos=" CUPS_LLFMT ")\n", fp, pos));
|
||||
DEBUG_printf((" fp->pos=" CUPS_LLFMT "\n", fp->pos));
|
||||
DEBUG_printf((" fp->ptr=%p, fp->end=%p\n", fp->ptr, fp->end));
|
||||
DEBUG_printf(("cupsFileSeek(fp=%p, pos=" CUPS_LLFMT ")\n", fp,
|
||||
CUPS_LLCAST pos));
|
||||
DEBUG_printf(("cupsFileSeek: fp->pos=" CUPS_LLFMT "\n", CUPS_LLCAST fp->pos));
|
||||
DEBUG_printf(("cupsFileSeek: fp->ptr=%p, fp->end=%p\n", fp->ptr, fp->end));
|
||||
|
||||
/*
|
||||
* Range check input...
|
||||
@@ -1326,19 +1392,22 @@ cupsFileSeek(cups_file_t *fp, /* I - CUPS file */
|
||||
if (pos == 0)
|
||||
return (cupsFileRewind(fp));
|
||||
|
||||
if (fp->pos == pos)
|
||||
if (fp->ptr)
|
||||
{
|
||||
/*
|
||||
* No seeking necessary...
|
||||
*/
|
||||
bytes = (ssize_t)(fp->end - fp->buf);
|
||||
|
||||
if (fp->ptr)
|
||||
if (pos >= fp->bufpos && pos < (fp->bufpos + bytes))
|
||||
{
|
||||
fp->ptr = fp->buf;
|
||||
fp->eof = 0;
|
||||
}
|
||||
/*
|
||||
* No seeking necessary...
|
||||
*/
|
||||
|
||||
return (pos);
|
||||
fp->pos = pos;
|
||||
fp->ptr = fp->buf + pos - fp->bufpos;
|
||||
fp->eof = 0;
|
||||
|
||||
return (pos);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef HAVE_LIBZ
|
||||
@@ -1354,26 +1423,20 @@ cupsFileSeek(cups_file_t *fp, /* I - CUPS file */
|
||||
#endif /* HAVE_LIBZ */
|
||||
|
||||
/*
|
||||
* Figure out the number of bytes in the current buffer, and then
|
||||
* see if we are outside of it...
|
||||
* Seek forwards or backwards...
|
||||
*/
|
||||
|
||||
if (fp->ptr)
|
||||
bytes = (ssize_t)(fp->end - fp->buf);
|
||||
else
|
||||
bytes = 0;
|
||||
|
||||
fp->eof = 0;
|
||||
|
||||
DEBUG_printf((" bytes=" CUPS_LLFMT "\n", CUPS_LLCAST bytes));
|
||||
DEBUG_printf(("cupsFileSeek: bytes=" CUPS_LLFMT "\n", CUPS_LLCAST bytes));
|
||||
|
||||
if (pos < fp->pos)
|
||||
if (pos < fp->bufpos)
|
||||
{
|
||||
/*
|
||||
* Need to seek backwards...
|
||||
*/
|
||||
|
||||
DEBUG_puts(" SEEK BACKWARDS");
|
||||
DEBUG_puts("cupsFileSeek: SEEK BACKWARDS");
|
||||
|
||||
#ifdef HAVE_LIBZ
|
||||
if (fp->compressed)
|
||||
@@ -1381,72 +1444,70 @@ cupsFileSeek(cups_file_t *fp, /* I - CUPS file */
|
||||
inflateEnd(&fp->stream);
|
||||
|
||||
lseek(fp->fd, 0, SEEK_SET);
|
||||
fp->pos = 0;
|
||||
fp->ptr = NULL;
|
||||
fp->end = NULL;
|
||||
fp->bufpos = 0;
|
||||
fp->pos = 0;
|
||||
fp->ptr = NULL;
|
||||
fp->end = NULL;
|
||||
|
||||
while ((bytes = cups_fill(fp)) > 0)
|
||||
if (pos >= fp->pos && pos < (fp->pos + bytes))
|
||||
if (pos >= fp->bufpos && pos < (fp->bufpos + bytes))
|
||||
break;
|
||||
|
||||
if (bytes <= 0)
|
||||
return (-1);
|
||||
|
||||
fp->ptr = fp->buf + pos - fp->pos;
|
||||
fp->ptr = fp->buf + pos - fp->bufpos;
|
||||
fp->pos = pos;
|
||||
}
|
||||
else
|
||||
#endif /* HAVE_LIBZ */
|
||||
{
|
||||
fp->pos = lseek(fp->fd, pos, SEEK_SET);
|
||||
fp->ptr = NULL;
|
||||
fp->end = NULL;
|
||||
fp->bufpos = lseek(fp->fd, pos, SEEK_SET);
|
||||
fp->pos = fp->bufpos;
|
||||
fp->ptr = NULL;
|
||||
fp->end = NULL;
|
||||
|
||||
DEBUG_printf((" lseek() returned %ld...\n", (long)fp->pos));
|
||||
DEBUG_printf(("cupsFileSeek: lseek() returned " CUPS_LLFMT "...\n",
|
||||
CUPS_LLCAST fp->pos));
|
||||
}
|
||||
}
|
||||
else if (pos >= (fp->pos + bytes))
|
||||
else
|
||||
{
|
||||
/*
|
||||
* Need to seek forwards...
|
||||
*/
|
||||
|
||||
DEBUG_puts(" SEEK FORWARDS");
|
||||
DEBUG_puts("cupsFileSeek: SEEK FORWARDS");
|
||||
|
||||
#ifdef HAVE_LIBZ
|
||||
if (fp->compressed)
|
||||
{
|
||||
while ((bytes = cups_fill(fp)) > 0)
|
||||
{
|
||||
if (pos >= fp->pos && pos < (fp->pos + bytes))
|
||||
if (pos >= fp->bufpos && pos < (fp->bufpos + bytes))
|
||||
break;
|
||||
}
|
||||
|
||||
if (bytes <= 0)
|
||||
return (-1);
|
||||
|
||||
fp->ptr = fp->buf + pos - fp->pos;
|
||||
fp->ptr = fp->buf + pos - fp->bufpos;
|
||||
fp->pos = pos;
|
||||
}
|
||||
else
|
||||
#endif /* HAVE_LIBZ */
|
||||
{
|
||||
fp->pos = lseek(fp->fd, pos, SEEK_SET);
|
||||
fp->ptr = NULL;
|
||||
fp->end = NULL;
|
||||
fp->bufpos = lseek(fp->fd, pos, SEEK_SET);
|
||||
fp->pos = fp->bufpos;
|
||||
fp->ptr = NULL;
|
||||
fp->end = NULL;
|
||||
|
||||
DEBUG_printf((" lseek() returned " CUPS_LLFMT "...\n", fp->pos));
|
||||
DEBUG_printf(("cupsFileSeek: lseek() returned " CUPS_LLFMT "...\n",
|
||||
CUPS_LLCAST fp->pos));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* Just reposition the current pointer, since we have the right
|
||||
* range...
|
||||
*/
|
||||
|
||||
DEBUG_puts(" SEEK INSIDE BUFFER");
|
||||
|
||||
fp->ptr = fp->buf + pos - fp->pos;
|
||||
}
|
||||
DEBUG_printf(("cupsFileSeek: pos=" CUPS_LLFMT "\n", CUPS_LLCAST fp->pos));
|
||||
|
||||
return (fp->pos);
|
||||
}
|
||||
@@ -1555,6 +1616,9 @@ cupsFileStdout(void)
|
||||
off_t /* O - File position */
|
||||
cupsFileTell(cups_file_t *fp) /* I - CUPS file */
|
||||
{
|
||||
DEBUG_printf(("cupsFileTell(fp=%p)\n", fp));
|
||||
DEBUG_printf(("cupsFileTell: pos=" CUPS_LLFMT "\n", CUPS_LLCAST fp->pos));
|
||||
|
||||
return (fp ? fp->pos : 0);
|
||||
}
|
||||
|
||||
@@ -1570,6 +1634,8 @@ cupsFileUnlock(cups_file_t *fp) /* I - File to lock */
|
||||
* Range check...
|
||||
*/
|
||||
|
||||
DEBUG_printf(("cupsFileUnlock(fp=%p)\n", fp));
|
||||
|
||||
if (!fp || fp->mode == 's')
|
||||
return (-1);
|
||||
|
||||
@@ -1598,6 +1664,9 @@ cupsFileWrite(cups_file_t *fp, /* I - CUPS file */
|
||||
* Range check input...
|
||||
*/
|
||||
|
||||
DEBUG_printf(("cupsFileWrite(fp=%p, buf=%p, bytes=" CUPS_LLFMT ")\n",
|
||||
fp, buf, CUPS_LLCAST bytes));
|
||||
|
||||
if (!fp || !buf || bytes < 0 || (fp->mode != 'w' && fp->mode != 's'))
|
||||
return (-1);
|
||||
|
||||
@@ -1615,6 +1684,8 @@ cupsFileWrite(cups_file_t *fp, /* I - CUPS file */
|
||||
|
||||
fp->pos += (off_t)bytes;
|
||||
|
||||
DEBUG_printf(("cupsFileWrite: pos=" CUPS_LLFMT "\n", CUPS_LLCAST fp->pos));
|
||||
|
||||
return ((ssize_t)bytes);
|
||||
}
|
||||
|
||||
@@ -1624,6 +1695,8 @@ cupsFileWrite(cups_file_t *fp, /* I - CUPS file */
|
||||
|
||||
fp->pos += (off_t)bytes;
|
||||
|
||||
DEBUG_printf(("cupsFileWrite: pos=" CUPS_LLFMT "\n", CUPS_LLCAST fp->pos));
|
||||
|
||||
if (bytes > sizeof(fp->buf))
|
||||
{
|
||||
#ifdef HAVE_LIBZ
|
||||
@@ -1652,8 +1725,8 @@ cups_compress(cups_file_t *fp, /* I - CUPS file */
|
||||
const char *buf, /* I - Buffer */
|
||||
size_t bytes) /* I - Number bytes */
|
||||
{
|
||||
DEBUG_printf(("cups_compress(fp=%p, buf=%p, bytes=%ld)\n", fp, buf,
|
||||
(long)bytes));
|
||||
DEBUG_printf(("cups_compress(fp=%p, buf=%p, bytes=" CUPS_LLFMT "\n", fp, buf,
|
||||
CUPS_LLCAST bytes));
|
||||
|
||||
/*
|
||||
* Update the CRC...
|
||||
@@ -1674,8 +1747,8 @@ cups_compress(cups_file_t *fp, /* I - CUPS file */
|
||||
* Flush the current buffer...
|
||||
*/
|
||||
|
||||
DEBUG_printf((" avail_in=%d, avail_out=%d\n", fp->stream.avail_in,
|
||||
fp->stream.avail_out));
|
||||
DEBUG_printf(("cups_compress: avail_in=%d, avail_out=%d\n",
|
||||
fp->stream.avail_in, fp->stream.avail_out));
|
||||
|
||||
if (fp->stream.avail_out < (int)(sizeof(fp->cbuf) / 8))
|
||||
{
|
||||
@@ -1703,25 +1776,22 @@ cups_fill(cups_file_t *fp) /* I - CUPS file */
|
||||
{
|
||||
ssize_t bytes; /* Number of bytes read */
|
||||
#ifdef HAVE_LIBZ
|
||||
int status; /* Decompression status */
|
||||
const unsigned char *ptr, /* Pointer into buffer */
|
||||
*end; /* End of buffer */
|
||||
#endif /* HAVE_LIBZ */
|
||||
|
||||
|
||||
DEBUG_printf(("cups_fill(fp=%p)\n", fp));
|
||||
DEBUG_printf((" fp->ptr=%p, fp->end=%p, fp->buf=%p, "
|
||||
"fp->pos=" CUPS_LLFMT ", fp->eof=%d\n",
|
||||
fp->ptr, fp->end, fp->buf, fp->pos, fp->eof));
|
||||
|
||||
/*
|
||||
* Update the "pos" element as needed...
|
||||
*/
|
||||
DEBUG_printf(("cups_fill: fp->ptr=%p, fp->end=%p, fp->buf=%p, "
|
||||
"fp->bufpos=" CUPS_LLFMT ", fp->eof=%d\n",
|
||||
fp->ptr, fp->end, fp->buf, CUPS_LLCAST fp->bufpos, fp->eof));
|
||||
|
||||
if (fp->ptr && fp->end)
|
||||
fp->pos += (off_t)(fp->end - fp->buf);
|
||||
fp->bufpos += fp->end - fp->buf;
|
||||
|
||||
#ifdef HAVE_LIBZ
|
||||
DEBUG_printf((" fp->compressed=%d\n", fp->compressed));
|
||||
DEBUG_printf(("cups_fill: fp->compressed=%d\n", fp->compressed));
|
||||
|
||||
while (!fp->ptr || fp->compressed)
|
||||
{
|
||||
@@ -1749,7 +1819,7 @@ cups_fill(cups_file_t *fp) /* I - CUPS file */
|
||||
* Can't read from file!
|
||||
*/
|
||||
|
||||
DEBUG_printf((" cups_read() returned " CUPS_LLFMT "!\n",
|
||||
DEBUG_printf(("cups_fill: cups_read() returned " CUPS_LLFMT "!\n",
|
||||
CUPS_LLCAST bytes));
|
||||
|
||||
return (-1);
|
||||
@@ -1921,7 +1991,13 @@ cups_fill(cups_file_t *fp) /* I - CUPS file */
|
||||
fp->stream.next_out = (Bytef *)fp->buf;
|
||||
fp->stream.avail_out = sizeof(fp->buf);
|
||||
|
||||
if (inflate(&(fp->stream), Z_NO_FLUSH) == Z_STREAM_END)
|
||||
status = inflate(&(fp->stream), Z_NO_FLUSH);
|
||||
|
||||
if (fp->stream.next_out > (Bytef *)fp->buf)
|
||||
fp->crc = crc32(fp->crc, (Bytef *)fp->buf,
|
||||
fp->stream.next_out - (Bytef *)fp->buf);
|
||||
|
||||
if (status == Z_STREAM_END)
|
||||
{
|
||||
/*
|
||||
* Read the CRC and length...
|
||||
@@ -1950,6 +2026,9 @@ cups_fill(cups_file_t *fp) /* I - CUPS file */
|
||||
* Bad CRC, mark end-of-file...
|
||||
*/
|
||||
|
||||
DEBUG_printf(("cups_fill: tcrc=%08x, fp->crc=%08x\n",
|
||||
(unsigned int)tcrc, (unsigned int)fp->crc));
|
||||
|
||||
fp->eof = 1;
|
||||
|
||||
return (-1);
|
||||
@@ -2020,6 +2099,9 @@ cups_read(cups_file_t *fp, /* I - CUPS file */
|
||||
ssize_t total; /* Total bytes read */
|
||||
|
||||
|
||||
DEBUG_printf(("cups_read(fp=%p, buf=%p, bytes=" CUPS_LLFMT ")\n", fp, buf,
|
||||
CUPS_LLCAST bytes));
|
||||
|
||||
/*
|
||||
* Loop until we read at least 0 bytes...
|
||||
*/
|
||||
@@ -2038,6 +2120,8 @@ cups_read(cups_file_t *fp, /* I - CUPS file */
|
||||
total = read(fp->fd, buf, bytes);
|
||||
#endif /* WIN32 */
|
||||
|
||||
DEBUG_printf(("cups_read: total=" CUPS_LLFMT "\n", CUPS_LLCAST total));
|
||||
|
||||
if (total >= 0)
|
||||
break;
|
||||
|
||||
@@ -2072,8 +2156,8 @@ cups_write(cups_file_t *fp, /* I - CUPS file */
|
||||
ssize_t count; /* Count this time */
|
||||
|
||||
|
||||
DEBUG_printf(("cups_write(fp=%p, buf=%p, bytes=%ld)\n", fp, buf,
|
||||
(long)bytes));
|
||||
DEBUG_printf(("cups_write(fp=%p, buf=%p, bytes=" CUPS_LLFMT ")\n", fp, buf,
|
||||
CUPS_LLCAST bytes));
|
||||
|
||||
/*
|
||||
* Loop until all bytes are written...
|
||||
@@ -2094,6 +2178,8 @@ cups_write(cups_file_t *fp, /* I - CUPS file */
|
||||
count = write(fp->fd, buf, bytes);
|
||||
#endif /* WIN32 */
|
||||
|
||||
DEBUG_printf(("cups_write: count=" CUPS_LLFMT "\n", CUPS_LLCAST count));
|
||||
|
||||
if (count < 0)
|
||||
{
|
||||
/*
|
||||
@@ -2106,8 +2192,6 @@ cups_write(cups_file_t *fp, /* I - CUPS file */
|
||||
return (-1);
|
||||
}
|
||||
|
||||
DEBUG_printf((" count=%ld\n", (long)count));
|
||||
|
||||
/*
|
||||
* Update the counts for the last write call...
|
||||
*/
|
||||
|
||||
@@ -77,6 +77,7 @@ typedef struct _cups_globals_s /**** CUPS global state data ****/
|
||||
# ifdef HAVE_GETADDRINFO
|
||||
char hostname[1024]; /* Hostname */
|
||||
# endif /* HAVE_GETADDRINFO */
|
||||
int need_res_init; /* Need to reinitialize resolver? */
|
||||
|
||||
/* ipp.c */
|
||||
ipp_uchar_t ipp_date[11]; /* RFC-1903 date/time data */
|
||||
|
||||
+52
-12
@@ -28,10 +28,14 @@
|
||||
* Include necessary headers...
|
||||
*/
|
||||
|
||||
#include "http-private.h"
|
||||
#include "globals.h"
|
||||
#include "debug.h"
|
||||
#include <stdlib.h>
|
||||
#include <stddef.h>
|
||||
#ifdef HAVE_RESOLV_H
|
||||
# include <resolv.h>
|
||||
#endif /* HAVE_RESOLV_H */
|
||||
|
||||
|
||||
/*
|
||||
@@ -175,6 +179,10 @@ httpAddrLookup(
|
||||
char *name, /* I - Host name buffer */
|
||||
int namelen) /* I - Size of name buffer */
|
||||
{
|
||||
_cups_globals_t *cg = _cupsGlobals();
|
||||
/* Global data */
|
||||
|
||||
|
||||
DEBUG_printf(("httpAddrLookup(addr=%p, name=%p, namelen=%d)\n",
|
||||
addr, name, namelen));
|
||||
|
||||
@@ -192,22 +200,52 @@ httpAddrLookup(
|
||||
|
||||
#ifdef AF_LOCAL
|
||||
if (addr->addr.sa_family == AF_LOCAL)
|
||||
{
|
||||
strlcpy(name, addr->un.sun_path, namelen);
|
||||
else
|
||||
return (name);
|
||||
}
|
||||
#endif /* AF_LOCAL */
|
||||
|
||||
#ifdef HAVE_RES_INIT
|
||||
/*
|
||||
* STR #2920: Initialize resolver after failure in cups-polld
|
||||
*
|
||||
* If the previous lookup failed, re-initialize the resolver to prevent
|
||||
* temporary network errors from persisting. This *should* be handled by
|
||||
* the resolver libraries, but apparently the glibc folks do not agree.
|
||||
*
|
||||
* We set a flag at the end of this function if we encounter an error that
|
||||
* requires reinitialization of the resolver functions. We then call
|
||||
* res_init() if the flag is set on the next call here or in httpAddrLookup().
|
||||
*/
|
||||
|
||||
if (cg->need_res_init)
|
||||
{
|
||||
res_init();
|
||||
|
||||
cg->need_res_init = 0;
|
||||
}
|
||||
#endif /* HAVE_RES_INIT */
|
||||
|
||||
#ifdef HAVE_GETNAMEINFO
|
||||
{
|
||||
if (getnameinfo(&addr->addr, httpAddrLength(addr), name, namelen,
|
||||
NULL, 0, 0))
|
||||
/*
|
||||
* STR #2486: httpAddrLookup() fails when getnameinfo() returns EAI_AGAIN
|
||||
*
|
||||
* FWIW, I think this is really a bug in the implementation of
|
||||
* getnameinfo(), but falling back on httpAddrString() is easy to
|
||||
* do...
|
||||
*/
|
||||
|
||||
int error = getnameinfo(&addr->addr, httpAddrLength(addr), name, namelen,
|
||||
NULL, 0, 0);
|
||||
|
||||
if (error)
|
||||
{
|
||||
/*
|
||||
* If we get an error back, then the address type is not supported
|
||||
* and we should zero out the buffer...
|
||||
*/
|
||||
if (error == EAI_FAIL)
|
||||
cg->need_res_init = 1;
|
||||
|
||||
name[0] = '\0';
|
||||
|
||||
return (NULL);
|
||||
return (httpAddrString(addr, name, namelen));
|
||||
}
|
||||
}
|
||||
#else
|
||||
@@ -230,8 +268,10 @@ httpAddrLookup(
|
||||
* No hostname, so return the raw address...
|
||||
*/
|
||||
|
||||
httpAddrString(addr, name, namelen);
|
||||
return (NULL);
|
||||
if (h_errno == NO_RECOVERY)
|
||||
cg->need_res_init = 1;
|
||||
|
||||
return (httpAddrString(addr, name, namelen));
|
||||
}
|
||||
|
||||
strlcpy(name, host->h_name, namelen);
|
||||
|
||||
+42
-9
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* HTTP address list routines for the Common UNIX Printing System (CUPS).
|
||||
*
|
||||
* Copyright 2007 by Apple Inc.
|
||||
* Copyright 2007-2008 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -27,6 +27,10 @@
|
||||
#include "globals.h"
|
||||
#include "debug.h"
|
||||
#include <stdlib.h>
|
||||
#include <errno.h>
|
||||
#ifdef HAVE_RESOLV_H
|
||||
# include <resolv.h>
|
||||
#endif /* HAVE_RESOLV_H */
|
||||
|
||||
|
||||
/*
|
||||
@@ -174,6 +178,8 @@ httpAddrGetList(const char *hostname, /* I - Hostname, IP address, or NULL for p
|
||||
http_addrlist_t *first, /* First address in list */
|
||||
*addr, /* Current address in list */
|
||||
*temp; /* New address */
|
||||
_cups_globals_t *cg = _cupsGlobals();
|
||||
/* Global data */
|
||||
|
||||
|
||||
#ifdef DEBUG
|
||||
@@ -189,6 +195,28 @@ httpAddrGetList(const char *hostname, /* I - Hostname, IP address, or NULL for p
|
||||
family == AF_INET ? "INET" : "???", service);
|
||||
#endif /* DEBUG */
|
||||
|
||||
#ifdef HAVE_RES_INIT
|
||||
/*
|
||||
* STR #2920: Initialize resolver after failure in cups-polld
|
||||
*
|
||||
* If the previous lookup failed, re-initialize the resolver to prevent
|
||||
* temporary network errors from persisting. This *should* be handled by
|
||||
* the resolver libraries, but apparently the glibc folks do not agree.
|
||||
*
|
||||
* We set a flag at the end of this function if we encounter an error that
|
||||
* requires reinitialization of the resolver functions. We then call
|
||||
* res_init() if the flag is set on the next call here or in httpAddrLookup().
|
||||
*/
|
||||
|
||||
if (cg->need_res_init)
|
||||
{
|
||||
res_init();
|
||||
|
||||
cg->need_res_init = 0;
|
||||
}
|
||||
#endif /* HAVE_RES_INIT */
|
||||
|
||||
|
||||
/*
|
||||
* Lookup the address the best way we can...
|
||||
*/
|
||||
@@ -202,9 +230,11 @@ httpAddrGetList(const char *hostname, /* I - Hostname, IP address, or NULL for p
|
||||
* Domain socket address...
|
||||
*/
|
||||
|
||||
first = (http_addrlist_t *)calloc(1, sizeof(http_addrlist_t));
|
||||
first->addr.un.sun_family = AF_LOCAL;
|
||||
strlcpy(first->addr.un.sun_path, hostname, sizeof(first->addr.un.sun_path));
|
||||
if ((first = (http_addrlist_t *)calloc(1, sizeof(http_addrlist_t))) != NULL)
|
||||
{
|
||||
first->addr.un.sun_family = AF_LOCAL;
|
||||
strlcpy(first->addr.un.sun_path, hostname, sizeof(first->addr.un.sun_path));
|
||||
}
|
||||
}
|
||||
else
|
||||
#endif /* AF_LOCAL */
|
||||
@@ -216,6 +246,8 @@ httpAddrGetList(const char *hostname, /* I - Hostname, IP address, or NULL for p
|
||||
char ipv6[1024], /* IPv6 address */
|
||||
*ipv6zone; /* Pointer to zone separator */
|
||||
int ipv6len; /* Length of IPv6 address */
|
||||
int error; /* getaddrinfo() error */
|
||||
|
||||
|
||||
/*
|
||||
* Lookup the address as needed...
|
||||
@@ -267,7 +299,7 @@ httpAddrGetList(const char *hostname, /* I - Hostname, IP address, or NULL for p
|
||||
}
|
||||
}
|
||||
|
||||
if (!getaddrinfo(hostname, service, &hints, &results))
|
||||
if ((error = getaddrinfo(hostname, service, &hints, &results)) == 0)
|
||||
{
|
||||
/*
|
||||
* Copy the results to our own address list structure...
|
||||
@@ -313,6 +345,9 @@ httpAddrGetList(const char *hostname, /* I - Hostname, IP address, or NULL for p
|
||||
|
||||
freeaddrinfo(results);
|
||||
}
|
||||
else if (error == EAI_FAIL)
|
||||
cg->need_res_init = 1;
|
||||
|
||||
#else
|
||||
if (hostname)
|
||||
{
|
||||
@@ -429,6 +464,8 @@ httpAddrGetList(const char *hostname, /* I - Hostname, IP address, or NULL for p
|
||||
addr = temp;
|
||||
}
|
||||
}
|
||||
else if (h_errno == NO_RECOVERY)
|
||||
cg->need_res_init = 1;
|
||||
}
|
||||
#endif /* HAVE_GETADDRINFO */
|
||||
}
|
||||
@@ -526,8 +563,6 @@ httpAddrGetList(const char *hostname, /* I - Hostname, IP address, or NULL for p
|
||||
|
||||
if (addr)
|
||||
addr->next = temp;
|
||||
else
|
||||
addr = temp;
|
||||
}
|
||||
}
|
||||
else if (!hostname)
|
||||
@@ -581,8 +616,6 @@ httpAddrGetList(const char *hostname, /* I - Hostname, IP address, or NULL for p
|
||||
|
||||
if (addr)
|
||||
addr->next = temp;
|
||||
else
|
||||
addr = temp;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,12 +26,6 @@
|
||||
# include <config.h>
|
||||
|
||||
# ifdef __sun
|
||||
/*
|
||||
* Define FD_SETSIZE to CUPS_MAX_FDS on Solaris to get the correct version of
|
||||
* select() for large numbers of file descriptors.
|
||||
*/
|
||||
|
||||
# define FD_SETSIZE CUPS_MAX_FDS
|
||||
# include <sys/select.h>
|
||||
# endif /* __sun */
|
||||
|
||||
@@ -62,6 +56,9 @@
|
||||
# ifndef HAVE_GSS_C_NT_HOSTBASED_SERVICE
|
||||
# define GSS_C_NT_HOSTBASED_SERVICE gss_nt_service_name
|
||||
# endif /* !HAVE_GSS_C_NT_HOSTBASED_SERVICE */
|
||||
# ifdef HAVE_KRB5_H
|
||||
# include <krb5.h>
|
||||
# endif /* HAVE_KRB5_H */
|
||||
# endif /* HAVE_GSSAPI */
|
||||
|
||||
# ifdef HAVE_AUTHORIZATION_H
|
||||
@@ -260,6 +257,12 @@ extern void _cups_freeifaddrs(struct ifaddrs *addrs);
|
||||
# endif /* HAVE_GETIFADDRS */
|
||||
# endif /* !WIN32 */
|
||||
|
||||
/*
|
||||
* Common URI encoding function...
|
||||
*/
|
||||
|
||||
extern char *_httpEncodeURI(char *dst, const char *src, size_t dstsize);
|
||||
|
||||
#endif /* !_CUPS_HTTP_PRIVATE_H_ */
|
||||
|
||||
/*
|
||||
|
||||
+21
-3
@@ -36,6 +36,7 @@
|
||||
* httpStatus() - Return a short string describing a HTTP status code.
|
||||
* _cups_hstrerror() - hstrerror() emulation function for Solaris and
|
||||
* others...
|
||||
* _httpEncodeURI() - Percent-encode a HTTP request URI.
|
||||
* http_copy_decode() - Copy and decode a URI.
|
||||
* http_copy_encode() - Copy and encode a URI.
|
||||
*/
|
||||
@@ -55,7 +56,8 @@
|
||||
|
||||
static const char * const http_days[7] =
|
||||
{
|
||||
"Sun", "Mon",
|
||||
"Sun",
|
||||
"Mon",
|
||||
"Tue",
|
||||
"Wed",
|
||||
"Thu",
|
||||
@@ -1016,7 +1018,7 @@ httpSeparateURI(
|
||||
"0123456789"
|
||||
"-._~"
|
||||
"%"
|
||||
"!$&'()*+,;=", *ptr))
|
||||
"!$&'()*+,;=\\", *ptr))
|
||||
{
|
||||
*host = '\0';
|
||||
return (HTTP_URI_BAD_HOSTNAME);
|
||||
@@ -1202,6 +1204,20 @@ _cups_hstrerror(int error) /* I - Error number */
|
||||
#endif /* !HAVE_HSTRERROR */
|
||||
|
||||
|
||||
/*
|
||||
* '_httpEncodeURI()' - Percent-encode a HTTP request URI.
|
||||
*/
|
||||
|
||||
char * /* O - Encoded URI */
|
||||
_httpEncodeURI(char *dst, /* I - Destination buffer */
|
||||
const char *src, /* I - Source URI */
|
||||
size_t dstsize) /* I - Size of destination buffer */
|
||||
{
|
||||
http_copy_encode(dst, src, dst + dstsize - 1, NULL, NULL, 1);
|
||||
return (dst);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'http_copy_decode()' - Copy and decode a URI.
|
||||
*/
|
||||
@@ -1282,7 +1298,7 @@ http_copy_encode(char *dst, /* O - Destination buffer */
|
||||
const char *term, /* I - Terminating characters */
|
||||
int encode) /* I - %-encode reserved chars? */
|
||||
{
|
||||
static const char *hex = "0123456789ABCDEF";
|
||||
static const char hex[] = "0123456789ABCDEF";
|
||||
|
||||
|
||||
while (*src && dst < dstend)
|
||||
@@ -1310,6 +1326,8 @@ http_copy_encode(char *dst, /* O - Destination buffer */
|
||||
*dst++ = *src++;
|
||||
}
|
||||
|
||||
*dst = '\0';
|
||||
|
||||
if (*src)
|
||||
return (NULL);
|
||||
else
|
||||
|
||||
+19
-28
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* HTTP routines for the Common UNIX Printing System (CUPS).
|
||||
*
|
||||
* Copyright 2007 by Apple Inc.
|
||||
* Copyright 2007-2008 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* This file contains Kerberos support code, copyright 2006 by
|
||||
@@ -293,8 +293,7 @@ void
|
||||
httpClose(http_t *http) /* I - HTTP connection */
|
||||
{
|
||||
#ifdef HAVE_GSSAPI
|
||||
OM_uint32 minor_status, /* Minor status code */
|
||||
major_status; /* Major status code */
|
||||
OM_uint32 minor_status; /* Minor status code */
|
||||
#endif /* HAVE_GSSAPI */
|
||||
|
||||
|
||||
@@ -321,11 +320,10 @@ httpClose(http_t *http) /* I - HTTP connection */
|
||||
|
||||
#ifdef HAVE_GSSAPI
|
||||
if (http->gssctx != GSS_C_NO_CONTEXT)
|
||||
major_status = gss_delete_sec_context(&minor_status, &http->gssctx,
|
||||
GSS_C_NO_BUFFER);
|
||||
gss_delete_sec_context(&minor_status, &http->gssctx, GSS_C_NO_BUFFER);
|
||||
|
||||
if (http->gssname != GSS_C_NO_NAME)
|
||||
major_status = gss_release_name(&minor_status, &http->gssname);
|
||||
gss_release_name(&minor_status, &http->gssname);
|
||||
#endif /* HAVE_GSSAPI */
|
||||
|
||||
#ifdef HAVE_AUTHORIZATION_H
|
||||
@@ -402,9 +400,11 @@ httpConnectEncrypt(
|
||||
* Allocate memory for the structure...
|
||||
*/
|
||||
|
||||
http = calloc(sizeof(http_t), 1);
|
||||
if (http == NULL)
|
||||
if ((http = calloc(sizeof(http_t), 1)) == NULL)
|
||||
{
|
||||
httpAddrFreeList(addrlist);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
http->version = HTTP_1_1;
|
||||
http->blocking = 1;
|
||||
@@ -1735,9 +1735,15 @@ httpSetAuthString(http_t *http, /* I - HTTP connection */
|
||||
*/
|
||||
|
||||
int len = (int)strlen(scheme) + (data ? (int)strlen(data) + 1 : 0) + 1;
|
||||
char *temp;
|
||||
|
||||
if (len > (int)sizeof(http->_authstring))
|
||||
http->authstring = malloc(len);
|
||||
{
|
||||
if ((temp = malloc(len)) == NULL)
|
||||
len = sizeof(http->_authstring);
|
||||
else
|
||||
http->authstring = temp;
|
||||
}
|
||||
|
||||
if (data)
|
||||
snprintf(http->authstring, len, "%s %s", scheme, data);
|
||||
@@ -2514,8 +2520,7 @@ http_send(http_t *http, /* I - HTTP connection */
|
||||
const char *uri) /* I - URI */
|
||||
{
|
||||
int i; /* Looping var */
|
||||
char *ptr, /* Pointer in buffer */
|
||||
buf[1024]; /* Encoded URI buffer */
|
||||
char buf[1024]; /* Encoded URI buffer */
|
||||
static const char * const codes[] =
|
||||
{ /* Request code strings */
|
||||
NULL,
|
||||
@@ -2532,8 +2537,6 @@ http_send(http_t *http, /* I - HTTP connection */
|
||||
"TRACE",
|
||||
"CLOSE"
|
||||
};
|
||||
static const char hex[] = "0123456789ABCDEF";
|
||||
/* Hex digits */
|
||||
|
||||
|
||||
DEBUG_printf(("http_send(http=%p, request=HTTP_%s, uri=\"%s\")\n",
|
||||
@@ -2553,20 +2556,7 @@ http_send(http_t *http, /* I - HTTP connection */
|
||||
* Encode the URI as needed...
|
||||
*/
|
||||
|
||||
for (ptr = buf; *uri != '\0' && ptr < (buf + sizeof(buf) - 1); uri ++)
|
||||
if (*uri <= ' ' || *uri >= 127)
|
||||
{
|
||||
if (ptr < (buf + sizeof(buf) - 1))
|
||||
*ptr ++ = '%';
|
||||
if (ptr < (buf + sizeof(buf) - 1))
|
||||
*ptr ++ = hex[(*uri >> 4) & 15];
|
||||
if (ptr < (buf + sizeof(buf) - 1))
|
||||
*ptr ++ = hex[*uri & 15];
|
||||
}
|
||||
else
|
||||
*ptr ++ = *uri;
|
||||
|
||||
*ptr = '\0';
|
||||
_httpEncodeURI(buf, uri, sizeof(buf));
|
||||
|
||||
/*
|
||||
* See if we had an error the last time around; if so, reconnect...
|
||||
@@ -3001,7 +2991,8 @@ http_wait(http_t *http, /* I - HTTP connection */
|
||||
# elif defined(HAVE_CDSASSL)
|
||||
size_t bytes; /* Bytes that are available */
|
||||
|
||||
if (!SSLGetBufferedReadSize(((http_tls_t *)http->tls)->session, &bytes) && bytes > 0)
|
||||
if (!SSLGetBufferedReadSize(((http_tls_t *)(http->tls))->session, &bytes) &&
|
||||
bytes > 0)
|
||||
return (1);
|
||||
# endif /* HAVE_LIBSSL */
|
||||
}
|
||||
|
||||
@@ -82,6 +82,10 @@ typedef struct _cups_vmap_s /**** VBCS Charmap Struct ****/
|
||||
* Prototypes...
|
||||
*/
|
||||
|
||||
#ifdef __APPLE__
|
||||
extern const char *_cupsAppleLanguage(const char *locale, char *language,
|
||||
size_t langsize);
|
||||
#endif /* __APPLE__ */
|
||||
extern void _cupsCharmapFlush(void);
|
||||
extern void _cupsCharmapFree(const cups_encoding_t encoding);
|
||||
extern void *_cupsCharmapGet(const cups_encoding_t encoding);
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Private IPP definitions for the Common UNIX Printing System (CUPS).
|
||||
*
|
||||
* Copyright 2007 by Apple Inc.
|
||||
* Copyright 2007-2008 by Apple Inc.
|
||||
* Copyright 1997-2006 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -40,6 +40,7 @@ extern "C" {
|
||||
|
||||
typedef struct /**** Attribute mapping data ****/
|
||||
{
|
||||
int multivalue; /* Option has multiple values? */
|
||||
const char *name; /* Option/attribute name */
|
||||
ipp_tag_t value_tag; /* Value tag for this attribute */
|
||||
ipp_tag_t group_tag; /* Group tag for this attribute */
|
||||
|
||||
+113
-29
@@ -4,7 +4,7 @@
|
||||
* Internet Printing Protocol support functions for the Common UNIX
|
||||
* Printing System (CUPS).
|
||||
*
|
||||
* Copyright 2007 by Apple Inc.
|
||||
* Copyright 2007-2008 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -361,7 +361,12 @@ ippAddOctetString(ipp_t *ipp, /* I - IPP message */
|
||||
|
||||
if (data)
|
||||
{
|
||||
attr->values[0].unknown.data = malloc(datalen);
|
||||
if ((attr->values[0].unknown.data = malloc(datalen)) == NULL)
|
||||
{
|
||||
ippDeleteAttribute(ipp, attr);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
memcpy(attr->values[0].unknown.data, data, datalen);
|
||||
}
|
||||
|
||||
@@ -1014,8 +1019,10 @@ ippReadIO(void *src, /* I - Data source */
|
||||
ipp_t *ipp) /* I - IPP data */
|
||||
{
|
||||
int n; /* Length of data */
|
||||
unsigned char buffer[32768], /* Data buffer */
|
||||
string[255], /* Small string buffer */
|
||||
unsigned char buffer[IPP_MAX_LENGTH + 1],
|
||||
/* Data buffer */
|
||||
string[IPP_MAX_NAME],
|
||||
/* Small string buffer */
|
||||
*bufptr; /* Pointer into buffer */
|
||||
ipp_attribute_t *attr; /* Current attribute */
|
||||
ipp_tag_t tag; /* Current tag */
|
||||
@@ -1042,7 +1049,7 @@ ippReadIO(void *src, /* I - Data source */
|
||||
* Get the request header...
|
||||
*/
|
||||
|
||||
if ((n = (*cb)(src, buffer, 8)) < 8)
|
||||
if ((*cb)(src, buffer, 8) < 8)
|
||||
{
|
||||
DEBUG_printf(("ippReadIO: Unable to read header (%d bytes read)!\n", n));
|
||||
return (IPP_ERROR);
|
||||
@@ -1180,17 +1187,15 @@ ippReadIO(void *src, /* I - Data source */
|
||||
|
||||
attr->value_tag = tag;
|
||||
}
|
||||
else if (value_tag == IPP_TAG_STRING ||
|
||||
(value_tag >= IPP_TAG_TEXTLANG &&
|
||||
value_tag <= IPP_TAG_MIMETYPE))
|
||||
else if (value_tag >= IPP_TAG_TEXTLANG &&
|
||||
value_tag <= IPP_TAG_MIMETYPE)
|
||||
{
|
||||
/*
|
||||
* String values can sometimes come across in different
|
||||
* forms; accept sets of differing values...
|
||||
*/
|
||||
|
||||
if (tag != IPP_TAG_STRING &&
|
||||
(tag < IPP_TAG_TEXTLANG || tag > IPP_TAG_MIMETYPE))
|
||||
if (tag < IPP_TAG_TEXTLANG || tag > IPP_TAG_MIMETYPE)
|
||||
return (IPP_ERROR);
|
||||
}
|
||||
else if (value_tag != tag)
|
||||
@@ -1275,7 +1280,11 @@ ippReadIO(void *src, /* I - Data source */
|
||||
if (ipp->current)
|
||||
ipp->prev = ipp->current;
|
||||
|
||||
attr = ipp->current = _ippAddAttr(ipp, 1);
|
||||
if ((attr = ipp->current = _ippAddAttr(ipp, 1)) == NULL)
|
||||
{
|
||||
DEBUG_puts("ippReadIO: unable to allocate attribute!");
|
||||
return (IPP_ERROR);
|
||||
}
|
||||
|
||||
DEBUG_printf(("ippReadIO: name=\'%s\', ipp->current=%p, ipp->prev=%p\n",
|
||||
buffer, ipp->current, ipp->prev));
|
||||
@@ -1306,6 +1315,12 @@ ippReadIO(void *src, /* I - Data source */
|
||||
{
|
||||
case IPP_TAG_INTEGER :
|
||||
case IPP_TAG_ENUM :
|
||||
if (n != 4)
|
||||
{
|
||||
DEBUG_printf(("ippReadIO: bad value length %d!\n", n));
|
||||
return (IPP_ERROR);
|
||||
}
|
||||
|
||||
if ((*cb)(src, buffer, 4) < 4)
|
||||
{
|
||||
DEBUG_puts("ippReadIO: Unable to read integer value!");
|
||||
@@ -1317,7 +1332,14 @@ ippReadIO(void *src, /* I - Data source */
|
||||
|
||||
value->integer = n;
|
||||
break;
|
||||
|
||||
case IPP_TAG_BOOLEAN :
|
||||
if (n != 1)
|
||||
{
|
||||
DEBUG_printf(("ippReadIO: bad value length %d!\n", n));
|
||||
return (IPP_ERROR);
|
||||
}
|
||||
|
||||
if ((*cb)(src, buffer, 1) < 1)
|
||||
{
|
||||
DEBUG_puts("ippReadIO: Unable to read boolean value!");
|
||||
@@ -1326,15 +1348,21 @@ ippReadIO(void *src, /* I - Data source */
|
||||
|
||||
value->boolean = buffer[0];
|
||||
break;
|
||||
|
||||
case IPP_TAG_TEXT :
|
||||
case IPP_TAG_NAME :
|
||||
case IPP_TAG_KEYWORD :
|
||||
case IPP_TAG_STRING :
|
||||
case IPP_TAG_URI :
|
||||
case IPP_TAG_URISCHEME :
|
||||
case IPP_TAG_CHARSET :
|
||||
case IPP_TAG_LANGUAGE :
|
||||
case IPP_TAG_MIMETYPE :
|
||||
if (n >= sizeof(buffer))
|
||||
{
|
||||
DEBUG_printf(("ippReadIO: bad value length %d!\n", n));
|
||||
return (IPP_ERROR);
|
||||
}
|
||||
|
||||
if ((*cb)(src, buffer, n) < n)
|
||||
{
|
||||
DEBUG_puts("ippReadIO: unable to read name!");
|
||||
@@ -1346,14 +1374,28 @@ ippReadIO(void *src, /* I - Data source */
|
||||
DEBUG_printf(("ippReadIO: value = \'%s\'\n",
|
||||
value->string.text));
|
||||
break;
|
||||
|
||||
case IPP_TAG_DATE :
|
||||
if (n != 11)
|
||||
{
|
||||
DEBUG_printf(("ippReadIO: bad value length %d!\n", n));
|
||||
return (IPP_ERROR);
|
||||
}
|
||||
|
||||
if ((*cb)(src, value->date, 11) < 11)
|
||||
{
|
||||
DEBUG_puts("ippReadIO: Unable to date integer value!");
|
||||
return (IPP_ERROR);
|
||||
}
|
||||
break;
|
||||
|
||||
case IPP_TAG_RESOLUTION :
|
||||
if (n != 9)
|
||||
{
|
||||
DEBUG_printf(("ippReadIO: bad value length %d!\n", n));
|
||||
return (IPP_ERROR);
|
||||
}
|
||||
|
||||
if ((*cb)(src, buffer, 9) < 9)
|
||||
{
|
||||
DEBUG_puts("ippReadIO: Unable to read resolution value!");
|
||||
@@ -1369,7 +1411,14 @@ ippReadIO(void *src, /* I - Data source */
|
||||
value->resolution.units =
|
||||
(ipp_res_t)buffer[8];
|
||||
break;
|
||||
|
||||
case IPP_TAG_RANGE :
|
||||
if (n != 8)
|
||||
{
|
||||
DEBUG_printf(("ippReadIO: bad value length %d!\n", n));
|
||||
return (IPP_ERROR);
|
||||
}
|
||||
|
||||
if ((*cb)(src, buffer, 8) < 8)
|
||||
{
|
||||
DEBUG_puts("ippReadIO: Unable to read range value!");
|
||||
@@ -1383,9 +1432,10 @@ ippReadIO(void *src, /* I - Data source */
|
||||
(((((buffer[4] << 8) | buffer[5]) << 8) | buffer[6]) << 8) |
|
||||
buffer[7];
|
||||
break;
|
||||
|
||||
case IPP_TAG_TEXTLANG :
|
||||
case IPP_TAG_NAMELANG :
|
||||
if (n > sizeof(buffer) || n < 4)
|
||||
if (n >= sizeof(buffer) || n < 4)
|
||||
{
|
||||
DEBUG_printf(("ippReadIO: bad value length %d!\n", n));
|
||||
return (IPP_ERROR);
|
||||
@@ -1411,22 +1461,27 @@ ippReadIO(void *src, /* I - Data source */
|
||||
|
||||
n = (bufptr[0] << 8) | bufptr[1];
|
||||
|
||||
if (n >= sizeof(string))
|
||||
if ((bufptr + 2 + n) >= (buffer + sizeof(buffer)) ||
|
||||
n >= sizeof(string))
|
||||
{
|
||||
memcpy(string, bufptr + 2, sizeof(string) - 1);
|
||||
string[sizeof(string) - 1] = '\0';
|
||||
DEBUG_printf(("ippReadIO: bad value length %d!\n", n));
|
||||
return (IPP_ERROR);
|
||||
}
|
||||
else
|
||||
{
|
||||
memcpy(string, bufptr + 2, n);
|
||||
string[n] = '\0';
|
||||
}
|
||||
|
||||
memcpy(string, bufptr + 2, n);
|
||||
string[n] = '\0';
|
||||
|
||||
value->string.charset = _cupsStrAlloc((char *)string);
|
||||
|
||||
bufptr += 2 + n;
|
||||
n = (bufptr[0] << 8) | bufptr[1];
|
||||
|
||||
if ((bufptr + 2 + n) >= (buffer + sizeof(buffer)))
|
||||
{
|
||||
DEBUG_printf(("ippReadIO: bad value length %d!\n", n));
|
||||
return (IPP_ERROR);
|
||||
}
|
||||
|
||||
bufptr[2 + n] = '\0';
|
||||
value->string.text = _cupsStrAlloc((char *)bufptr + 2);
|
||||
break;
|
||||
@@ -1468,6 +1523,12 @@ ippReadIO(void *src, /* I - Data source */
|
||||
* we need to carry over...
|
||||
*/
|
||||
|
||||
if (n >= sizeof(buffer))
|
||||
{
|
||||
DEBUG_printf(("ippReadIO: bad value length %d!\n", n));
|
||||
return (IPP_ERROR);
|
||||
}
|
||||
|
||||
if ((*cb)(src, buffer, n) < n)
|
||||
{
|
||||
DEBUG_puts("ippReadIO: Unable to read member name value!");
|
||||
@@ -1489,10 +1550,27 @@ ippReadIO(void *src, /* I - Data source */
|
||||
break;
|
||||
|
||||
default : /* Other unsupported values */
|
||||
if (n > IPP_MAX_LENGTH)
|
||||
{
|
||||
DEBUG_printf(("ippReadIO: bad value length %d!\n", n));
|
||||
return (IPP_ERROR);
|
||||
}
|
||||
|
||||
if (!value)
|
||||
{
|
||||
DEBUG_puts("ippReadIO: NULL value!");
|
||||
return (IPP_ERROR);
|
||||
}
|
||||
|
||||
value->unknown.length = n;
|
||||
if (n > 0)
|
||||
{
|
||||
value->unknown.data = malloc(n);
|
||||
if ((value->unknown.data = malloc(n)) == NULL)
|
||||
{
|
||||
DEBUG_puts("ippReadIO: Unable to allocate value");
|
||||
return (IPP_ERROR);
|
||||
}
|
||||
|
||||
if ((*cb)(src, value->unknown.data, n) < n)
|
||||
{
|
||||
DEBUG_puts("ippReadIO: Unable to read unsupported value!");
|
||||
@@ -1627,7 +1705,8 @@ ippWriteIO(void *dst, /* I - Destination */
|
||||
{
|
||||
int i; /* Looping var */
|
||||
int n; /* Length of data */
|
||||
unsigned char buffer[32768], /* Data buffer */
|
||||
unsigned char buffer[IPP_MAX_LENGTH + 2],
|
||||
/* Data buffer + length bytes */
|
||||
*bufptr; /* Pointer into buffer */
|
||||
ipp_attribute_t *attr; /* Current attribute */
|
||||
ipp_value_t *value; /* Current value */
|
||||
@@ -1885,7 +1964,6 @@ ippWriteIO(void *dst, /* I - Destination */
|
||||
case IPP_TAG_TEXT :
|
||||
case IPP_TAG_NAME :
|
||||
case IPP_TAG_KEYWORD :
|
||||
case IPP_TAG_STRING :
|
||||
case IPP_TAG_URI :
|
||||
case IPP_TAG_URISCHEME :
|
||||
case IPP_TAG_CHARSET :
|
||||
@@ -1947,7 +2025,7 @@ ippWriteIO(void *dst, /* I - Destination */
|
||||
/*
|
||||
* All simple strings consist of the 2-byte length and
|
||||
* character data without the trailing nul normally found
|
||||
* in C strings. Also, strings cannot be longer than 32767
|
||||
* in C strings. Also, strings cannot be longer than IPP_MAX_LENGTH
|
||||
* bytes since the 2-byte length is a signed (twos-complement)
|
||||
* value.
|
||||
*
|
||||
@@ -2343,7 +2421,8 @@ ippWriteIO(void *dst, /* I - Destination */
|
||||
return (IPP_ERROR);
|
||||
}
|
||||
|
||||
DEBUG_printf(("ippWriteIO: wrote %d bytes\n", bufptr - buffer));
|
||||
DEBUG_printf(("ippWriteIO: wrote %d bytes\n",
|
||||
(int)(bufptr - buffer)));
|
||||
|
||||
/*
|
||||
* If blocking is disabled, stop here...
|
||||
@@ -2451,7 +2530,6 @@ _ippFreeAttr(ipp_attribute_t *attr) /* I - Attribute to free */
|
||||
case IPP_TAG_TEXT :
|
||||
case IPP_TAG_NAME :
|
||||
case IPP_TAG_KEYWORD :
|
||||
case IPP_TAG_STRING :
|
||||
case IPP_TAG_URI :
|
||||
case IPP_TAG_URISCHEME :
|
||||
case IPP_TAG_CHARSET :
|
||||
@@ -2490,6 +2568,13 @@ _ippFreeAttr(ipp_attribute_t *attr) /* I - Attribute to free */
|
||||
ippDelete(value->collection);
|
||||
break;
|
||||
|
||||
case IPP_TAG_STRING :
|
||||
for (i = 0, value = attr->values;
|
||||
i < attr->num_values;
|
||||
i ++, value ++)
|
||||
free(value->unknown.data);
|
||||
break;
|
||||
|
||||
default :
|
||||
if (!((int)attr->value_tag & IPP_TAG_COPY))
|
||||
{
|
||||
@@ -2578,7 +2663,6 @@ ipp_length(ipp_t *ipp, /* I - IPP message or collection */
|
||||
case IPP_TAG_TEXT :
|
||||
case IPP_TAG_NAME :
|
||||
case IPP_TAG_KEYWORD :
|
||||
case IPP_TAG_STRING :
|
||||
case IPP_TAG_URI :
|
||||
case IPP_TAG_URISCHEME :
|
||||
case IPP_TAG_CHARSET :
|
||||
@@ -2666,7 +2750,7 @@ ipp_read_http(http_t *http, /* I - Client connection */
|
||||
|
||||
|
||||
DEBUG_printf(("ipp_read_http(http=%p, buffer=%p, length=%d)\n",
|
||||
http, buffer, length));
|
||||
http, buffer, (int)length));
|
||||
|
||||
/*
|
||||
* Loop until all bytes are read...
|
||||
|
||||
+2
-1
@@ -55,7 +55,8 @@ extern "C" {
|
||||
* Common limits...
|
||||
*/
|
||||
|
||||
# define IPP_MAX_NAME 256
|
||||
# define IPP_MAX_LENGTH 32767 /* Maximum size of any single value */
|
||||
# define IPP_MAX_NAME 256 /* Maximum length of common name values */
|
||||
# define IPP_MAX_VALUES 8 /* Power-of-2 allocation increment */
|
||||
|
||||
|
||||
|
||||
+2
-2
@@ -63,8 +63,8 @@ _cupsLangPrintf(FILE *fp, /* I - File to write to */
|
||||
*/
|
||||
|
||||
va_start(ap, message);
|
||||
bytes = vsnprintf(buffer, sizeof(buffer),
|
||||
_cupsLangString(cg->lang_default, message), ap);
|
||||
vsnprintf(buffer, sizeof(buffer),
|
||||
_cupsLangString(cg->lang_default, message), ap);
|
||||
va_end(ap);
|
||||
|
||||
/*
|
||||
|
||||
+199
-251
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* I18N/language support for the Common UNIX Printing System (CUPS).
|
||||
*
|
||||
* Copyright 2007 by Apple Inc.
|
||||
* Copyright 2007-2008 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -16,6 +16,8 @@
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
* _cupsAppleLanguage() - Get the Apple language identifier associated
|
||||
* with a locale ID.
|
||||
* _cupsEncodingName() - Return the character encoding name string
|
||||
* for the given encoding enumeration.
|
||||
* cupsLangDefault() - Return the default language.
|
||||
@@ -65,26 +67,6 @@ static pthread_mutex_t lang_mutex = PTHREAD_MUTEX_INITIALIZER;
|
||||
#endif /* HAVE_PTHREAD_H */
|
||||
static cups_lang_t *lang_cache = NULL;
|
||||
/* Language string cache */
|
||||
|
||||
|
||||
/*
|
||||
* Local functions...
|
||||
*/
|
||||
|
||||
#ifdef __APPLE__
|
||||
static const char *appleLangDefault(void);
|
||||
#endif /* __APPLE__ */
|
||||
static cups_lang_t *cups_cache_lookup(const char *name,
|
||||
cups_encoding_t encoding);
|
||||
static int cups_message_compare(_cups_message_t *m1,
|
||||
_cups_message_t *m2);
|
||||
static void cups_unquote(char *d, const char *s);
|
||||
|
||||
|
||||
/*
|
||||
* Local globals...
|
||||
*/
|
||||
|
||||
static const char * const lang_encodings[] =
|
||||
{ /* Encoding strings */
|
||||
"us-ascii", "iso-8859-1",
|
||||
@@ -155,6 +137,123 @@ static const char * const lang_encodings[] =
|
||||
"euc-kr", "euc-tw"
|
||||
};
|
||||
|
||||
#ifdef __APPLE__
|
||||
typedef struct
|
||||
{
|
||||
const char * const language; /* Language ID */
|
||||
const char * const locale; /* Locale ID */
|
||||
} _apple_language_locale_t;
|
||||
|
||||
static const _apple_language_locale_t apple_language_locale[] =
|
||||
{ /* Locale to language ID LUT */
|
||||
{ "en" , "en_US" },
|
||||
{ "nb" , "no" },
|
||||
{ "zh-Hans" , "zh_CN" },
|
||||
{ "zh-Hant" , "zh_TW" }
|
||||
};
|
||||
#endif /* __APPLE__ */
|
||||
|
||||
|
||||
/*
|
||||
* Local functions...
|
||||
*/
|
||||
|
||||
#ifdef __APPLE__
|
||||
static const char *appleLangDefault(void);
|
||||
#endif /* __APPLE__ */
|
||||
static cups_lang_t *cups_cache_lookup(const char *name,
|
||||
cups_encoding_t encoding);
|
||||
static int cups_message_compare(_cups_message_t *m1,
|
||||
_cups_message_t *m2);
|
||||
static void cups_unquote(char *d, const char *s);
|
||||
|
||||
|
||||
#ifdef __APPLE__
|
||||
/*
|
||||
* _cupsAppleLanguage() - Get the Apple language identifier associated
|
||||
* with a locale ID.
|
||||
*/
|
||||
|
||||
const char * /* O - Language ID */
|
||||
_cupsAppleLanguage(const char *locale, /* I - Locale ID */
|
||||
char *language,/* I - Language ID buffer */
|
||||
size_t langsize) /* I - Size of language ID buffer */
|
||||
{
|
||||
int i; /* Looping var */
|
||||
CFStringRef localeid, /* CF locale identifier */
|
||||
langid; /* CF language identifier */
|
||||
|
||||
|
||||
/*
|
||||
* Copy the locale name and convert, as needed, to the Apple-specific
|
||||
* locale identifier...
|
||||
*/
|
||||
|
||||
switch (strlen(locale))
|
||||
{
|
||||
default :
|
||||
/*
|
||||
* Invalid locale...
|
||||
*/
|
||||
|
||||
strlcpy(language, "en", langsize);
|
||||
break;
|
||||
|
||||
case 2 :
|
||||
strlcpy(language, locale, langsize);
|
||||
break;
|
||||
|
||||
case 5 :
|
||||
strlcpy(language, locale, langsize);
|
||||
|
||||
if (language[2] == '-')
|
||||
{
|
||||
/*
|
||||
* Convert ll-cc to ll_CC...
|
||||
*/
|
||||
|
||||
language[2] = '_';
|
||||
language[3] = toupper(language[3] & 255);
|
||||
language[4] = toupper(language[4] & 255);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
for (i = 0;
|
||||
i < (int)(sizeof(apple_language_locale) /
|
||||
sizeof(apple_language_locale[0]));
|
||||
i ++)
|
||||
if (!strcmp(locale, apple_language_locale[i].locale))
|
||||
{
|
||||
strlcpy(language, apple_language_locale[i].language, sizeof(language));
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
* Attempt to map the locale ID to a language ID...
|
||||
*/
|
||||
|
||||
if ((localeid = CFStringCreateWithCString(kCFAllocatorDefault, language,
|
||||
kCFStringEncodingASCII)) != NULL)
|
||||
{
|
||||
if ((langid = CFLocaleCreateCanonicalLanguageIdentifierFromString(
|
||||
kCFAllocatorDefault, localeid)) != NULL)
|
||||
{
|
||||
CFStringGetCString(langid, language, langsize, kCFStringEncodingASCII);
|
||||
CFRelease(langid);
|
||||
}
|
||||
|
||||
CFRelease(localeid);
|
||||
}
|
||||
|
||||
/*
|
||||
* Return what we got...
|
||||
*/
|
||||
|
||||
return (language);
|
||||
}
|
||||
#endif /* __APPLE__ */
|
||||
|
||||
|
||||
/*
|
||||
* '_cupsEncodingName()' - Return the character encoding name string
|
||||
@@ -413,8 +512,14 @@ cupsLangGet(const char *language) /* I - Language or locale */
|
||||
strlcpy(locale, ptr, sizeof(locale));
|
||||
language = locale;
|
||||
|
||||
DEBUG_printf(("cupsLangGet: new language value is \"%s\"\n",
|
||||
language ? language : "(null)"));
|
||||
/*
|
||||
* CUPS STR #2575: Map "nb" to "no" for back-compatibility...
|
||||
*/
|
||||
|
||||
if (!strncmp(locale, "nb", 2))
|
||||
locale[1] = 'o';
|
||||
|
||||
DEBUG_printf(("cupsLangGet: new language value is \"%s\"\n", language));
|
||||
}
|
||||
}
|
||||
#endif /* __APPLE__ */
|
||||
@@ -870,7 +975,12 @@ _cupsMessageLoad(const char *filename) /* I - Message catalog to load */
|
||||
return (a);
|
||||
}
|
||||
|
||||
m->id = strdup(ptr);
|
||||
if ((m->id = strdup(ptr)) == NULL)
|
||||
{
|
||||
free(m);
|
||||
cupsFileClose(fp);
|
||||
return (a);
|
||||
}
|
||||
}
|
||||
else if (s[0] == '\"' && m)
|
||||
{
|
||||
@@ -918,7 +1028,11 @@ _cupsMessageLoad(const char *filename) /* I - Message catalog to load */
|
||||
* Set the string...
|
||||
*/
|
||||
|
||||
m->str = strdup(ptr);
|
||||
if ((m->str = strdup(ptr)) == NULL)
|
||||
{
|
||||
cupsFileClose(fp);
|
||||
return (a);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -967,29 +1081,6 @@ _cupsMessageLookup(cups_array_t *a, /* I - Message array */
|
||||
|
||||
|
||||
#ifdef __APPLE__
|
||||
/*
|
||||
* Code & data to translate OSX's language names to their ISO 639-1 locale.
|
||||
*
|
||||
* The first version uses the new CoreFoundation API added in 10.3 (Panther),
|
||||
* the second is for 10.2 (Jaguar).
|
||||
*/
|
||||
|
||||
# ifdef HAVE_CF_LOCALE_ID
|
||||
|
||||
typedef struct
|
||||
{
|
||||
const char * const name; /* Language name */
|
||||
const char * const locale; /* Locale name */
|
||||
} _apple_name_locale_t;
|
||||
|
||||
static const _apple_name_locale_t apple_name_locale[] =
|
||||
{
|
||||
{ "en" , "en_US" },
|
||||
{ "no" , "nb" },
|
||||
{ "zh-Hans" , "zh_CN" },
|
||||
{ "zh-Hant" , "zh_TW" }
|
||||
};
|
||||
|
||||
/*
|
||||
* 'appleLangDefault()' - Get the default locale string.
|
||||
*/
|
||||
@@ -998,6 +1089,8 @@ static const char * /* O - Locale string */
|
||||
appleLangDefault(void)
|
||||
{
|
||||
int i; /* Looping var */
|
||||
CFBundleRef bundle; /* Main bundle (if any) */
|
||||
CFArrayRef bundleList; /* List of localizations in bundle */
|
||||
CFPropertyListRef localizationList;
|
||||
/* List of localization data */
|
||||
CFStringRef languageName; /* Current name */
|
||||
@@ -1014,63 +1107,78 @@ appleLangDefault(void)
|
||||
if (!cg->language[0])
|
||||
{
|
||||
if ((lang = getenv("LANG")))
|
||||
{
|
||||
strlcpy(cg->language, lang, sizeof(cg->language));
|
||||
else
|
||||
return (cg->language);
|
||||
}
|
||||
else if ((bundle = CFBundleGetMainBundle()) != NULL &&
|
||||
(bundleList = CFBundleCopyBundleLocalizations(bundle)) != NULL)
|
||||
{
|
||||
localizationList =
|
||||
CFPreferencesCopyAppValue(CFSTR("AppleLanguages"),
|
||||
kCFPreferencesCurrentApplication);
|
||||
CFBundleCopyPreferredLocalizationsFromArray(bundleList);
|
||||
|
||||
if (localizationList != NULL)
|
||||
CFRelease(bundleList);
|
||||
}
|
||||
else
|
||||
localizationList =
|
||||
CFPreferencesCopyAppValue(CFSTR("AppleLanguages"),
|
||||
kCFPreferencesCurrentApplication);
|
||||
|
||||
if (localizationList)
|
||||
{
|
||||
if (CFGetTypeID(localizationList) == CFArrayGetTypeID() &&
|
||||
CFArrayGetCount(localizationList) > 0)
|
||||
{
|
||||
if (CFGetTypeID(localizationList) == CFArrayGetTypeID() &&
|
||||
CFArrayGetCount(localizationList) > 0)
|
||||
languageName = CFArrayGetValueAtIndex(localizationList, 0);
|
||||
|
||||
if (languageName &&
|
||||
CFGetTypeID(languageName) == CFStringGetTypeID())
|
||||
{
|
||||
languageName = CFArrayGetValueAtIndex(localizationList, 0);
|
||||
localeName = CFLocaleCreateCanonicalLocaleIdentifierFromString(
|
||||
kCFAllocatorDefault, languageName);
|
||||
|
||||
if (languageName != NULL &&
|
||||
CFGetTypeID(languageName) == CFStringGetTypeID())
|
||||
{
|
||||
localeName = CFLocaleCreateCanonicalLocaleIdentifierFromString(
|
||||
kCFAllocatorDefault, languageName);
|
||||
if (localeName)
|
||||
{
|
||||
CFStringGetCString(localeName, cg->language, sizeof(cg->language),
|
||||
kCFStringEncodingASCII);
|
||||
CFRelease(localeName);
|
||||
|
||||
if (localeName != NULL)
|
||||
DEBUG_printf(("appleLangDefault: cg->language=\"%s\"\n",
|
||||
cg->language));
|
||||
|
||||
/*
|
||||
* Map new language identifiers to locales...
|
||||
*/
|
||||
|
||||
for (i = 0;
|
||||
i < (int)(sizeof(apple_language_locale) /
|
||||
sizeof(apple_language_locale[0]));
|
||||
i ++)
|
||||
{
|
||||
CFStringGetCString(localeName, cg->language, sizeof(cg->language),
|
||||
kCFStringEncodingASCII);
|
||||
CFRelease(localeName);
|
||||
|
||||
/*
|
||||
* Map new language identifiers to locales...
|
||||
*/
|
||||
|
||||
for (i = 0;
|
||||
i < sizeof(apple_name_locale) / sizeof(apple_name_locale[0]);
|
||||
i++)
|
||||
if (!strcmp(cg->language, apple_language_locale[i].language))
|
||||
{
|
||||
if (!strcmp(cg->language, apple_name_locale[i].name))
|
||||
{
|
||||
strlcpy(cg->language, apple_name_locale[i].locale,
|
||||
sizeof(cg->language));
|
||||
break;
|
||||
}
|
||||
DEBUG_printf(("appleLangDefault: mapping \"%s\" to \"%s\"...\n",
|
||||
cg->language, apple_language_locale[i].locale));
|
||||
strlcpy(cg->language, apple_language_locale[i].locale,
|
||||
sizeof(cg->language));
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
* Convert language subtag into region subtag...
|
||||
*/
|
||||
|
||||
if (cg->language[2] == '-')
|
||||
cg->language[2] = '_';
|
||||
|
||||
if (strchr(cg->language, '.') == NULL)
|
||||
strlcat(cg->language, ".UTF-8", sizeof(cg->language));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
CFRelease(localizationList);
|
||||
/*
|
||||
* Convert language subtag into region subtag...
|
||||
*/
|
||||
|
||||
if (cg->language[2] == '-')
|
||||
cg->language[2] = '_';
|
||||
|
||||
if (!strchr(cg->language, '.'))
|
||||
strlcat(cg->language, ".UTF-8", sizeof(cg->language));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
CFRelease(localizationList);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1087,166 +1195,6 @@ appleLangDefault(void)
|
||||
|
||||
return (cg->language);
|
||||
}
|
||||
# else
|
||||
/*
|
||||
* Code & data to translate OSX 10.2's language names to their ISO 639-1
|
||||
* locale.
|
||||
*/
|
||||
|
||||
typedef struct
|
||||
{
|
||||
const char * const name; /* Language name */
|
||||
const char * const locale; /* Locale name */
|
||||
} _apple_name_locale_t;
|
||||
|
||||
static const _apple_name_locale_t apple_name_locale[] =
|
||||
{
|
||||
{ "English" , "en_US.UTF-8" }, { "French" , "fr.UTF-8" },
|
||||
{ "German" , "de.UTF-8" }, { "Italian" , "it.UTF-8" },
|
||||
{ "Dutch" , "nl.UTF-8" }, { "Swedish" , "sv.UTF-8" },
|
||||
{ "Spanish" , "es.UTF-8" }, { "Danish" , "da.UTF-8" },
|
||||
{ "Portuguese" , "pt.UTF-8" }, { "Norwegian" , "no.UTF-8" },
|
||||
{ "Hebrew" , "he.UTF-8" }, { "Japanese" , "ja.UTF-8" },
|
||||
{ "Arabic" , "ar.UTF-8" }, { "Finnish" , "fi.UTF-8" },
|
||||
{ "Greek" , "el.UTF-8" }, { "Icelandic" , "is.UTF-8" },
|
||||
{ "Maltese" , "mt.UTF-8" }, { "Turkish" , "tr.UTF-8" },
|
||||
{ "Croatian" , "hr.UTF-8" }, { "Chinese" , "zh.UTF-8" },
|
||||
{ "Urdu" , "ur.UTF-8" }, { "Hindi" , "hi.UTF-8" },
|
||||
{ "Thai" , "th.UTF-8" }, { "Korean" , "ko.UTF-8" },
|
||||
{ "Lithuanian" , "lt.UTF-8" }, { "Polish" , "pl.UTF-8" },
|
||||
{ "Hungarian" , "hu.UTF-8" }, { "Estonian" , "et.UTF-8" },
|
||||
{ "Latvian" , "lv.UTF-8" }, { "Sami" , "se.UTF-8" },
|
||||
{ "Faroese" , "fo.UTF-8" }, { "Farsi" , "fa.UTF-8" },
|
||||
{ "Russian" , "ru.UTF-8" }, { "Chinese" , "zh.UTF-8" },
|
||||
{ "Dutch" , "nl.UTF-8" }, { "Irish" , "ga.UTF-8" },
|
||||
{ "Albanian" , "sq.UTF-8" }, { "Romanian" , "ro.UTF-8" },
|
||||
{ "Czech" , "cs.UTF-8" }, { "Slovak" , "sk.UTF-8" },
|
||||
{ "Slovenian" , "sl.UTF-8" }, { "Yiddish" , "yi.UTF-8" },
|
||||
{ "Serbian" , "sr.UTF-8" }, { "Macedonian" , "mk.UTF-8" },
|
||||
{ "Bulgarian" , "bg.UTF-8" }, { "Ukrainian" , "uk.UTF-8" },
|
||||
{ "Byelorussian", "be.UTF-8" }, { "Uzbek" , "uz.UTF-8" },
|
||||
{ "Kazakh" , "kk.UTF-8" }, { "Azerbaijani", "az.UTF-8" },
|
||||
{ "Azerbaijani" , "az.UTF-8" }, { "Armenian" , "hy.UTF-8" },
|
||||
{ "Georgian" , "ka.UTF-8" }, { "Moldavian" , "mo.UTF-8" },
|
||||
{ "Kirghiz" , "ky.UTF-8" }, { "Tajiki" , "tg.UTF-8" },
|
||||
{ "Turkmen" , "tk.UTF-8" }, { "Mongolian" , "mn.UTF-8" },
|
||||
{ "Mongolian" , "mn.UTF-8" }, { "Pashto" , "ps.UTF-8" },
|
||||
{ "Kurdish" , "ku.UTF-8" }, { "Kashmiri" , "ks.UTF-8" },
|
||||
{ "Sindhi" , "sd.UTF-8" }, { "Tibetan" , "bo.UTF-8" },
|
||||
{ "Nepali" , "ne.UTF-8" }, { "Sanskrit" , "sa.UTF-8" },
|
||||
{ "Marathi" , "mr.UTF-8" }, { "Bengali" , "bn.UTF-8" },
|
||||
{ "Assamese" , "as.UTF-8" }, { "Gujarati" , "gu.UTF-8" },
|
||||
{ "Punjabi" , "pa.UTF-8" }, { "Oriya" , "or.UTF-8" },
|
||||
{ "Malayalam" , "ml.UTF-8" }, { "Kannada" , "kn.UTF-8" },
|
||||
{ "Tamil" , "ta.UTF-8" }, { "Telugu" , "te.UTF-8" },
|
||||
{ "Sinhalese" , "si.UTF-8" }, { "Burmese" , "my.UTF-8" },
|
||||
{ "Khmer" , "km.UTF-8" }, { "Lao" , "lo.UTF-8" },
|
||||
{ "Vietnamese" , "vi.UTF-8" }, { "Indonesian" , "id.UTF-8" },
|
||||
{ "Tagalog" , "tl.UTF-8" }, { "Malay" , "ms.UTF-8" },
|
||||
{ "Malay" , "ms.UTF-8" }, { "Amharic" , "am.UTF-8" },
|
||||
{ "Tigrinya" , "ti.UTF-8" }, { "Oromo" , "om.UTF-8" },
|
||||
{ "Somali" , "so.UTF-8" }, { "Swahili" , "sw.UTF-8" },
|
||||
{ "Kinyarwanda" , "rw.UTF-8" }, { "Rundi" , "rn.UTF-8" },
|
||||
{ "Nyanja" , "" }, { "Malagasy" , "mg.UTF-8" },
|
||||
{ "Esperanto" , "eo.UTF-8" }, { "Welsh" , "cy.UTF-8" },
|
||||
{ "Basque" , "eu.UTF-8" }, { "Catalan" , "ca.UTF-8" },
|
||||
{ "Latin" , "la.UTF-8" }, { "Quechua" , "qu.UTF-8" },
|
||||
{ "Guarani" , "gn.UTF-8" }, { "Aymara" , "ay.UTF-8" },
|
||||
{ "Tatar" , "tt.UTF-8" }, { "Uighur" , "ug.UTF-8" },
|
||||
{ "Dzongkha" , "dz.UTF-8" }, { "Javanese" , "jv.UTF-8" },
|
||||
{ "Sundanese" , "su.UTF-8" }, { "Galician" , "gl.UTF-8" },
|
||||
{ "Afrikaans" , "af.UTF-8" }, { "Breton" , "br.UTF-8" },
|
||||
{ "Inuktitut" , "iu.UTF-8" }, { "Scottish" , "gd.UTF-8" },
|
||||
{ "Manx" , "gv.UTF-8" }, { "Irish" , "ga.UTF-8" },
|
||||
{ "Tongan" , "to.UTF-8" }, { "Greek" , "el.UTF-8" },
|
||||
{ "Greenlandic" , "kl.UTF-8" }, { "Azerbaijani", "az.UTF-8" }
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* 'appleLangDefault()' - Get the default locale string.
|
||||
*/
|
||||
|
||||
static const char * /* O - Locale string */
|
||||
appleLangDefault(void)
|
||||
{
|
||||
int i; /* Looping var */
|
||||
CFPropertyListRef localizationList;
|
||||
/* List of localization data */
|
||||
CFStringRef localizationName;
|
||||
/* Current name */
|
||||
char buff[256]; /* Temporary buffer */
|
||||
_cups_globals_t *cg = _cupsGlobals();
|
||||
/* Pointer to library globals */
|
||||
char *lang; /* LANG environment variable */
|
||||
|
||||
|
||||
/*
|
||||
* Only do the lookup and translation the first time.
|
||||
*/
|
||||
|
||||
if (!cg->language[0])
|
||||
{
|
||||
if ((lang = getenv("LANG")))
|
||||
strlcpy(cg->language, lang, sizeof(cg->language));
|
||||
else
|
||||
{
|
||||
localizationList =
|
||||
CFPreferencesCopyAppValue(CFSTR("AppleLanguages"),
|
||||
kCFPreferencesCurrentApplication);
|
||||
|
||||
if (localizationList != NULL)
|
||||
{
|
||||
if (CFGetTypeID(localizationList) == CFArrayGetTypeID() &&
|
||||
CFArrayGetCount(localizationList) > 0)
|
||||
{
|
||||
localizationName = CFArrayGetValueAtIndex(localizationList, 0);
|
||||
|
||||
if (localizationName != NULL &&
|
||||
CFGetTypeID(localizationName) == CFStringGetTypeID())
|
||||
{
|
||||
CFIndex length = CFStringGetLength(localizationName);
|
||||
|
||||
if (length <= sizeof(buff) &&
|
||||
CFStringGetCString(localizationName, buff, sizeof(buff),
|
||||
kCFStringEncodingASCII))
|
||||
{
|
||||
buff[sizeof(buff) - 1] = '\0';
|
||||
|
||||
for (i = 0;
|
||||
i < sizeof(apple_name_locale) / sizeof(apple_name_locale[0]);
|
||||
i++)
|
||||
{
|
||||
if (!strcasecmp(buff, apple_name_locale[i].name))
|
||||
{
|
||||
strlcpy(cg->language, apple_name_locale[i].locale,
|
||||
sizeof(cg->language));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
CFRelease(localizationList);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* If we didn't find the language, default to en_US...
|
||||
*/
|
||||
|
||||
if (!cg->language[0])
|
||||
strlcpy(cg->language, apple_name_locale[0].locale, sizeof(cg->language));
|
||||
}
|
||||
|
||||
/*
|
||||
* Return the cached locale...
|
||||
*/
|
||||
|
||||
return (cg->language);
|
||||
}
|
||||
# endif /* HAVE_CF_LOCALE_ID */
|
||||
#endif /* __APPLE__ */
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
__cups_strcpy
|
||||
__cupsAdminGetServerSettings
|
||||
__cupsAdminSetServerSettings
|
||||
__cupsAppleLanguage
|
||||
__cupsCharmapFlush
|
||||
__cupsCharmapFree
|
||||
__cupsCharmapGet
|
||||
@@ -24,6 +25,7 @@ __cupsStrFormatd
|
||||
__cupsStrFree
|
||||
__cupsStrScand
|
||||
__cupsStrStatistics
|
||||
__httpEncodeURI
|
||||
__httpReadCDSA
|
||||
__httpWriteCDSA
|
||||
__ippAddAttr
|
||||
|
||||
@@ -29,6 +29,7 @@ _cups_strcpy
|
||||
_cups_strlcat
|
||||
_cups_strlcpy
|
||||
_httpBIOMethods
|
||||
_httpEncodeURI
|
||||
_ippAddAttr
|
||||
_ippFreeAttr
|
||||
_ppdGetEncoding
|
||||
|
||||
+42
-31
@@ -44,7 +44,8 @@
|
||||
* Local functions...
|
||||
*/
|
||||
|
||||
static void ppd_ll_CC(char *ll_CC, char *ll);
|
||||
static void ppd_ll_CC(char *ll_CC, int ll_CC_size,
|
||||
char *ll, int ll_size);
|
||||
static ppd_attr_t *ppd_localized_attr(ppd_file_t *ppd,
|
||||
const char *keyword,
|
||||
const char *spec, const char *ll_CC,
|
||||
@@ -90,7 +91,7 @@ ppdLocalize(ppd_file_t *ppd) /* I - PPD file */
|
||||
* Get the default language...
|
||||
*/
|
||||
|
||||
ppd_ll_CC(ll_CC, ll);
|
||||
ppd_ll_CC(ll_CC, sizeof(ll_CC), ll, sizeof(ll));
|
||||
|
||||
/*
|
||||
* Now lookup all of the groups, options, choices, etc.
|
||||
@@ -240,7 +241,7 @@ ppdLocalizeIPPReason(
|
||||
* Get the default language...
|
||||
*/
|
||||
|
||||
ppd_ll_CC(ll_CC, ll);
|
||||
ppd_ll_CC(ll_CC, sizeof(ll_CC), ll, sizeof(ll));
|
||||
|
||||
/*
|
||||
* Find the localized attribute...
|
||||
@@ -391,8 +392,9 @@ ppdLocalizeIPPReason(
|
||||
|
||||
static void
|
||||
ppd_ll_CC(char *ll_CC, /* O - Country-specific locale name */
|
||||
char *ll) /* O - Generic locale name */
|
||||
|
||||
int ll_CC_size, /* I - Size of country-specific name */
|
||||
char *ll, /* O - Generic locale name */
|
||||
int ll_size) /* I - Size of generic name */
|
||||
{
|
||||
cups_lang_t *lang; /* Current language */
|
||||
|
||||
@@ -403,8 +405,8 @@ ppd_ll_CC(char *ll_CC, /* O - Country-specific locale name */
|
||||
|
||||
if ((lang = cupsLangDefault()) == NULL)
|
||||
{
|
||||
strcpy(ll_CC, "en_US");
|
||||
strcpy(ll, "en");
|
||||
strlcpy(ll_CC, "en_US", ll_CC_size);
|
||||
strlcpy(ll, "en", ll_size);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -412,8 +414,10 @@ ppd_ll_CC(char *ll_CC, /* O - Country-specific locale name */
|
||||
* Copy the locale name...
|
||||
*/
|
||||
|
||||
strlcpy(ll_CC, lang->language, sizeof(ll_CC));
|
||||
strlcpy(ll, lang->language, sizeof(ll));
|
||||
strlcpy(ll_CC, lang->language, ll_CC_size);
|
||||
strlcpy(ll, lang->language, ll_size);
|
||||
|
||||
DEBUG_printf(("ll_CC=\"%s\", ll=\"%s\"\n", ll_CC, ll));
|
||||
|
||||
if (strlen(ll_CC) == 2)
|
||||
{
|
||||
@@ -423,22 +427,15 @@ ppd_ll_CC(char *ll_CC, /* O - Country-specific locale name */
|
||||
*/
|
||||
|
||||
if (!strcmp(ll_CC, "cs"))
|
||||
strcpy(ll_CC, "cs_CZ");
|
||||
strlcpy(ll_CC, "cs_CZ", ll_CC_size);
|
||||
else if (!strcmp(ll_CC, "en"))
|
||||
strcpy(ll_CC, "en_US");
|
||||
strlcpy(ll_CC, "en_US", ll_CC_size);
|
||||
else if (!strcmp(ll_CC, "ja"))
|
||||
strcpy(ll_CC, "ja_JP");
|
||||
strlcpy(ll_CC, "ja_JP", ll_CC_size);
|
||||
else if (!strcmp(ll_CC, "sv"))
|
||||
strcpy(ll_CC, "sv_SE");
|
||||
else if (!strcmp(ll_CC, "zh"))
|
||||
strcpy(ll_CC, "zh_CN"); /* Simplified Chinese */
|
||||
else
|
||||
{
|
||||
ll_CC[2] = '_';
|
||||
ll_CC[3] = toupper(ll_CC[0] & 255);
|
||||
ll_CC[4] = toupper(ll_CC[1] & 255);
|
||||
ll_CC[5] = '\0';
|
||||
}
|
||||
strlcpy(ll_CC, "sv_SE", ll_CC_size);
|
||||
else if (!strcmp(ll_CC, "zh")) /* Simplified Chinese */
|
||||
strlcpy(ll_CC, "zh_CN", ll_CC_size);
|
||||
}
|
||||
|
||||
DEBUG_printf(("ppd_ll_CC: lang->language=\"%s\", ll=\"%s\", ll_CC=\"%s\"...\n",
|
||||
@@ -475,17 +472,31 @@ ppd_localized_attr(ppd_file_t *ppd, /* I - PPD file */
|
||||
snprintf(lkeyword, sizeof(lkeyword), "%s.%s", ll, keyword);
|
||||
attr = ppdFindAttr(ppd, lkeyword, spec);
|
||||
|
||||
if (!attr && !strcmp(ll, "ja"))
|
||||
if (!attr)
|
||||
{
|
||||
/*
|
||||
* Due to a bug in the CUPS DDK 1.1.0 ppdmerge program, Japanese
|
||||
* PPD files were incorrectly assigned "jp" as the locale name
|
||||
* instead of "ja". Support both the old (incorrect) and new
|
||||
* locale names for Japanese...
|
||||
*/
|
||||
if (!strcmp(ll, "ja"))
|
||||
{
|
||||
/*
|
||||
* Due to a bug in the CUPS DDK 1.1.0 ppdmerge program, Japanese
|
||||
* PPD files were incorrectly assigned "jp" as the locale name
|
||||
* instead of "ja". Support both the old (incorrect) and new
|
||||
* locale names for Japanese...
|
||||
*/
|
||||
|
||||
snprintf(lkeyword, sizeof(lkeyword), "jp.%s", keyword);
|
||||
attr = ppdFindAttr(ppd, lkeyword, spec);
|
||||
snprintf(lkeyword, sizeof(lkeyword), "jp.%s", keyword);
|
||||
attr = ppdFindAttr(ppd, lkeyword, spec);
|
||||
}
|
||||
else if (!strcmp(ll, "no"))
|
||||
{
|
||||
/*
|
||||
* Norway has two languages, "Bokmal" (the primary one)
|
||||
* and "Nynorsk" (new Norwegian); we map "no" to "nb" here as
|
||||
* recommended by the locale folks...
|
||||
*/
|
||||
|
||||
snprintf(lkeyword, sizeof(lkeyword), "nb.%s", keyword);
|
||||
attr = ppdFindAttr(ppd, lkeyword, spec);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+6
-3
@@ -197,11 +197,14 @@ ppdFindChoice(ppd_option_t *o, /* I - Pointer to option */
|
||||
ppd_choice_t *c; /* Current choice */
|
||||
|
||||
|
||||
if (o == NULL || choice == NULL)
|
||||
if (!o || !choice)
|
||||
return (NULL);
|
||||
|
||||
if (choice[0] == '{' || !strncasecmp(choice, "Custom.", 7))
|
||||
choice = "Custom";
|
||||
|
||||
for (i = o->num_choices, c = o->choices; i > 0; i --, c ++)
|
||||
if (strcasecmp(c->choice, choice) == 0)
|
||||
if (!strcasecmp(c->choice, choice))
|
||||
return (c);
|
||||
|
||||
return (NULL);
|
||||
@@ -498,7 +501,7 @@ ppdMarkOption(ppd_file_t *ppd, /* I - PPD file record */
|
||||
|
||||
if ((coption = ppdFindCustomOption(ppd, option)) != NULL)
|
||||
{
|
||||
num_vals = cupsParseOptions(choice + 1, 0, &vals);
|
||||
num_vals = cupsParseOptions(choice, 0, &vals);
|
||||
|
||||
for (i = 0, val = vals; i < num_vals; i ++, val ++)
|
||||
{
|
||||
|
||||
+146
-88
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Option routines for the Common UNIX Printing System (CUPS).
|
||||
*
|
||||
* Copyright 2007 by Apple Inc.
|
||||
* Copyright 2007-2008 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -63,9 +63,14 @@ cupsAddOption(const char *name, /* I - Name of option */
|
||||
cups_option_t *temp; /* Pointer to new option */
|
||||
|
||||
|
||||
if (name == NULL || !name[0] || value == NULL ||
|
||||
options == NULL || num_options < 0)
|
||||
DEBUG_printf(("cupsAddOption(name=\"%s\", value=\"%s\", num_options=%d, "
|
||||
"options=%p)\n", name, value, num_options, options));
|
||||
|
||||
if (!name || !name[0] || !value || !options || num_options < 0)
|
||||
{
|
||||
DEBUG_printf(("cupsAddOption: Returning %d\n", num_options));
|
||||
return (num_options);
|
||||
}
|
||||
|
||||
/*
|
||||
* Look for an existing option with the same name...
|
||||
@@ -81,6 +86,8 @@ cupsAddOption(const char *name, /* I - Name of option */
|
||||
* No matching option name...
|
||||
*/
|
||||
|
||||
DEBUG_puts("cupsAddOption: New option...");
|
||||
|
||||
if (num_options == 0)
|
||||
temp = (cups_option_t *)malloc(sizeof(cups_option_t));
|
||||
else
|
||||
@@ -88,7 +95,10 @@ cupsAddOption(const char *name, /* I - Name of option */
|
||||
(num_options + 1));
|
||||
|
||||
if (temp == NULL)
|
||||
{
|
||||
DEBUG_puts("cupsAddOption: Unable to expand option array, returning 0");
|
||||
return (0);
|
||||
}
|
||||
|
||||
*options = temp;
|
||||
temp += num_options;
|
||||
@@ -122,7 +132,10 @@ cupsFreeOptions(
|
||||
int i; /* Looping var */
|
||||
|
||||
|
||||
if (num_options <= 0 || options == NULL)
|
||||
DEBUG_printf(("cupsFreeOptions(num_options=%d, options=%p)\n", num_options,
|
||||
options));
|
||||
|
||||
if (num_options <= 0 || !options)
|
||||
return;
|
||||
|
||||
for (i = 0; i < num_options; i ++)
|
||||
@@ -147,13 +160,23 @@ cupsGetOption(const char *name, /* I - Name of option */
|
||||
int i; /* Looping var */
|
||||
|
||||
|
||||
if (name == NULL || num_options <= 0 || options == NULL)
|
||||
DEBUG_printf(("cupsGetOption(name=\"%s\", num_options=%d, options=%p)\n",
|
||||
name, num_options, options));
|
||||
|
||||
if (!name || num_options <= 0 || !options)
|
||||
{
|
||||
DEBUG_puts("cupsGetOption: Returning NULL");
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
for (i = 0; i < num_options; i ++)
|
||||
if (strcasecmp(options[i].name, name) == 0)
|
||||
if (!strcasecmp(options[i].name, name))
|
||||
{
|
||||
DEBUG_printf(("cupsGetOption: Returning \"%s\"\n", options[i].value));
|
||||
return (options[i].value);
|
||||
}
|
||||
|
||||
DEBUG_puts("cupsGetOption: Returning NULL");
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
@@ -470,18 +493,56 @@ cupsParseOptions(
|
||||
char *copyarg, /* Copy of input string */
|
||||
*ptr, /* Pointer into string */
|
||||
*name, /* Pointer to name */
|
||||
*value; /* Pointer to value */
|
||||
*value, /* Pointer to value */
|
||||
quote; /* Quote character */
|
||||
|
||||
|
||||
if (arg == NULL || options == NULL || num_options < 0)
|
||||
DEBUG_printf(("cupsParseOptions(arg=\"%s\", num_options=%d, options=%p)\n",
|
||||
arg, num_options, options));
|
||||
|
||||
/*
|
||||
* Range check input...
|
||||
*/
|
||||
|
||||
if (!arg)
|
||||
{
|
||||
DEBUG_printf(("cupsParseOptions: Returning %d\n", num_options));
|
||||
return (num_options);
|
||||
}
|
||||
|
||||
if (!options || num_options < 0)
|
||||
{
|
||||
DEBUG_puts("cupsParseOptions: Returning 0");
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
* Make a copy of the argument string and then divide it up...
|
||||
*/
|
||||
|
||||
copyarg = strdup(arg);
|
||||
ptr = copyarg;
|
||||
if ((copyarg = strdup(arg)) == NULL)
|
||||
{
|
||||
DEBUG_puts("cupsParseOptions: Unable to copy arg string");
|
||||
DEBUG_printf(("cupsParseOptions: Returning %d\n", num_options));
|
||||
return (num_options);
|
||||
}
|
||||
|
||||
if (*copyarg == '{')
|
||||
{
|
||||
/*
|
||||
* Remove surrounding {} so we can parse "{name=value ... name=value}"...
|
||||
*/
|
||||
|
||||
if ((ptr = copyarg + strlen(copyarg) - 1) > copyarg && *ptr == '}')
|
||||
{
|
||||
*ptr = '\0';
|
||||
ptr = copyarg + 1;
|
||||
}
|
||||
else
|
||||
ptr = copyarg;
|
||||
}
|
||||
else
|
||||
ptr = copyarg;
|
||||
|
||||
/*
|
||||
* Skip leading spaces...
|
||||
@@ -501,7 +562,7 @@ cupsParseOptions(
|
||||
*/
|
||||
|
||||
name = ptr;
|
||||
while (!isspace(*ptr & 255) && *ptr != '=' && *ptr != '\0')
|
||||
while (!isspace(*ptr & 255) && *ptr != '=' && *ptr)
|
||||
ptr ++;
|
||||
|
||||
/*
|
||||
@@ -518,13 +579,15 @@ cupsParseOptions(
|
||||
while (isspace(*ptr & 255))
|
||||
*ptr++ = '\0';
|
||||
|
||||
DEBUG_printf(("cupsParseOptions: name=\"%s\"\n", name));
|
||||
|
||||
if (*ptr != '=')
|
||||
{
|
||||
/*
|
||||
* Start of another option...
|
||||
* Boolean option...
|
||||
*/
|
||||
|
||||
if (strncasecmp(name, "no", 2) == 0)
|
||||
if (!strncasecmp(name, "no", 2))
|
||||
num_options = cupsAddOption(name + 2, "false", num_options,
|
||||
options);
|
||||
else
|
||||
@@ -538,100 +601,84 @@ cupsParseOptions(
|
||||
*/
|
||||
|
||||
*ptr++ = '\0';
|
||||
value = ptr;
|
||||
|
||||
if (*ptr == '\'')
|
||||
while (*ptr && !isspace(*ptr & 255))
|
||||
{
|
||||
/*
|
||||
* Quoted string constant...
|
||||
*/
|
||||
|
||||
ptr ++;
|
||||
value = ptr;
|
||||
|
||||
while (*ptr != '\'' && *ptr != '\0')
|
||||
{
|
||||
if (*ptr == '\\')
|
||||
_cups_strcpy(ptr, ptr + 1);
|
||||
|
||||
if (*ptr == ',')
|
||||
ptr ++;
|
||||
}
|
||||
|
||||
if (*ptr != '\0')
|
||||
*ptr++ = '\0';
|
||||
}
|
||||
else if (*ptr == '\"')
|
||||
{
|
||||
/*
|
||||
* Double-quoted string constant...
|
||||
*/
|
||||
|
||||
ptr ++;
|
||||
value = ptr;
|
||||
|
||||
while (*ptr != '\"' && *ptr != '\0')
|
||||
else if (*ptr == '\'' || *ptr == '\"')
|
||||
{
|
||||
if (*ptr == '\\')
|
||||
_cups_strcpy(ptr, ptr + 1);
|
||||
/*
|
||||
* Quoted string constant...
|
||||
*/
|
||||
|
||||
ptr ++;
|
||||
}
|
||||
quote = *ptr;
|
||||
_cups_strcpy(ptr, ptr + 1);
|
||||
|
||||
if (*ptr != '\0')
|
||||
*ptr++ = '\0';
|
||||
}
|
||||
else if (*ptr == '{')
|
||||
{
|
||||
/*
|
||||
* Collection value...
|
||||
*/
|
||||
|
||||
int depth;
|
||||
|
||||
value = ptr;
|
||||
|
||||
for (depth = 1; *ptr; ptr ++)
|
||||
if (*ptr == '{')
|
||||
depth ++;
|
||||
else if (*ptr == '}')
|
||||
while (*ptr != quote && *ptr)
|
||||
{
|
||||
depth --;
|
||||
if (!depth)
|
||||
{
|
||||
ptr ++;
|
||||
if (*ptr == '\\' && ptr[1])
|
||||
_cups_strcpy(ptr, ptr + 1);
|
||||
|
||||
if (*ptr != ',')
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (*ptr == '\\')
|
||||
ptr ++;
|
||||
}
|
||||
|
||||
if (*ptr)
|
||||
_cups_strcpy(ptr, ptr + 1);
|
||||
|
||||
if (*ptr != '\0')
|
||||
*ptr++ = '\0';
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* Normal space-delimited string...
|
||||
*/
|
||||
|
||||
value = ptr;
|
||||
|
||||
while (!isspace(*ptr & 255) && *ptr != '\0')
|
||||
}
|
||||
else if (*ptr == '{')
|
||||
{
|
||||
if (*ptr == '\\')
|
||||
_cups_strcpy(ptr, ptr + 1);
|
||||
/*
|
||||
* Collection value...
|
||||
*/
|
||||
|
||||
ptr ++;
|
||||
int depth;
|
||||
|
||||
for (depth = 0; *ptr; ptr ++)
|
||||
{
|
||||
if (*ptr == '{')
|
||||
depth ++;
|
||||
else if (*ptr == '}')
|
||||
{
|
||||
depth --;
|
||||
if (!depth)
|
||||
{
|
||||
ptr ++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (*ptr == '\\' && ptr[1])
|
||||
_cups_strcpy(ptr, ptr + 1);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* Normal space-delimited string...
|
||||
*/
|
||||
|
||||
while (!isspace(*ptr & 255) && *ptr)
|
||||
{
|
||||
if (*ptr == '\\' && ptr[1])
|
||||
_cups_strcpy(ptr, ptr + 1);
|
||||
|
||||
ptr ++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (*ptr != '\0')
|
||||
*ptr++ = '\0';
|
||||
|
||||
DEBUG_printf(("cupsParseOptions: value=\"%s\"\n", value));
|
||||
|
||||
/*
|
||||
* Skip trailing whitespace...
|
||||
*/
|
||||
|
||||
while (isspace(*ptr & 255))
|
||||
*ptr++ = '\0';
|
||||
ptr ++;
|
||||
|
||||
/*
|
||||
* Add the string value...
|
||||
@@ -647,6 +694,8 @@ cupsParseOptions(
|
||||
|
||||
free(copyarg);
|
||||
|
||||
DEBUG_printf(("cupsParseOptions: Returning %d\n", num_options));
|
||||
|
||||
return (num_options);
|
||||
}
|
||||
|
||||
@@ -667,12 +716,18 @@ cupsRemoveOption(
|
||||
cups_option_t *option; /* Current option */
|
||||
|
||||
|
||||
DEBUG_printf(("cupsRemoveOption(name=\"%s\", num_options=%d, options=%p)\n",
|
||||
name, num_options, options));
|
||||
|
||||
/*
|
||||
* Range check input...
|
||||
*/
|
||||
|
||||
if (!name || num_options < 1 || !options)
|
||||
{
|
||||
DEBUG_printf(("cupsRemoveOption: Returning %d\n", num_options));
|
||||
return (num_options);
|
||||
}
|
||||
|
||||
/*
|
||||
* Loop for the option...
|
||||
@@ -688,6 +743,8 @@ cupsRemoveOption(
|
||||
* Remove this option from the array...
|
||||
*/
|
||||
|
||||
DEBUG_puts("cupsRemoveOption: Found option, removing it...");
|
||||
|
||||
num_options --;
|
||||
i --;
|
||||
|
||||
@@ -703,6 +760,7 @@ cupsRemoveOption(
|
||||
* Return the new number of options...
|
||||
*/
|
||||
|
||||
DEBUG_printf(("cupsRemoveOption: Returning %d\n", num_options));
|
||||
return (num_options);
|
||||
}
|
||||
|
||||
|
||||
+121
-88
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* PPD file routines for the Common UNIX Printing System (CUPS).
|
||||
*
|
||||
* Copyright 2007 by Apple Inc.
|
||||
* Copyright 2007-2008 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -454,6 +454,9 @@ ppdOpen2(cups_file_t *fp) /* I - File to read from */
|
||||
cups_encoding_t encoding; /* Encoding of PPD file */
|
||||
_cups_globals_t *cg = _cupsGlobals();
|
||||
/* Global data */
|
||||
char custom_name[PPD_MAX_NAME];
|
||||
/* CustomFoo attribute name */
|
||||
ppd_attr_t *custom_attr; /* CustomFoo attribute */
|
||||
static const char * const ui_keywords[] =
|
||||
{
|
||||
#ifdef CUPS_USE_FULL_UI_KEYWORDS_LIST
|
||||
@@ -620,11 +623,8 @@ ppdOpen2(cups_file_t *fp) /* I - File to read from */
|
||||
puts("");
|
||||
#endif /* DEBUG */
|
||||
|
||||
if (strcmp(keyword, "CloseUI") && strcmp(keyword, "CloseGroup") &&
|
||||
strcmp(keyword, "CloseSubGroup") && strncmp(keyword, "Default", 7) &&
|
||||
strcmp(keyword, "JCLCloseUI") && strcmp(keyword, "JCLOpenUI") &&
|
||||
strcmp(keyword, "OpenUI") && strcmp(keyword, "OpenGroup") &&
|
||||
strcmp(keyword, "OpenSubGroup") && string == NULL)
|
||||
if (strncmp(keyword, "Default", 7) && !string &&
|
||||
cg->ppd_conform != PPD_CONFORM_RELAXED)
|
||||
{
|
||||
/*
|
||||
* Need a string value!
|
||||
@@ -811,6 +811,13 @@ ppdOpen2(cups_file_t *fp) /* I - File to read from */
|
||||
profile = realloc(ppd->profiles, sizeof(ppd_profile_t) *
|
||||
(ppd->num_profiles + 1));
|
||||
|
||||
if (!profile)
|
||||
{
|
||||
cg->ppd_status = PPD_ALLOC_ERROR;
|
||||
|
||||
goto error;
|
||||
}
|
||||
|
||||
ppd->profiles = profile;
|
||||
profile += ppd->num_profiles;
|
||||
ppd->num_profiles ++;
|
||||
@@ -1005,44 +1012,14 @@ ppdOpen2(cups_file_t *fp) /* I - File to read from */
|
||||
}
|
||||
else if (!strncmp(keyword, "Custom", 6) && !strcmp(name, "True") && !option)
|
||||
{
|
||||
ppd_option_t *custom_option; /* Custom option */
|
||||
|
||||
DEBUG_puts("Processing Custom option...");
|
||||
|
||||
/*
|
||||
* Get the option and custom option...
|
||||
*/
|
||||
|
||||
if ((option = ppdFindOption(ppd, keyword + 6)) == NULL)
|
||||
{
|
||||
int groupidx = -1; /* Index for current group */
|
||||
ppd_group_t *gtemp; /* Temporary group */
|
||||
|
||||
|
||||
DEBUG_printf(("%s option not found for %s...\n", keyword + 6, keyword));
|
||||
|
||||
if (group)
|
||||
groupidx = group - ppd->groups; /* Save index for current group */
|
||||
|
||||
if ((gtemp = ppd_get_group(ppd, "General", _("General"), cg,
|
||||
encoding)) == NULL)
|
||||
{
|
||||
DEBUG_puts("Unable to get general group!");
|
||||
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (group)
|
||||
group = ppd->groups + groupidx; /* Restore group pointer */
|
||||
|
||||
if ((option = ppd_get_option(gtemp, keyword + 6)) == NULL)
|
||||
{
|
||||
DEBUG_printf(("Unable to get %s option!\n", keyword + 6));
|
||||
|
||||
cg->ppd_status = PPD_ALLOC_ERROR;
|
||||
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
|
||||
if (!ppd_get_coption(ppd, keyword + 6))
|
||||
{
|
||||
cg->ppd_status = PPD_ALLOC_ERROR;
|
||||
@@ -1050,74 +1027,70 @@ ppdOpen2(cups_file_t *fp) /* I - File to read from */
|
||||
goto error;
|
||||
}
|
||||
|
||||
/*
|
||||
* Add the "custom" option...
|
||||
*/
|
||||
if (option && !strcasecmp(option->keyword, keyword + 6))
|
||||
custom_option = option;
|
||||
else
|
||||
custom_option = ppdFindOption(ppd, keyword + 6);
|
||||
|
||||
if ((choice = ppd_add_choice(option, "Custom")) == NULL)
|
||||
if (custom_option)
|
||||
{
|
||||
DEBUG_puts("Unable to add Custom choice!");
|
||||
/*
|
||||
* Add the "custom" option...
|
||||
*/
|
||||
|
||||
cg->ppd_status = PPD_ALLOC_ERROR;
|
||||
if ((choice = ppdFindChoice(custom_option, "Custom")) == NULL)
|
||||
if ((choice = ppd_add_choice(custom_option, "Custom")) == NULL)
|
||||
{
|
||||
DEBUG_puts("Unable to add Custom choice!");
|
||||
|
||||
goto error;
|
||||
cg->ppd_status = PPD_ALLOC_ERROR;
|
||||
|
||||
goto error;
|
||||
}
|
||||
|
||||
strlcpy(choice->text, text[0] ? text : _("Custom"),
|
||||
sizeof(choice->text));
|
||||
|
||||
choice->code = strdup(string);
|
||||
|
||||
if (custom_option->section == PPD_ORDER_JCL)
|
||||
ppd_decode(choice->code);
|
||||
}
|
||||
|
||||
strlcpy(choice->text, text[0] ? text : _("Custom"),
|
||||
sizeof(choice->text));
|
||||
|
||||
choice->code = string;
|
||||
string = NULL; /* Don't add as an attribute below */
|
||||
option = NULL;
|
||||
|
||||
/*
|
||||
* Now process custom page sizes specially...
|
||||
*/
|
||||
|
||||
if (!strcmp(keyword, "CustomPageSize"))
|
||||
{
|
||||
ppd->variable_sizes = 1;
|
||||
|
||||
/*
|
||||
* Add a "Custom" page size entry...
|
||||
*/
|
||||
|
||||
ppd->variable_sizes = 1;
|
||||
|
||||
ppd_add_size(ppd, "Custom");
|
||||
|
||||
if ((option = ppdFindOption(ppd, "PageRegion")) == NULL)
|
||||
if (option && !strcasecmp(option->keyword, "PageRegion"))
|
||||
custom_option = option;
|
||||
else
|
||||
custom_option = ppdFindOption(ppd, "PageRegion");
|
||||
|
||||
if (custom_option)
|
||||
{
|
||||
int groupidx = -1; /* Index to current group */
|
||||
ppd_group_t *gtemp; /* Temporary group */
|
||||
if ((choice = ppdFindChoice(custom_option, "Custom")) == NULL)
|
||||
if ((choice = ppd_add_choice(custom_option, "Custom")) == NULL)
|
||||
{
|
||||
DEBUG_puts("Unable to add Custom choice!");
|
||||
|
||||
if (group)
|
||||
groupidx = group - ppd->groups; /* Save index for current group */
|
||||
cg->ppd_status = PPD_ALLOC_ERROR;
|
||||
|
||||
if ((gtemp = ppd_get_group(ppd, "General", _("General"), cg,
|
||||
encoding)) == NULL)
|
||||
{
|
||||
DEBUG_puts("Unable to get general group!");
|
||||
goto error;
|
||||
}
|
||||
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (group)
|
||||
group = ppd->groups + groupidx; /* Restore group pointer */
|
||||
|
||||
option = ppd_get_option(gtemp, "PageRegion");
|
||||
strlcpy(choice->text, text[0] ? text : _("Custom"),
|
||||
sizeof(choice->text));
|
||||
}
|
||||
|
||||
if ((choice = ppd_add_choice(option, "Custom")) == NULL)
|
||||
{
|
||||
DEBUG_puts("Unable to add Custom choice!");
|
||||
|
||||
cg->ppd_status = PPD_ALLOC_ERROR;
|
||||
|
||||
goto error;
|
||||
}
|
||||
|
||||
strlcpy(choice->text, text[0] ? text : _("Custom"),
|
||||
sizeof(choice->text));
|
||||
option = NULL;
|
||||
}
|
||||
}
|
||||
else if (!strcmp(keyword, "LandscapeOrientation"))
|
||||
@@ -1127,7 +1100,7 @@ ppdOpen2(cups_file_t *fp) /* I - File to read from */
|
||||
else if (!strcmp(string, "Plus90"))
|
||||
ppd->landscape = 90;
|
||||
}
|
||||
else if (!strcmp(keyword, "Emulators"))
|
||||
else if (!strcmp(keyword, "Emulators") && string)
|
||||
{
|
||||
for (count = 1, sptr = string; sptr != NULL;)
|
||||
if ((sptr = strchr(sptr, ' ')) != NULL)
|
||||
@@ -1138,7 +1111,12 @@ ppdOpen2(cups_file_t *fp) /* I - File to read from */
|
||||
}
|
||||
|
||||
ppd->num_emulations = count;
|
||||
ppd->emulations = calloc(count, sizeof(ppd_emul_t));
|
||||
if ((ppd->emulations = calloc(count, sizeof(ppd_emul_t))) == NULL)
|
||||
{
|
||||
cg->ppd_status = PPD_ALLOC_ERROR;
|
||||
|
||||
goto error;
|
||||
}
|
||||
|
||||
for (i = 0, sptr = string; i < count; i ++)
|
||||
{
|
||||
@@ -1300,6 +1278,34 @@ ppdOpen2(cups_file_t *fp) /* I - File to read from */
|
||||
|
||||
ppd_free(string);
|
||||
string = NULL;
|
||||
|
||||
/*
|
||||
* Add a custom option choice if we have already seen a CustomFoo
|
||||
* attribute...
|
||||
*/
|
||||
|
||||
if (!strcasecmp(name, "PageRegion"))
|
||||
strcpy(custom_name, "CustomPageSize");
|
||||
else
|
||||
snprintf(custom_name, sizeof(custom_name), "Custom%s", name);
|
||||
|
||||
if ((custom_attr = ppdFindAttr(ppd, custom_name, "True")) != NULL)
|
||||
{
|
||||
if ((choice = ppdFindChoice(option, "Custom")) == NULL)
|
||||
if ((choice = ppd_add_choice(option, "Custom")) == NULL)
|
||||
{
|
||||
DEBUG_puts("Unable to add Custom choice!");
|
||||
|
||||
cg->ppd_status = PPD_ALLOC_ERROR;
|
||||
|
||||
goto error;
|
||||
}
|
||||
|
||||
strlcpy(choice->text,
|
||||
custom_attr->text[0] ? custom_attr->text : _("Custom"),
|
||||
sizeof(choice->text));
|
||||
choice->code = strdup(custom_attr->value);
|
||||
}
|
||||
}
|
||||
else if (!strcmp(keyword, "JCLOpenUI"))
|
||||
{
|
||||
@@ -1379,6 +1385,30 @@ ppdOpen2(cups_file_t *fp) /* I - File to read from */
|
||||
|
||||
ppd_free(string);
|
||||
string = NULL;
|
||||
|
||||
/*
|
||||
* Add a custom option choice if we have already seen a CustomFoo
|
||||
* attribute...
|
||||
*/
|
||||
|
||||
snprintf(custom_name, sizeof(custom_name), "Custom%s", name);
|
||||
|
||||
if ((custom_attr = ppdFindAttr(ppd, custom_name, "True")) != NULL)
|
||||
{
|
||||
if ((choice = ppd_add_choice(option, "Custom")) == NULL)
|
||||
{
|
||||
DEBUG_puts("Unable to add Custom choice!");
|
||||
|
||||
cg->ppd_status = PPD_ALLOC_ERROR;
|
||||
|
||||
goto error;
|
||||
}
|
||||
|
||||
strlcpy(choice->text,
|
||||
custom_attr->text[0] ? custom_attr->text : _("Custom"),
|
||||
sizeof(choice->text));
|
||||
choice->code = strdup(custom_attr->value);
|
||||
}
|
||||
}
|
||||
else if (!strcmp(keyword, "CloseUI") || !strcmp(keyword, "JCLCloseUI"))
|
||||
{
|
||||
@@ -1851,7 +1881,12 @@ ppdOpen2(cups_file_t *fp) /* I - File to read from */
|
||||
* Add the option choice...
|
||||
*/
|
||||
|
||||
choice = ppd_add_choice(option, name);
|
||||
if ((choice = ppd_add_choice(option, name)) == NULL)
|
||||
{
|
||||
cg->ppd_status = PPD_ALLOC_ERROR;
|
||||
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (text[0])
|
||||
cupsCharsetToUTF8((cups_utf8_t *)choice->text, text,
|
||||
@@ -2833,8 +2868,6 @@ ppd_read(cups_file_t *fp, /* I - File to read from */
|
||||
if (ch == 0x0a)
|
||||
cupsFileGetChar(fp);
|
||||
}
|
||||
|
||||
ch = '\n';
|
||||
}
|
||||
else if (ch < ' ' && ch != '\t' && cg->ppd_conform == PPD_CONFORM_STRICT)
|
||||
{
|
||||
|
||||
+16
-15
@@ -17,6 +17,7 @@
|
||||
* Contents:
|
||||
*
|
||||
* cupsDoFileRequest() - Do an IPP request with a file.
|
||||
* cupsDoIORequest() - Do an IPP request with file descriptors.
|
||||
* cupsDoRequest() - Do an IPP request.
|
||||
* _cupsSetError() - Set the last IPP status code and status-message.
|
||||
* _cupsSetHTTPError() - Set the last error using the HTTP status.
|
||||
@@ -122,9 +123,9 @@ cupsDoIORequest(http_t *http, /* I - HTTP connection to server */
|
||||
http_status_t expect; /* Expect: header to use */
|
||||
|
||||
|
||||
DEBUG_printf(("cupsDoFileRequest(%p, %p, \'%s\', \'%s\')\n",
|
||||
http, request, resource ? resource : "(null)",
|
||||
filename ? filename : "(null)"));
|
||||
DEBUG_printf(("cupsDoFileRequest(%p, %p, \'%s\', %d, %d)\n",
|
||||
http, request, resource ? resource : "(null)", infile,
|
||||
outfile));
|
||||
|
||||
if (http == NULL || request == NULL || resource == NULL)
|
||||
{
|
||||
@@ -197,7 +198,7 @@ cupsDoIORequest(http_t *http, /* I - HTTP connection to server */
|
||||
|
||||
while (response == NULL)
|
||||
{
|
||||
DEBUG_puts("cupsDoFileRequest: setup...");
|
||||
DEBUG_puts("cupsDoIORequest: setup...");
|
||||
|
||||
/*
|
||||
* Setup the HTTP variables needed...
|
||||
@@ -220,13 +221,13 @@ cupsDoIORequest(http_t *http, /* I - HTTP connection to server */
|
||||
httpSetField(http, HTTP_FIELD_AUTHORIZATION, http->authstring);
|
||||
httpSetExpect(http, expect);
|
||||
|
||||
DEBUG_printf(("cupsDoFileRequest: authstring=\"%s\"\n", http->authstring));
|
||||
DEBUG_printf(("cupsDoIORequest: authstring=\"%s\"\n", http->authstring));
|
||||
|
||||
/*
|
||||
* Try the request...
|
||||
*/
|
||||
|
||||
DEBUG_puts("cupsDoFileRequest: post...");
|
||||
DEBUG_puts("cupsDoIORequest: post...");
|
||||
|
||||
if (httpPost(http, resource))
|
||||
{
|
||||
@@ -243,7 +244,7 @@ cupsDoIORequest(http_t *http, /* I - HTTP connection to server */
|
||||
* Send the IPP data...
|
||||
*/
|
||||
|
||||
DEBUG_puts("cupsDoFileRequest: ipp write...");
|
||||
DEBUG_puts("cupsDoIORequest: ipp write...");
|
||||
|
||||
request->state = IPP_IDLE;
|
||||
status = HTTP_CONTINUE;
|
||||
@@ -274,7 +275,7 @@ cupsDoIORequest(http_t *http, /* I - HTTP connection to server */
|
||||
|
||||
if (status == HTTP_CONTINUE && state == IPP_DATA && infile >= 0)
|
||||
{
|
||||
DEBUG_puts("cupsDoFileRequest: file write...");
|
||||
DEBUG_puts("cupsDoIORequest: file write...");
|
||||
|
||||
/*
|
||||
* Send the file...
|
||||
@@ -302,16 +303,16 @@ cupsDoIORequest(http_t *http, /* I - HTTP connection to server */
|
||||
* Get the server's return status...
|
||||
*/
|
||||
|
||||
DEBUG_puts("cupsDoFileRequest: update...");
|
||||
DEBUG_puts("cupsDoIORequest: update...");
|
||||
|
||||
while (status == HTTP_CONTINUE)
|
||||
status = httpUpdate(http);
|
||||
|
||||
DEBUG_printf(("cupsDoFileRequest: status = %d\n", status));
|
||||
DEBUG_printf(("cupsDoIORequest: status = %d\n", status));
|
||||
|
||||
if (status == HTTP_UNAUTHORIZED)
|
||||
{
|
||||
DEBUG_puts("cupsDoFileRequest: unauthorized...");
|
||||
DEBUG_puts("cupsDoIORequest: unauthorized...");
|
||||
|
||||
/*
|
||||
* Flush any error message...
|
||||
@@ -336,7 +337,7 @@ cupsDoIORequest(http_t *http, /* I - HTTP connection to server */
|
||||
}
|
||||
else if (status == HTTP_ERROR)
|
||||
{
|
||||
DEBUG_printf(("cupsDoFileRequest: http->error=%d (%s)\n", http->error,
|
||||
DEBUG_printf(("cupsDoIORequest: http->error=%d (%s)\n", http->error,
|
||||
strerror(http->error)));
|
||||
|
||||
#ifdef WIN32
|
||||
@@ -380,7 +381,7 @@ cupsDoIORequest(http_t *http, /* I - HTTP connection to server */
|
||||
}
|
||||
else if (status != HTTP_OK)
|
||||
{
|
||||
DEBUG_printf(("cupsDoFileRequest: error %d...\n", status));
|
||||
DEBUG_printf(("cupsDoIORequest: error %d...\n", status));
|
||||
|
||||
/*
|
||||
* Flush any error message...
|
||||
@@ -395,7 +396,7 @@ cupsDoIORequest(http_t *http, /* I - HTTP connection to server */
|
||||
* Read the response...
|
||||
*/
|
||||
|
||||
DEBUG_puts("cupsDoFileRequest: response...");
|
||||
DEBUG_puts("cupsDoIORequest: response...");
|
||||
|
||||
response = ippNew();
|
||||
|
||||
@@ -475,7 +476,7 @@ cupsDoRequest(http_t *http, /* I - HTTP connection to server */
|
||||
ipp_t *request, /* I - IPP request */
|
||||
const char *resource) /* I - HTTP resource for POST */
|
||||
{
|
||||
return (cupsDoFileRequest(http, request, resource, NULL));
|
||||
return (cupsDoIORequest(http, request, resource, -1, -1));
|
||||
}
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -613,7 +613,7 @@ _cups_strcasecmp(const char *s, /* I - First string */
|
||||
#ifndef HAVE_STRNCASECMP
|
||||
int /* O - Result of comparison (-1, 0, or 1) */
|
||||
_cups_strncasecmp(const char *s, /* I - First string */
|
||||
vconst char *t, /* I - Second string */
|
||||
const char *t, /* I - Second string */
|
||||
size_t n) /* I - Maximum number of characters to compare */
|
||||
{
|
||||
while (*s != '\0' && *t != '\0' && n > 0)
|
||||
|
||||
+14
-1
@@ -134,7 +134,8 @@
|
||||
*CloseUI: *StringOption
|
||||
|
||||
*CustomStringOption True/Custom String: "StringOption=Custom"
|
||||
*ParamCustomStringOption String: 1 string 1 10
|
||||
*ParamCustomStringOption String1: 2 string 1 10
|
||||
*ParamCustomStringOption String2: 1 string 1 10
|
||||
|
||||
*CloseGroup: Extended
|
||||
|
||||
@@ -149,6 +150,18 @@ http://foo/fr/bar.html
|
||||
help:anchor='foo'%20bookID=Vendor%20Help
|
||||
/help/fr/foo/bar.html"
|
||||
*End
|
||||
*zh_TW.cupsIPPReason foo/Number 1 Foo Reason: "text:Number%201
|
||||
text:Foo%20Reason
|
||||
http://foo/zh_TW/bar.html
|
||||
help:anchor='foo'%20bookID=Vendor%20Help
|
||||
/help/zh_TW/foo/bar.html"
|
||||
*End
|
||||
*zh.cupsIPPReason foo/Number 2 Foo Reason: "text:Number%202
|
||||
text:Foo%20Reason
|
||||
http://foo/zh/bar.html
|
||||
help:anchor='foo'%20bookID=Vendor%20Help
|
||||
/help/zh/foo/bar.html"
|
||||
*End
|
||||
|
||||
*DefaultFont: Courier
|
||||
*Font AvantGarde-Book: Standard "(001.006S)" Standard ROM
|
||||
|
||||
+1
-1
@@ -61,7 +61,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
|
||||
if (argc > 1)
|
||||
{
|
||||
for (i = 1, num_settings = 0; i < argc; i ++)
|
||||
for (i = 1, num_settings = 0, settings = NULL; i < argc; i ++)
|
||||
num_settings = cupsParseOptions(argv[i], num_settings, &settings);
|
||||
|
||||
if (cupsAdminSetServerSettings(http, num_settings, settings))
|
||||
|
||||
+4
-5
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* CUPS API test program for the Common UNIX Printing System (CUPS).
|
||||
*
|
||||
* Copyright 2007 by Apple Inc.
|
||||
* Copyright 2007-2008 by Apple Inc.
|
||||
* Copyright 2007 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -70,8 +70,7 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
printf("cupsGetDest(\"%s\"): ", dests[num_dests / 2].name);
|
||||
fflush(stdout);
|
||||
|
||||
if ((dest = cupsGetDest(dests[num_dests / 2].name, NULL, num_dests,
|
||||
dests)) == NULL)
|
||||
if (!cupsGetDest(dests[num_dests / 2].name, NULL, num_dests, dests))
|
||||
{
|
||||
status = 1;
|
||||
puts("FAIL");
|
||||
@@ -88,8 +87,8 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
|
||||
if ((dest = cupsGetDest(NULL, NULL, num_dests, dests)) == NULL)
|
||||
{
|
||||
status = 1;
|
||||
puts("FAIL");
|
||||
return (1);
|
||||
}
|
||||
else
|
||||
puts("PASS");
|
||||
@@ -104,8 +103,8 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
if (cupsPrintFile(dest->name, "../data/testprint.ps", "Test Page",
|
||||
dest->num_options, dest->options) <= 0)
|
||||
{
|
||||
status = 1;
|
||||
puts("FAIL");
|
||||
return (1);
|
||||
}
|
||||
else
|
||||
puts("PASS");
|
||||
|
||||
+312
-26
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* File test program for the Common UNIX Printing System (CUPS).
|
||||
*
|
||||
* Copyright 2007 by Apple Inc.
|
||||
* Copyright 2007-2008 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -16,7 +16,8 @@
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
* main() - Main entry.
|
||||
* main() - Main entry.
|
||||
* read_write_tests() - Perform read/write tests.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -33,12 +34,14 @@
|
||||
#ifdef HAVE_LIBZ
|
||||
# include <zlib.h>
|
||||
#endif /* HAVE_LIBZ */
|
||||
#include <fcntl.h>
|
||||
|
||||
|
||||
/*
|
||||
* Local functions...
|
||||
*/
|
||||
|
||||
static int random_tests(void);
|
||||
static int read_write_tests(int compression);
|
||||
|
||||
|
||||
@@ -50,8 +53,10 @@ int /* O - Exit status */
|
||||
main(int argc, /* I - Number of command-line arguments */
|
||||
char *argv[]) /* I - Command-line arguments */
|
||||
{
|
||||
int status; /* Exit status */
|
||||
char filename[1024]; /* Filename buffer */
|
||||
int status; /* Exit status */
|
||||
char filename[1024]; /* Filename buffer */
|
||||
int fds[2]; /* Open file descriptors */
|
||||
cups_file_t *fdfile; /* File opened with cupsFileOpenFd() */
|
||||
|
||||
|
||||
if (argc == 1)
|
||||
@@ -72,11 +77,51 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
status += read_write_tests(1);
|
||||
#endif /* HAVE_LIBZ */
|
||||
|
||||
/*
|
||||
* Do uncompressed random I/O tests...
|
||||
*/
|
||||
|
||||
status += random_tests();
|
||||
|
||||
/*
|
||||
* Test fdopen and close without reading...
|
||||
*/
|
||||
|
||||
pipe(fds);
|
||||
close(fds[1]);
|
||||
|
||||
fputs("\ncupsFileOpenFd(fd, \"r\"): ", stdout);
|
||||
fflush(stdout);
|
||||
|
||||
if ((fdfile = cupsFileOpenFd(fds[0], "r")) == NULL)
|
||||
{
|
||||
puts("FAIL");
|
||||
status ++;
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* Able to open file, now close without reading. If we don't return
|
||||
* before the alarm fires, that is a failure and we will crash on the
|
||||
* alarm signal...
|
||||
*/
|
||||
|
||||
puts("PASS");
|
||||
fputs("cupsFileClose(no read): ", stdout);
|
||||
fflush(stdout);
|
||||
|
||||
alarm(5);
|
||||
cupsFileClose(fdfile);
|
||||
alarm(0);
|
||||
|
||||
puts("PASS");
|
||||
}
|
||||
|
||||
/*
|
||||
* Test path functions...
|
||||
*/
|
||||
|
||||
fputs("cupsFileFind: ", stdout);
|
||||
fputs("\ncupsFileFind: ", stdout);
|
||||
#ifdef WIN32
|
||||
if (cupsFileFind("notepad.exe", "C:/WINDOWS", 1, filename, sizeof(filename)) &&
|
||||
cupsFileFind("notepad.exe", "C:/WINDOWS;C:/WINDOWS/SYSTEM32", 1, filename, sizeof(filename)))
|
||||
@@ -133,6 +178,190 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'random_tests()' - Do random access tests.
|
||||
*/
|
||||
|
||||
static int /* O - Status */
|
||||
random_tests(void)
|
||||
{
|
||||
int status, /* Status of tests */
|
||||
pass, /* Current pass */
|
||||
count, /* Number of records read */
|
||||
record, /* Current record */
|
||||
num_records; /* Number of records */
|
||||
ssize_t pos, /* Position in file */
|
||||
expected; /* Expected position in file */
|
||||
cups_file_t *fp; /* File */
|
||||
char buffer[512]; /* Data buffer */
|
||||
|
||||
|
||||
/*
|
||||
* Run 4 passes, each time appending to a data file and then reopening the
|
||||
* file for reading to validate random records in the file.
|
||||
*/
|
||||
|
||||
for (status = 0, pass = 0; pass < 4; pass ++)
|
||||
{
|
||||
/*
|
||||
* cupsFileOpen(append)
|
||||
*/
|
||||
|
||||
printf("\ncupsFileOpen(append %d): ", pass);
|
||||
|
||||
if ((fp = cupsFileOpen("testfile.dat", "a")) == NULL)
|
||||
{
|
||||
printf("FAIL (%s)\n", strerror(errno));
|
||||
status ++;
|
||||
break;
|
||||
}
|
||||
else
|
||||
puts("PASS");
|
||||
|
||||
/*
|
||||
* cupsFileTell()
|
||||
*/
|
||||
|
||||
expected = 256 * sizeof(buffer) * pass;
|
||||
|
||||
fputs("cupsFileTell(): ", stdout);
|
||||
if ((pos = cupsFileTell(fp)) != expected)
|
||||
{
|
||||
printf("FAIL (" CUPS_LLFMT " instead of " CUPS_LLFMT ")\n",
|
||||
CUPS_LLCAST pos, CUPS_LLCAST expected);
|
||||
status ++;
|
||||
break;
|
||||
}
|
||||
else
|
||||
puts("PASS");
|
||||
|
||||
/*
|
||||
* cupsFileWrite()
|
||||
*/
|
||||
|
||||
fputs("cupsFileWrite(256 512-byte records): ", stdout);
|
||||
for (record = 0; record < 256; record ++)
|
||||
{
|
||||
memset(buffer, record, sizeof(buffer));
|
||||
if (cupsFileWrite(fp, buffer, sizeof(buffer)) < sizeof(buffer))
|
||||
break;
|
||||
}
|
||||
|
||||
if (record < 256)
|
||||
{
|
||||
printf("FAIL (%d: %s)\n", record, strerror(errno));
|
||||
status ++;
|
||||
break;
|
||||
}
|
||||
else
|
||||
puts("PASS");
|
||||
|
||||
/*
|
||||
* cupsFileTell()
|
||||
*/
|
||||
|
||||
expected += 256 * sizeof(buffer);
|
||||
|
||||
fputs("cupsFileTell(): ", stdout);
|
||||
if ((pos = cupsFileTell(fp)) != expected)
|
||||
{
|
||||
printf("FAIL (" CUPS_LLFMT " instead of " CUPS_LLFMT ")\n",
|
||||
CUPS_LLCAST pos, CUPS_LLCAST expected);
|
||||
status ++;
|
||||
break;
|
||||
}
|
||||
else
|
||||
puts("PASS");
|
||||
|
||||
cupsFileClose(fp);
|
||||
|
||||
/*
|
||||
* cupsFileOpen(read)
|
||||
*/
|
||||
|
||||
printf("\ncupsFileOpen(read %d): ", pass);
|
||||
|
||||
if ((fp = cupsFileOpen("testfile.dat", "r")) == NULL)
|
||||
{
|
||||
printf("FAIL (%s)\n", strerror(errno));
|
||||
status ++;
|
||||
break;
|
||||
}
|
||||
else
|
||||
puts("PASS");
|
||||
|
||||
/*
|
||||
* cupsFileSeek, cupsFileRead
|
||||
*/
|
||||
|
||||
fputs("cupsFileSeek(), cupsFileRead(): ", stdout);
|
||||
|
||||
for (num_records = (pass + 1) * 256, count = (pass + 1) * 256,
|
||||
record = rand() % num_records;
|
||||
count > 0;
|
||||
count --, record = (record + (rand() & 31) - 16 + num_records) %
|
||||
num_records)
|
||||
{
|
||||
/*
|
||||
* The last record is always the first...
|
||||
*/
|
||||
|
||||
if (count == 1)
|
||||
record = 0;
|
||||
|
||||
/*
|
||||
* Try reading the data for the specified record, and validate the
|
||||
* contents...
|
||||
*/
|
||||
|
||||
expected = sizeof(buffer) * record;
|
||||
|
||||
if ((pos = cupsFileSeek(fp, expected)) != expected)
|
||||
{
|
||||
printf("FAIL (" CUPS_LLFMT " instead of " CUPS_LLFMT ")\n",
|
||||
CUPS_LLCAST pos, CUPS_LLCAST expected);
|
||||
status ++;
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (cupsFileRead(fp, buffer, sizeof(buffer)) != sizeof(buffer))
|
||||
{
|
||||
printf("FAIL (%s)\n", strerror(errno));
|
||||
status ++;
|
||||
break;
|
||||
}
|
||||
else if ((buffer[0] & 255) != (record & 255) ||
|
||||
memcmp(buffer, buffer + 1, sizeof(buffer) - 1))
|
||||
{
|
||||
printf("FAIL (Bad Data - %d instead of %d)\n", buffer[0] & 255,
|
||||
record & 255);
|
||||
status ++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (count == 0)
|
||||
puts("PASS");
|
||||
|
||||
cupsFileClose(fp);
|
||||
}
|
||||
|
||||
/*
|
||||
* Remove the test file...
|
||||
*/
|
||||
|
||||
unlink("testfile.dat");
|
||||
|
||||
/*
|
||||
* Return the test status...
|
||||
*/
|
||||
|
||||
return (status);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'read_write_tests()' - Perform read/write tests.
|
||||
*/
|
||||
@@ -141,7 +370,7 @@ static int /* O - Status */
|
||||
read_write_tests(int compression) /* I - Use compression? */
|
||||
{
|
||||
int i; /* Looping var */
|
||||
cups_file_t *fp; /* First file */
|
||||
cups_file_t *fp; /* File */
|
||||
int status; /* Exit status */
|
||||
char line[1024], /* Line from file */
|
||||
*value; /* Directive value from line */
|
||||
@@ -149,6 +378,9 @@ read_write_tests(int compression) /* I - Use compression? */
|
||||
unsigned char readbuf[8192], /* Read buffer */
|
||||
writebuf[8192]; /* Write buffer */
|
||||
int byte; /* Byte from file */
|
||||
off_t length; /* Length of file */
|
||||
static const char *partial_line = "partial line";
|
||||
/* Partial line */
|
||||
|
||||
|
||||
/*
|
||||
@@ -218,7 +450,7 @@ read_write_tests(int compression) /* I - Use compression? */
|
||||
fputs("cupsFilePrintf(): ", stdout);
|
||||
|
||||
for (i = 0; i < 1000; i ++)
|
||||
if (cupsFilePrintf(fp, "TestLine %d\n", i) < 0)
|
||||
if (cupsFilePrintf(fp, "TestLine %03d\n", i) < 0)
|
||||
break;
|
||||
|
||||
if (i >= 1000)
|
||||
@@ -253,11 +485,11 @@ read_write_tests(int compression) /* I - Use compression? */
|
||||
|
||||
fputs("cupsFileWrite(): ", stdout);
|
||||
|
||||
for (i = 0; i < 100; i ++)
|
||||
for (i = 0; i < 10000; i ++)
|
||||
if (cupsFileWrite(fp, (char *)writebuf, sizeof(writebuf)) < 0)
|
||||
break;
|
||||
|
||||
if (i >= 100)
|
||||
if (i >= 10000)
|
||||
puts("PASS");
|
||||
else
|
||||
{
|
||||
@@ -265,6 +497,34 @@ read_write_tests(int compression) /* I - Use compression? */
|
||||
status ++;
|
||||
}
|
||||
|
||||
/*
|
||||
* cupsFilePuts() with partial line...
|
||||
*/
|
||||
|
||||
fputs("cupsFilePuts(\"partial line\"): ", stdout);
|
||||
|
||||
if (cupsFilePuts(fp, partial_line) > 0)
|
||||
puts("PASS");
|
||||
else
|
||||
{
|
||||
printf("FAIL (%s)\n", strerror(errno));
|
||||
status ++;
|
||||
}
|
||||
|
||||
/*
|
||||
* cupsFileTell()
|
||||
*/
|
||||
|
||||
fputs("cupsFileTell(): ", stdout);
|
||||
|
||||
if ((length = cupsFileTell(fp)) == 81933283)
|
||||
puts("PASS");
|
||||
else
|
||||
{
|
||||
printf("FAIL (" CUPS_LLFMT " instead of 81933283)\n", CUPS_LLCAST length);
|
||||
status ++;
|
||||
}
|
||||
|
||||
/*
|
||||
* cupsFileClose()
|
||||
*/
|
||||
@@ -289,7 +549,7 @@ read_write_tests(int compression) /* I - Use compression? */
|
||||
* cupsFileOpen(read)
|
||||
*/
|
||||
|
||||
fputs("cupsFileOpen(read): ", stdout);
|
||||
fputs("\ncupsFileOpen(read): ", stdout);
|
||||
|
||||
fp = cupsFileOpen(compression ? "testfile.dat.gz" : "testfile.dat", "r");
|
||||
if (fp)
|
||||
@@ -368,23 +628,9 @@ read_write_tests(int compression) /* I - Use compression? */
|
||||
|
||||
fputs("cupsFileGetChar(): ", stdout);
|
||||
|
||||
#ifdef DEBUG
|
||||
puts("\ni byte\n----- -----");
|
||||
|
||||
for (i = 0; i < 256; i ++)
|
||||
{
|
||||
byte = cupsFileGetChar(fp);
|
||||
|
||||
printf("%-5d %-5d\n", i, byte);
|
||||
|
||||
if (byte != i)
|
||||
break;
|
||||
}
|
||||
#else
|
||||
for (i = 0; i < 256; i ++)
|
||||
if ((byte = cupsFileGetChar(fp)) != i)
|
||||
break;
|
||||
#endif /* DEBUG */
|
||||
|
||||
if (i >= 256)
|
||||
puts("PASS");
|
||||
@@ -405,13 +651,13 @@ read_write_tests(int compression) /* I - Use compression? */
|
||||
|
||||
fputs("cupsFileRead(): ", stdout);
|
||||
|
||||
for (i = 0; i < 100; i ++)
|
||||
for (i = 0; i < 10000; i ++)
|
||||
if ((byte = cupsFileRead(fp, (char *)readbuf, sizeof(readbuf))) < 0)
|
||||
break;
|
||||
else if (memcmp(readbuf, writebuf, sizeof(readbuf)))
|
||||
break;
|
||||
|
||||
if (i >= 100)
|
||||
if (i >= 10000)
|
||||
puts("PASS");
|
||||
else if (byte > 0)
|
||||
{
|
||||
@@ -430,6 +676,40 @@ read_write_tests(int compression) /* I - Use compression? */
|
||||
status ++;
|
||||
}
|
||||
|
||||
/*
|
||||
* cupsFileGetChar() with partial line...
|
||||
*/
|
||||
|
||||
fputs("cupsFileGetChar(partial line): ", stdout);
|
||||
|
||||
for (i = 0; i < strlen(partial_line); i ++)
|
||||
if ((byte = cupsFileGetChar(fp)) < 0)
|
||||
break;
|
||||
else if (byte != partial_line[i])
|
||||
break;
|
||||
|
||||
if (!partial_line[i])
|
||||
puts("PASS");
|
||||
else
|
||||
{
|
||||
printf("FAIL (got '%c', expected '%c')\n", byte, partial_line[i]);
|
||||
status ++;
|
||||
}
|
||||
|
||||
/*
|
||||
* cupsFileTell()
|
||||
*/
|
||||
|
||||
fputs("cupsFileTell(): ", stdout);
|
||||
|
||||
if ((length = cupsFileTell(fp)) == 81933283)
|
||||
puts("PASS");
|
||||
else
|
||||
{
|
||||
printf("FAIL (" CUPS_LLFMT " instead of 81933283)\n", CUPS_LLCAST length);
|
||||
status ++;
|
||||
}
|
||||
|
||||
/*
|
||||
* cupsFileClose()
|
||||
*/
|
||||
@@ -450,6 +730,12 @@ read_write_tests(int compression) /* I - Use compression? */
|
||||
status ++;
|
||||
}
|
||||
|
||||
/*
|
||||
* Remove the test file...
|
||||
*/
|
||||
|
||||
unlink(compression ? "testfile.dat.gz" : "testfile.dat");
|
||||
|
||||
/*
|
||||
* Return the test status...
|
||||
*/
|
||||
|
||||
+1
-1
@@ -299,7 +299,7 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
* httpAddrGetList()
|
||||
*/
|
||||
|
||||
fputs("httpAddrGetList(): ", stdout);
|
||||
printf("httpAddrGetList(%s): ", hostname);
|
||||
|
||||
addrlist = httpAddrGetList(hostname, AF_UNSPEC, NULL);
|
||||
if (addrlist)
|
||||
|
||||
+18
-2
@@ -81,7 +81,10 @@ static const char *custom_code =
|
||||
"%%EndFeature\n"
|
||||
"} stopped cleartomark\n"
|
||||
"[{\n"
|
||||
"%%BeginFeature: *StringOption None\n"
|
||||
"%%BeginFeature: *CustomStringOption True\n"
|
||||
"(value\\0502\\051)\n"
|
||||
"(value 1)\n"
|
||||
"StringOption=Custom\n"
|
||||
"%%EndFeature\n"
|
||||
"} stopped cleartomark\n";
|
||||
|
||||
@@ -149,8 +152,9 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
if (s)
|
||||
free(s);
|
||||
|
||||
fputs("ppdEmitString (custom size): ", stdout);
|
||||
fputs("ppdEmitString (custom size and string): ", stdout);
|
||||
ppdMarkOption(ppd, "PageSize", "Custom.400x500");
|
||||
ppdMarkOption(ppd, "StringOption", "{String1=\"value 1\" String2=value(2)}");
|
||||
|
||||
if ((s = ppdEmitString(ppd, PPD_ORDER_ANY, 0.0)) != NULL &&
|
||||
!strcmp(s, custom_code))
|
||||
@@ -224,6 +228,18 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
printf("FAIL (\"%s\" instead of \"La Long Foo Reason\")\n", buffer);
|
||||
}
|
||||
|
||||
putenv("LANG=zh_TW");
|
||||
|
||||
fputs("ppdLocalizeIPPReason(zh_TW text): ", stdout);
|
||||
if (ppdLocalizeIPPReason(ppd, "foo", NULL, buffer, sizeof(buffer)) &&
|
||||
!strcmp(buffer, "Number 1 Foo Reason"))
|
||||
puts("PASS");
|
||||
else
|
||||
{
|
||||
status ++;
|
||||
printf("FAIL (\"%s\" instead of \"Number 1 Foo Reason\")\n", buffer);
|
||||
}
|
||||
|
||||
ppdClose(ppd);
|
||||
}
|
||||
else
|
||||
|
||||
+7
-13
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Transcoding support for the Common UNIX Printing System (CUPS).
|
||||
*
|
||||
* Copyright 2007 by Apple Inc.
|
||||
* Copyright 2007-2008 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -132,8 +132,6 @@ _cupsCharmapFlush(void)
|
||||
vnext = vmap->next;
|
||||
|
||||
free_vbcs_charmap(vmap);
|
||||
|
||||
free(vmap);
|
||||
}
|
||||
|
||||
vmap_cache = NULL;
|
||||
@@ -330,13 +328,8 @@ cupsCharsetToUTF8(
|
||||
|
||||
if (encoding < CUPS_ENCODING_SBCS_END)
|
||||
bytes = conv_sbcs_to_utf8(dest, (cups_sbcs_t *)src, maxout, encoding);
|
||||
else if (encoding < CUPS_ENCODING_VBCS_END)
|
||||
bytes = conv_vbcs_to_utf8(dest, (cups_sbcs_t *)src, maxout, encoding);
|
||||
else
|
||||
{
|
||||
DEBUG_puts(" Bad encoding, returning -1");
|
||||
bytes = -1;
|
||||
}
|
||||
bytes = conv_vbcs_to_utf8(dest, (cups_sbcs_t *)src, maxout, encoding);
|
||||
|
||||
#ifdef HAVE_PTHREAD_H
|
||||
pthread_mutex_unlock(&map_mutex);
|
||||
@@ -437,10 +430,8 @@ cupsUTF8ToCharset(
|
||||
|
||||
if (encoding < CUPS_ENCODING_SBCS_END)
|
||||
bytes = conv_utf8_to_sbcs((cups_sbcs_t *)dest, src, maxout, encoding);
|
||||
else if (encoding < CUPS_ENCODING_VBCS_END)
|
||||
bytes = conv_utf8_to_vbcs((cups_sbcs_t *)dest, src, maxout, encoding);
|
||||
else
|
||||
bytes = -1;
|
||||
bytes = conv_utf8_to_vbcs((cups_sbcs_t *)dest, src, maxout, encoding);
|
||||
|
||||
#ifdef HAVE_PTHREAD_H
|
||||
pthread_mutex_unlock(&map_mutex);
|
||||
@@ -1468,6 +1459,8 @@ get_vbcs_charmap(
|
||||
{
|
||||
DEBUG_puts(" Unable to get charmap count!");
|
||||
|
||||
cupsFileClose(fp);
|
||||
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
@@ -1479,9 +1472,10 @@ get_vbcs_charmap(
|
||||
|
||||
if ((vmap = (_cups_vmap_t *)calloc(1, sizeof(_cups_vmap_t))) == NULL)
|
||||
{
|
||||
cupsFileClose(fp);
|
||||
DEBUG_puts(" Unable to allocate memory!");
|
||||
|
||||
cupsFileClose(fp);
|
||||
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
|
||||
+23
-113
@@ -91,7 +91,6 @@ cupsCancelJob(const char *name, /* I - Name of printer or class */
|
||||
uri[HTTP_MAX_URI]; /* Printer URI */
|
||||
ipp_t *request, /* IPP request */
|
||||
*response; /* IPP response */
|
||||
cups_lang_t *language; /* Language info */
|
||||
_cups_globals_t *cg = _cupsGlobals(); /* Pointer to library globals */
|
||||
|
||||
|
||||
@@ -129,21 +128,7 @@ cupsCancelJob(const char *name, /* I - Name of printer or class */
|
||||
* [requesting-user-name]
|
||||
*/
|
||||
|
||||
request = ippNew();
|
||||
|
||||
request->request.op.operation_id = IPP_CANCEL_JOB;
|
||||
request->request.op.request_id = 1;
|
||||
|
||||
language = cupsLangDefault();
|
||||
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET,
|
||||
"attributes-charset", NULL, cupsLangEncoding(language));
|
||||
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE,
|
||||
"attributes-natural-language", NULL,
|
||||
language != NULL ? language->language : "C");
|
||||
|
||||
cupsLangFree(language);
|
||||
request = ippNewRequest(IPP_CANCEL_JOB);
|
||||
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri",
|
||||
NULL, uri);
|
||||
@@ -205,7 +190,6 @@ cupsGetClasses(char ***classes) /* O - Classes */
|
||||
ipp_t *request, /* IPP Request */
|
||||
*response; /* IPP Response */
|
||||
ipp_attribute_t *attr; /* Current attribute */
|
||||
cups_lang_t *language; /* Default language */
|
||||
char **temp; /* Temporary pointer */
|
||||
_cups_globals_t *cg = _cupsGlobals(); /* Pointer to library globals */
|
||||
|
||||
@@ -237,20 +221,7 @@ cupsGetClasses(char ***classes) /* O - Classes */
|
||||
* requested-attributes
|
||||
*/
|
||||
|
||||
request = ippNew();
|
||||
|
||||
request->request.op.operation_id = CUPS_GET_CLASSES;
|
||||
request->request.op.request_id = 1;
|
||||
|
||||
language = cupsLangDefault();
|
||||
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET,
|
||||
"attributes-charset", NULL, cupsLangEncoding(language));
|
||||
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE,
|
||||
"attributes-natural-language", NULL, language->language);
|
||||
|
||||
cupsLangFree(language);
|
||||
request = ippNewRequest(CUPS_GET_CLASSES);
|
||||
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD,
|
||||
"requested-attributes", NULL, "printer-name");
|
||||
@@ -371,7 +342,6 @@ cupsGetDefault2(http_t *http) /* I - HTTP connection */
|
||||
ipp_t *request, /* IPP Request */
|
||||
*response; /* IPP Response */
|
||||
ipp_attribute_t *attr; /* Current attribute */
|
||||
cups_lang_t *language; /* Default language */
|
||||
const char *var; /* Environment variable */
|
||||
_cups_globals_t *cg = _cupsGlobals(); /* Pointer to library globals */
|
||||
|
||||
@@ -403,20 +373,7 @@ cupsGetDefault2(http_t *http) /* I - HTTP connection */
|
||||
* attributes-natural-language
|
||||
*/
|
||||
|
||||
request = ippNew();
|
||||
|
||||
request->request.op.operation_id = CUPS_GET_DEFAULT;
|
||||
request->request.op.request_id = 1;
|
||||
|
||||
language = cupsLangDefault();
|
||||
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET,
|
||||
"attributes-charset", NULL, cupsLangEncoding(language));
|
||||
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE,
|
||||
"attributes-natural-language", NULL, language->language);
|
||||
|
||||
cupsLangFree(language);
|
||||
request = ippNewRequest(CUPS_GET_DEFAULT);
|
||||
|
||||
/*
|
||||
* Do the request and get back a response...
|
||||
@@ -491,7 +448,6 @@ cupsGetJobs2(http_t *http, /* I - HTTP connection */
|
||||
ipp_t *request, /* IPP Request */
|
||||
*response; /* IPP Response */
|
||||
ipp_attribute_t *attr; /* Current attribute */
|
||||
cups_lang_t *language; /* Default language */
|
||||
cups_job_t *temp; /* Temporary pointer */
|
||||
int id, /* job-id */
|
||||
priority, /* job-priority */
|
||||
@@ -564,20 +520,7 @@ cupsGetJobs2(http_t *http, /* I - HTTP connection */
|
||||
* requested-attributes
|
||||
*/
|
||||
|
||||
request = ippNew();
|
||||
|
||||
request->request.op.operation_id = IPP_GET_JOBS;
|
||||
request->request.op.request_id = 1;
|
||||
|
||||
language = cupsLangDefault();
|
||||
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET,
|
||||
"attributes-charset", NULL, cupsLangEncoding(language));
|
||||
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE,
|
||||
"attributes-natural-language", NULL, language->language);
|
||||
|
||||
cupsLangFree(language);
|
||||
request = ippNewRequest(IPP_GET_JOBS);
|
||||
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI,
|
||||
"printer-uri", NULL, uri);
|
||||
@@ -829,7 +772,7 @@ cupsGetPPD2(http_t *http, /* I - HTTP connection */
|
||||
resource, sizeof(resource), 0))
|
||||
return (NULL);
|
||||
|
||||
DEBUG_printf(("Printer hostname=\"%s\", port=%d\n", hostname, port));
|
||||
DEBUG_printf(("cupsGetPPD3: Printer hostname=\"%s\", port=%d\n", hostname, port));
|
||||
|
||||
/*
|
||||
* Remap local hostname to localhost...
|
||||
@@ -903,9 +846,6 @@ cupsGetPPD2(http_t *http, /* I - HTTP connection */
|
||||
|
||||
close(fd);
|
||||
|
||||
if (http2 != http)
|
||||
httpClose(http2);
|
||||
|
||||
/*
|
||||
* See if we actually got the file or an error...
|
||||
*/
|
||||
@@ -934,6 +874,9 @@ cupsGetPPD2(http_t *http, /* I - HTTP connection */
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
if (http2 != http)
|
||||
httpClose(http2);
|
||||
|
||||
/*
|
||||
* Return the PPD file...
|
||||
*/
|
||||
@@ -957,7 +900,6 @@ cupsGetPrinters(char ***printers) /* O - Printers */
|
||||
ipp_t *request, /* IPP Request */
|
||||
*response; /* IPP Response */
|
||||
ipp_attribute_t *attr; /* Current attribute */
|
||||
cups_lang_t *language; /* Default language */
|
||||
char **temp; /* Temporary pointer */
|
||||
_cups_globals_t *cg = _cupsGlobals(); /* Pointer to library globals */
|
||||
|
||||
@@ -989,20 +931,7 @@ cupsGetPrinters(char ***printers) /* O - Printers */
|
||||
* requested-attributes
|
||||
*/
|
||||
|
||||
request = ippNew();
|
||||
|
||||
request->request.op.operation_id = CUPS_GET_PRINTERS;
|
||||
request->request.op.request_id = 1;
|
||||
|
||||
language = cupsLangDefault();
|
||||
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET,
|
||||
"attributes-charset", NULL, cupsLangEncoding(language));
|
||||
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE,
|
||||
"attributes-natural-language", NULL, language->language);
|
||||
|
||||
cupsLangFree(language);
|
||||
request = ippNewRequest(CUPS_GET_PRINTERS);
|
||||
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD,
|
||||
"requested-attributes", NULL, "printer-name");
|
||||
@@ -1270,7 +1199,6 @@ cupsPrintFiles2(http_t *http, /* I - HTTP connection */
|
||||
ipp_t *response; /* IPP response */
|
||||
ipp_attribute_t *attr; /* IPP job-id attribute */
|
||||
char uri[HTTP_MAX_URI]; /* Printer URI */
|
||||
cups_lang_t *language; /* Language to use */
|
||||
int jobid; /* New job ID */
|
||||
const char *base; /* Basename of current filename */
|
||||
|
||||
@@ -1302,35 +1230,19 @@ cupsPrintFiles2(http_t *http, /* I - HTTP connection */
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
* Setup the request data...
|
||||
*/
|
||||
|
||||
language = cupsLangDefault();
|
||||
|
||||
/*
|
||||
* Build a standard CUPS URI for the printer and fill the standard IPP
|
||||
* attributes...
|
||||
*/
|
||||
|
||||
if ((request = ippNew()) == NULL)
|
||||
if ((request = ippNewRequest(num_files == 1 ? IPP_PRINT_JOB :
|
||||
IPP_CREATE_JOB)) == NULL)
|
||||
{
|
||||
_cupsSetError(IPP_INTERNAL_ERROR, NULL);
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
request->request.op.operation_id = num_files == 1 ? IPP_PRINT_JOB :
|
||||
IPP_CREATE_JOB;
|
||||
request->request.op.request_id = 1;
|
||||
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET,
|
||||
"attributes-charset", NULL, cupsLangEncoding(language));
|
||||
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE,
|
||||
"attributes-natural-language", NULL,
|
||||
language != NULL ? language->language : "C");
|
||||
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri",
|
||||
NULL, uri);
|
||||
|
||||
@@ -1392,21 +1304,11 @@ cupsPrintFiles2(http_t *http, /* I - HTTP connection */
|
||||
* attributes...
|
||||
*/
|
||||
|
||||
if ((request = ippNew()) == NULL)
|
||||
if ((request = ippNewRequest(IPP_SEND_DOCUMENT)) == NULL)
|
||||
return (0);
|
||||
|
||||
request->request.op.operation_id = IPP_SEND_DOCUMENT;
|
||||
request->request.op.request_id = 1;
|
||||
|
||||
snprintf(uri, sizeof(uri), "ipp://localhost/jobs/%d", jobid);
|
||||
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET,
|
||||
"attributes-charset", NULL, cupsLangEncoding(language));
|
||||
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE,
|
||||
"attributes-natural-language", NULL,
|
||||
language != NULL ? language->language : "C");
|
||||
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "job-uri",
|
||||
NULL, uri);
|
||||
|
||||
@@ -1458,8 +1360,6 @@ cupsPrintFiles2(http_t *http, /* I - HTTP connection */
|
||||
ippDelete(response);
|
||||
}
|
||||
|
||||
cupsLangFree(language);
|
||||
|
||||
return (jobid);
|
||||
}
|
||||
|
||||
@@ -1711,6 +1611,16 @@ cups_get_printer_uri(
|
||||
host, hostsize, port, resource, resourcesize);
|
||||
ippDelete(response);
|
||||
|
||||
if (!strncmp(resource, "/classes/", 9))
|
||||
{
|
||||
_cupsSetError(IPP_INTERNAL_ERROR, _("No printer-uri found for class!"));
|
||||
|
||||
*host = '\0';
|
||||
*resource = '\0';
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
return (1);
|
||||
}
|
||||
|
||||
@@ -1718,7 +1628,7 @@ cups_get_printer_uri(
|
||||
}
|
||||
|
||||
if (cupsLastError() != IPP_NOT_FOUND)
|
||||
_cupsSetError(IPP_INTERNAL_ERROR, "No printer-uri found!");
|
||||
_cupsSetError(IPP_INTERNAL_ERROR, _("No printer-uri found!"));
|
||||
|
||||
*host = '\0';
|
||||
*resource = '\0';
|
||||
|
||||
@@ -67,31 +67,6 @@ CHARMAPS = \
|
||||
windows-950.txt
|
||||
|
||||
CHARSETS = \
|
||||
windows-874 \
|
||||
windows-1250 \
|
||||
windows-1251 \
|
||||
windows-1252 \
|
||||
windows-1253 \
|
||||
windows-1254 \
|
||||
windows-1255 \
|
||||
windows-1256 \
|
||||
windows-1257 \
|
||||
windows-1258 \
|
||||
koi8-r \
|
||||
koi8-u \
|
||||
iso-8859-1 \
|
||||
iso-8859-2 \
|
||||
iso-8859-3 \
|
||||
iso-8859-4 \
|
||||
iso-8859-5 \
|
||||
iso-8859-6 \
|
||||
iso-8859-7 \
|
||||
iso-8859-8 \
|
||||
iso-8859-9 \
|
||||
iso-8859-10 \
|
||||
iso-8859-13 \
|
||||
iso-8859-14 \
|
||||
iso-8859-15 \
|
||||
utf-8
|
||||
|
||||
DATAFILES = \
|
||||
|
||||
@@ -1,251 +0,0 @@
|
||||
charset 8bit
|
||||
|
||||
#
|
||||
# This file defines the font and character mappings used for ISO-8859-1
|
||||
# (Latin1/West European) text printing.
|
||||
#
|
||||
# The first line consists of:
|
||||
#
|
||||
# direction width normal bold italic bold-italic
|
||||
#
|
||||
# Direction is the string "ltor" or "rtol", indicating left-to-right or
|
||||
# right-to-left text.
|
||||
#
|
||||
# Width is the string "single" or "double"; double means that the glyphs
|
||||
# are twice as wide as ASCII characters in the Courier typeface.
|
||||
#
|
||||
# "Normal", "bold", "italic", and "bold-italic" are the typefaces to use
|
||||
# for each presentation. If characters are only available in a single
|
||||
# style then only one typeface should be listed (e.g. "Symbol")
|
||||
#
|
||||
# Each font that is listed will be used (and downloaded if needed) when
|
||||
# printing.
|
||||
#
|
||||
|
||||
00 ff ltor single Courier Courier-Bold Courier-Italic Courier-BoldItalic
|
||||
|
||||
#
|
||||
# The following lines define the mapping from the 8-bit character set to
|
||||
# the Unicode glyphs for each character:
|
||||
#
|
||||
# char glyph
|
||||
#
|
||||
# "Char" and "glyph" are hexadecimal values.
|
||||
#
|
||||
|
||||
20 0020
|
||||
21 0021
|
||||
22 0022
|
||||
23 0023
|
||||
24 0024
|
||||
25 0025
|
||||
26 0026
|
||||
27 0027
|
||||
28 0028
|
||||
29 0029
|
||||
2A 002A
|
||||
2B 002B
|
||||
2C 002C
|
||||
2D 002D
|
||||
2E 002E
|
||||
2F 002F
|
||||
30 0030
|
||||
31 0031
|
||||
32 0032
|
||||
33 0033
|
||||
34 0034
|
||||
35 0035
|
||||
36 0036
|
||||
37 0037
|
||||
38 0038
|
||||
39 0039
|
||||
3A 003A
|
||||
3B 003B
|
||||
3C 003C
|
||||
3D 003D
|
||||
3E 003E
|
||||
3F 003F
|
||||
40 0040
|
||||
41 0041
|
||||
42 0042
|
||||
43 0043
|
||||
44 0044
|
||||
45 0045
|
||||
46 0046
|
||||
47 0047
|
||||
48 0048
|
||||
49 0049
|
||||
4A 004A
|
||||
4B 004B
|
||||
4C 004C
|
||||
4D 004D
|
||||
4E 004E
|
||||
4F 004F
|
||||
50 0050
|
||||
51 0051
|
||||
52 0052
|
||||
53 0053
|
||||
54 0054
|
||||
55 0055
|
||||
56 0056
|
||||
57 0057
|
||||
58 0058
|
||||
59 0059
|
||||
5A 005A
|
||||
5B 005B
|
||||
5C 005C
|
||||
5D 005D
|
||||
5E 005E
|
||||
5F 005F
|
||||
60 0060
|
||||
61 0061
|
||||
62 0062
|
||||
63 0063
|
||||
64 0064
|
||||
65 0065
|
||||
66 0066
|
||||
67 0067
|
||||
68 0068
|
||||
69 0069
|
||||
6A 006A
|
||||
6B 006B
|
||||
6C 006C
|
||||
6D 006D
|
||||
6E 006E
|
||||
6F 006F
|
||||
70 0070
|
||||
71 0071
|
||||
72 0072
|
||||
73 0073
|
||||
74 0074
|
||||
75 0075
|
||||
76 0076
|
||||
77 0077
|
||||
78 0078
|
||||
79 0079
|
||||
7A 007A
|
||||
7B 007B
|
||||
7C 007C
|
||||
7D 007D
|
||||
7E 007E
|
||||
80 20AC
|
||||
82 201A
|
||||
83 0192
|
||||
84 201E
|
||||
85 2026
|
||||
86 2020
|
||||
87 2021
|
||||
88 02C6
|
||||
89 2030
|
||||
8A 0160
|
||||
8B 2039
|
||||
8C 0152
|
||||
91 2018
|
||||
92 2019
|
||||
93 201C
|
||||
94 201D
|
||||
95 2022
|
||||
96 2013
|
||||
97 2014
|
||||
98 02DC
|
||||
99 2122
|
||||
9A 0161
|
||||
9B 203A
|
||||
9C 0153
|
||||
9F 0178
|
||||
A0 00A0
|
||||
A1 00A1
|
||||
A2 00A2
|
||||
A3 00A3
|
||||
A4 00A4
|
||||
A5 00A5
|
||||
A6 00A6
|
||||
A7 00A7
|
||||
A8 00A8
|
||||
A9 00A9
|
||||
AA 00AA
|
||||
AB 00AB
|
||||
AC 00AC
|
||||
AD 00AD
|
||||
AE 00AE
|
||||
AF 00AF
|
||||
B0 00B0
|
||||
B1 00B1
|
||||
B2 00B2
|
||||
B3 00B3
|
||||
B4 00B4
|
||||
B5 00B5
|
||||
B6 00B6
|
||||
B7 00B7
|
||||
B8 00B8
|
||||
B9 00B9
|
||||
BA 00BA
|
||||
BB 00BB
|
||||
BC 00BC
|
||||
BD 00BD
|
||||
BE 00BE
|
||||
BF 00BF
|
||||
C0 00C0
|
||||
C1 00C1
|
||||
C2 00C2
|
||||
C3 00C3
|
||||
C4 00C4
|
||||
C5 00C5
|
||||
C6 00C6
|
||||
C7 00C7
|
||||
C8 00C8
|
||||
C9 00C9
|
||||
CA 00CA
|
||||
CB 00CB
|
||||
CC 00CC
|
||||
CD 00CD
|
||||
CE 00CE
|
||||
CF 00CF
|
||||
D0 00D0
|
||||
D1 00D1
|
||||
D2 00D2
|
||||
D3 00D3
|
||||
D4 00D4
|
||||
D5 00D5
|
||||
D6 00D6
|
||||
D7 00D7
|
||||
D8 00D8
|
||||
D9 00D9
|
||||
DA 00DA
|
||||
DB 00DB
|
||||
DC 00DC
|
||||
DD 00DD
|
||||
DE 00DE
|
||||
DF 00DF
|
||||
E0 00E0
|
||||
E1 00E1
|
||||
E2 00E2
|
||||
E3 00E3
|
||||
E4 00E4
|
||||
E5 00E5
|
||||
E6 00E6
|
||||
E7 00E7
|
||||
E8 00E8
|
||||
E9 00E9
|
||||
EA 00EA
|
||||
EB 00EB
|
||||
EC 00EC
|
||||
ED 00ED
|
||||
EE 00EE
|
||||
EF 00EF
|
||||
F0 00F0
|
||||
F1 00F1
|
||||
F2 00F2
|
||||
F3 00F3
|
||||
F4 00F4
|
||||
F5 00F5
|
||||
F6 00F6
|
||||
F7 00F7
|
||||
F8 00F8
|
||||
F9 00F9
|
||||
FA 00FA
|
||||
FB 00FB
|
||||
FC 00FC
|
||||
FD 00FD
|
||||
FE 00FE
|
||||
FF 00FF
|
||||
@@ -1,251 +0,0 @@
|
||||
charset 8bit
|
||||
|
||||
#
|
||||
# This file defines the font and character mappings used for ISO-8859-10
|
||||
# (Latin6/Nordic) text printing.
|
||||
#
|
||||
# The first line consists of:
|
||||
#
|
||||
# direction width normal bold italic bold-italic
|
||||
#
|
||||
# Direction is the string "ltor" or "rtol", indicating left-to-right or
|
||||
# right-to-left text.
|
||||
#
|
||||
# Width is the string "single" or "double"; double means that the glyphs
|
||||
# are twice as wide as ASCII characters in the Courier typeface.
|
||||
#
|
||||
# "Normal", "bold", "italic", and "bold-italic" are the typefaces to use
|
||||
# for each presentation. If characters are only available in a single
|
||||
# style then only one typeface should be listed (e.g. "Symbol")
|
||||
#
|
||||
# Each font that is listed will be used (and downloaded if needed) when
|
||||
# printing.
|
||||
#
|
||||
|
||||
00 ff ltor single Courier Courier-Bold Courier-Italic Courier-BoldItalic
|
||||
|
||||
#
|
||||
# The following lines define the mapping from the 8-bit character set to
|
||||
# the Unicode glyphs for each character:
|
||||
#
|
||||
# char glyph
|
||||
#
|
||||
# "Char" and "glyph" are hexadecimal values.
|
||||
#
|
||||
|
||||
20 0020
|
||||
21 0021
|
||||
22 0022
|
||||
23 0023
|
||||
24 0024
|
||||
25 0025
|
||||
26 0026
|
||||
27 0027
|
||||
28 0028
|
||||
29 0029
|
||||
2A 002A
|
||||
2B 002B
|
||||
2C 002C
|
||||
2D 002D
|
||||
2E 002E
|
||||
2F 002F
|
||||
30 0030
|
||||
31 0031
|
||||
32 0032
|
||||
33 0033
|
||||
34 0034
|
||||
35 0035
|
||||
36 0036
|
||||
37 0037
|
||||
38 0038
|
||||
39 0039
|
||||
3A 003A
|
||||
3B 003B
|
||||
3C 003C
|
||||
3D 003D
|
||||
3E 003E
|
||||
3F 003F
|
||||
40 0040
|
||||
41 0041
|
||||
42 0042
|
||||
43 0043
|
||||
44 0044
|
||||
45 0045
|
||||
46 0046
|
||||
47 0047
|
||||
48 0048
|
||||
49 0049
|
||||
4A 004A
|
||||
4B 004B
|
||||
4C 004C
|
||||
4D 004D
|
||||
4E 004E
|
||||
4F 004F
|
||||
50 0050
|
||||
51 0051
|
||||
52 0052
|
||||
53 0053
|
||||
54 0054
|
||||
55 0055
|
||||
56 0056
|
||||
57 0057
|
||||
58 0058
|
||||
59 0059
|
||||
5A 005A
|
||||
5B 005B
|
||||
5C 005C
|
||||
5D 005D
|
||||
5E 005E
|
||||
5F 005F
|
||||
60 0060
|
||||
61 0061
|
||||
62 0062
|
||||
63 0063
|
||||
64 0064
|
||||
65 0065
|
||||
66 0066
|
||||
67 0067
|
||||
68 0068
|
||||
69 0069
|
||||
6A 006A
|
||||
6B 006B
|
||||
6C 006C
|
||||
6D 006D
|
||||
6E 006E
|
||||
6F 006F
|
||||
70 0070
|
||||
71 0071
|
||||
72 0072
|
||||
73 0073
|
||||
74 0074
|
||||
75 0075
|
||||
76 0076
|
||||
77 0077
|
||||
78 0078
|
||||
79 0079
|
||||
7A 007A
|
||||
7B 007B
|
||||
7C 007C
|
||||
7D 007D
|
||||
7E 007E
|
||||
80 20AC
|
||||
82 201A
|
||||
83 0192
|
||||
84 201E
|
||||
85 2026
|
||||
86 2020
|
||||
87 2021
|
||||
88 02C6
|
||||
89 2030
|
||||
8A 0160
|
||||
8B 2039
|
||||
8C 0152
|
||||
91 2018
|
||||
92 2019
|
||||
93 201C
|
||||
94 201D
|
||||
95 2022
|
||||
96 2013
|
||||
97 2014
|
||||
98 02DC
|
||||
99 2122
|
||||
9A 0161
|
||||
9B 203A
|
||||
9C 0153
|
||||
9F 0178
|
||||
A0 00A0
|
||||
A1 0104
|
||||
A2 0112
|
||||
A3 0122
|
||||
A4 012A
|
||||
A5 0128
|
||||
A6 0136
|
||||
A7 00A7
|
||||
A8 013B
|
||||
A9 0110
|
||||
AA 0160
|
||||
AB 0166
|
||||
AC 017D
|
||||
AD 00AD
|
||||
AE 016A
|
||||
AF 014A
|
||||
B0 00B0
|
||||
B1 0105
|
||||
B2 0113
|
||||
B3 0123
|
||||
B4 012B
|
||||
B5 0129
|
||||
B6 0137
|
||||
B7 00B7
|
||||
B8 013C
|
||||
B9 0111
|
||||
BA 0161
|
||||
BB 0167
|
||||
BC 017E
|
||||
BD 2015
|
||||
BE 016B
|
||||
BF 014B
|
||||
C0 0100
|
||||
C1 00C1
|
||||
C2 00C2
|
||||
C3 00C3
|
||||
C4 00C4
|
||||
C5 00C5
|
||||
C6 00C6
|
||||
C7 012E
|
||||
C8 010C
|
||||
C9 00C9
|
||||
CA 0118
|
||||
CB 00CB
|
||||
CC 0116
|
||||
CD 00CD
|
||||
CE 00CE
|
||||
CF 00CF
|
||||
D0 0110
|
||||
D1 0145
|
||||
D2 014C
|
||||
D3 00D3
|
||||
D4 00D4
|
||||
D5 00D5
|
||||
D6 00D6
|
||||
D7 0168
|
||||
D8 00D8
|
||||
D9 0172
|
||||
DA 00DA
|
||||
DB 00DB
|
||||
DC 00DC
|
||||
DD 00DD
|
||||
DE 00DE
|
||||
DF 00DF
|
||||
E0 0101
|
||||
E1 00E1
|
||||
E2 00E2
|
||||
E3 00E3
|
||||
E4 00E4
|
||||
E5 00E5
|
||||
E6 00E6
|
||||
E7 012F
|
||||
E8 010D
|
||||
E9 00E9
|
||||
EA 0119
|
||||
EB 00EB
|
||||
EC 0117
|
||||
ED 00ED
|
||||
EE 00EE
|
||||
EF 00EF
|
||||
F0 00F0
|
||||
F1 0146
|
||||
F2 014D
|
||||
F3 00F3
|
||||
F4 00F4
|
||||
F5 00F5
|
||||
F6 00F6
|
||||
F7 0169
|
||||
F8 00F8
|
||||
F9 0173
|
||||
FA 00FA
|
||||
FB 00FB
|
||||
FC 00FC
|
||||
FD 00FD
|
||||
FE 00FD
|
||||
FF 0138
|
||||
@@ -1,251 +0,0 @@
|
||||
charset 8bit
|
||||
|
||||
#
|
||||
# This file defines the font and character mappings used for ISO-8859-13
|
||||
# (Latin7/Baltic Rim) text printing.
|
||||
#
|
||||
# The first line consists of:
|
||||
#
|
||||
# direction width normal bold italic bold-italic
|
||||
#
|
||||
# Direction is the string "ltor" or "rtol", indicating left-to-right or
|
||||
# right-to-left text.
|
||||
#
|
||||
# Width is the string "single" or "double"; double means that the glyphs
|
||||
# are twice as wide as ASCII characters in the Courier typeface.
|
||||
#
|
||||
# "Normal", "bold", "italic", and "bold-italic" are the typefaces to use
|
||||
# for each presentation. If characters are only available in a single
|
||||
# style then only one typeface should be listed (e.g. "Symbol")
|
||||
#
|
||||
# Each font that is listed will be used (and downloaded if needed) when
|
||||
# printing.
|
||||
#
|
||||
|
||||
00 ff ltor single Courier Courier-Bold Courier-Italic Courier-BoldItalic
|
||||
|
||||
#
|
||||
# The following lines define the mapping from the 8-bit character set to
|
||||
# the Unicode glyphs for each character:
|
||||
#
|
||||
# char glyph
|
||||
#
|
||||
# "Char" and "glyph" are hexadecimal values.
|
||||
#
|
||||
|
||||
20 0020
|
||||
21 0021
|
||||
22 0022
|
||||
23 0023
|
||||
24 0024
|
||||
25 0025
|
||||
26 0026
|
||||
27 0027
|
||||
28 0028
|
||||
29 0029
|
||||
2A 002A
|
||||
2B 002B
|
||||
2C 002C
|
||||
2D 002D
|
||||
2E 002E
|
||||
2F 002F
|
||||
30 0030
|
||||
31 0031
|
||||
32 0032
|
||||
33 0033
|
||||
34 0034
|
||||
35 0035
|
||||
36 0036
|
||||
37 0037
|
||||
38 0038
|
||||
39 0039
|
||||
3A 003A
|
||||
3B 003B
|
||||
3C 003C
|
||||
3D 003D
|
||||
3E 003E
|
||||
3F 003F
|
||||
40 0040
|
||||
41 0041
|
||||
42 0042
|
||||
43 0043
|
||||
44 0044
|
||||
45 0045
|
||||
46 0046
|
||||
47 0047
|
||||
48 0048
|
||||
49 0049
|
||||
4A 004A
|
||||
4B 004B
|
||||
4C 004C
|
||||
4D 004D
|
||||
4E 004E
|
||||
4F 004F
|
||||
50 0050
|
||||
51 0051
|
||||
52 0052
|
||||
53 0053
|
||||
54 0054
|
||||
55 0055
|
||||
56 0056
|
||||
57 0057
|
||||
58 0058
|
||||
59 0059
|
||||
5A 005A
|
||||
5B 005B
|
||||
5C 005C
|
||||
5D 005D
|
||||
5E 005E
|
||||
5F 005F
|
||||
60 0060
|
||||
61 0061
|
||||
62 0062
|
||||
63 0063
|
||||
64 0064
|
||||
65 0065
|
||||
66 0066
|
||||
67 0067
|
||||
68 0068
|
||||
69 0069
|
||||
6A 006A
|
||||
6B 006B
|
||||
6C 006C
|
||||
6D 006D
|
||||
6E 006E
|
||||
6F 006F
|
||||
70 0070
|
||||
71 0071
|
||||
72 0072
|
||||
73 0073
|
||||
74 0074
|
||||
75 0075
|
||||
76 0076
|
||||
77 0077
|
||||
78 0078
|
||||
79 0079
|
||||
7A 007A
|
||||
7B 007B
|
||||
7C 007C
|
||||
7D 007D
|
||||
7E 007E
|
||||
80 20AC
|
||||
82 201A
|
||||
83 0192
|
||||
84 201E
|
||||
85 2026
|
||||
86 2020
|
||||
87 2021
|
||||
88 02C6
|
||||
89 2030
|
||||
8A 0160
|
||||
8B 2039
|
||||
8C 0152
|
||||
91 2018
|
||||
92 2019
|
||||
93 201C
|
||||
94 201D
|
||||
95 2022
|
||||
96 2013
|
||||
97 2014
|
||||
98 02DC
|
||||
99 2122
|
||||
9A 0161
|
||||
9B 203A
|
||||
9C 0153
|
||||
9F 0178
|
||||
A0 00A0
|
||||
A1 201D
|
||||
A2 00A2
|
||||
A3 00A3
|
||||
A4 00A4
|
||||
A5 201E
|
||||
A6 00A6
|
||||
A7 00A7
|
||||
A8 00D8
|
||||
A9 00A9
|
||||
AA 0156
|
||||
AB 00AB
|
||||
AC 00AC
|
||||
AD 00AD
|
||||
AE 00AE
|
||||
AF 00C6
|
||||
B0 00B0
|
||||
B1 00B1
|
||||
B2 00B2
|
||||
B3 00B3
|
||||
B4 201C
|
||||
B5 00B5
|
||||
B6 00B6
|
||||
B7 00B7
|
||||
B8 00F8
|
||||
B9 00B9
|
||||
BA 0157
|
||||
BB 00BB
|
||||
BC 00BC
|
||||
BD 00BD
|
||||
BE 00BE
|
||||
BF 00E6
|
||||
C0 0104
|
||||
C1 012E
|
||||
C2 0100
|
||||
C3 0106
|
||||
C4 00C4
|
||||
C5 00C5
|
||||
C6 0118
|
||||
C7 0112
|
||||
C8 010C
|
||||
C9 00C9
|
||||
CA 0179
|
||||
CB 0116
|
||||
CC 0122
|
||||
CD 0136
|
||||
CE 012A
|
||||
CF 013B
|
||||
D0 0160
|
||||
D1 0143
|
||||
D2 0145
|
||||
D3 00D3
|
||||
D4 014C
|
||||
D5 00D5
|
||||
D6 00D6
|
||||
D7 00D7
|
||||
D8 0172
|
||||
D9 0141
|
||||
DA 015A
|
||||
DB 016A
|
||||
DC 00DC
|
||||
DD 017B
|
||||
DE 017D
|
||||
DF 00DF
|
||||
E0 0105
|
||||
E1 012F
|
||||
E2 0101
|
||||
E3 0107
|
||||
E4 00E4
|
||||
E5 00E5
|
||||
E6 0119
|
||||
E7 0113
|
||||
E8 010D
|
||||
E9 00E9
|
||||
EA 017A
|
||||
EB 0117
|
||||
EC 0123
|
||||
ED 0137
|
||||
EE 012B
|
||||
EF 013C
|
||||
F0 0161
|
||||
F1 0144
|
||||
F2 0146
|
||||
F3 00F3
|
||||
F4 014D
|
||||
F5 00F5
|
||||
F6 00F6
|
||||
F7 00F7
|
||||
F8 0173
|
||||
F9 0142
|
||||
FA 015B
|
||||
FB 016B
|
||||
FC 00FC
|
||||
FD 017C
|
||||
FE 017E
|
||||
FF 2019
|
||||
@@ -1,251 +0,0 @@
|
||||
charset 8bit
|
||||
|
||||
#
|
||||
# This file defines the font and character mappings used for ISO-8859-14
|
||||
# (Latin8/Celtic) text printing.
|
||||
#
|
||||
# The first line consists of:
|
||||
#
|
||||
# direction width normal bold italic bold-italic
|
||||
#
|
||||
# Direction is the string "ltor" or "rtol", indicating left-to-right or
|
||||
# right-to-left text.
|
||||
#
|
||||
# Width is the string "single" or "double"; double means that the glyphs
|
||||
# are twice as wide as ASCII characters in the Courier typeface.
|
||||
#
|
||||
# "Normal", "bold", "italic", and "bold-italic" are the typefaces to use
|
||||
# for each presentation. If characters are only available in a single
|
||||
# style then only one typeface should be listed (e.g. "Symbol")
|
||||
#
|
||||
# Each font that is listed will be used (and downloaded if needed) when
|
||||
# printing.
|
||||
#
|
||||
|
||||
00 ff ltor single Courier Courier-Bold Courier-Italic Courier-BoldItalic
|
||||
|
||||
#
|
||||
# The following lines define the mapping from the 8-bit character set to
|
||||
# the Unicode glyphs for each character:
|
||||
#
|
||||
# char glyph
|
||||
#
|
||||
# "Char" and "glyph" are hexadecimal values.
|
||||
#
|
||||
|
||||
20 0020
|
||||
21 0021
|
||||
22 0022
|
||||
23 0023
|
||||
24 0024
|
||||
25 0025
|
||||
26 0026
|
||||
27 0027
|
||||
28 0028
|
||||
29 0029
|
||||
2A 002A
|
||||
2B 002B
|
||||
2C 002C
|
||||
2D 002D
|
||||
2E 002E
|
||||
2F 002F
|
||||
30 0030
|
||||
31 0031
|
||||
32 0032
|
||||
33 0033
|
||||
34 0034
|
||||
35 0035
|
||||
36 0036
|
||||
37 0037
|
||||
38 0038
|
||||
39 0039
|
||||
3A 003A
|
||||
3B 003B
|
||||
3C 003C
|
||||
3D 003D
|
||||
3E 003E
|
||||
3F 003F
|
||||
40 0040
|
||||
41 0041
|
||||
42 0042
|
||||
43 0043
|
||||
44 0044
|
||||
45 0045
|
||||
46 0046
|
||||
47 0047
|
||||
48 0048
|
||||
49 0049
|
||||
4A 004A
|
||||
4B 004B
|
||||
4C 004C
|
||||
4D 004D
|
||||
4E 004E
|
||||
4F 004F
|
||||
50 0050
|
||||
51 0051
|
||||
52 0052
|
||||
53 0053
|
||||
54 0054
|
||||
55 0055
|
||||
56 0056
|
||||
57 0057
|
||||
58 0058
|
||||
59 0059
|
||||
5A 005A
|
||||
5B 005B
|
||||
5C 005C
|
||||
5D 005D
|
||||
5E 005E
|
||||
5F 005F
|
||||
60 0060
|
||||
61 0061
|
||||
62 0062
|
||||
63 0063
|
||||
64 0064
|
||||
65 0065
|
||||
66 0066
|
||||
67 0067
|
||||
68 0068
|
||||
69 0069
|
||||
6A 006A
|
||||
6B 006B
|
||||
6C 006C
|
||||
6D 006D
|
||||
6E 006E
|
||||
6F 006F
|
||||
70 0070
|
||||
71 0071
|
||||
72 0072
|
||||
73 0073
|
||||
74 0074
|
||||
75 0075
|
||||
76 0076
|
||||
77 0077
|
||||
78 0078
|
||||
79 0079
|
||||
7A 007A
|
||||
7B 007B
|
||||
7C 007C
|
||||
7D 007D
|
||||
7E 007E
|
||||
80 20AC
|
||||
82 201A
|
||||
83 0192
|
||||
84 201E
|
||||
85 2026
|
||||
86 2020
|
||||
87 2021
|
||||
88 02C6
|
||||
89 2030
|
||||
8A 0160
|
||||
8B 2039
|
||||
8C 0152
|
||||
91 2018
|
||||
92 2019
|
||||
93 201C
|
||||
94 201D
|
||||
95 2022
|
||||
96 2013
|
||||
97 2014
|
||||
98 02DC
|
||||
99 2122
|
||||
9A 0161
|
||||
9B 203A
|
||||
9C 0153
|
||||
9F 0178
|
||||
A0 00A0
|
||||
A1 1E02
|
||||
A2 1E03
|
||||
A3 00A3
|
||||
A4 010A
|
||||
A5 010B
|
||||
A6 1E0A
|
||||
A7 00A7
|
||||
A8 1E80
|
||||
A9 00A9
|
||||
AA 1E82
|
||||
AB 1E0B
|
||||
AC 1EF2
|
||||
AD 00AD
|
||||
AE 00AE
|
||||
AF 0178
|
||||
B0 1E1E
|
||||
B1 1E1F
|
||||
B2 0120
|
||||
B3 0121
|
||||
B4 1E40
|
||||
B5 1E41
|
||||
B6 00B6
|
||||
B7 1E56
|
||||
B8 1E81
|
||||
B9 1E57
|
||||
BA 1E83
|
||||
BB 1E60
|
||||
BC 1EF3
|
||||
BD 1E84
|
||||
BE 1E85
|
||||
BF 1E61
|
||||
C0 00C0
|
||||
C1 00C1
|
||||
C2 00C2
|
||||
C3 00C3
|
||||
C4 00C4
|
||||
C5 00C5
|
||||
C6 00C6
|
||||
C7 00C7
|
||||
C8 00C8
|
||||
C9 00C9
|
||||
CA 00CA
|
||||
CB 00CB
|
||||
CC 00CC
|
||||
CD 00CD
|
||||
CE 00CE
|
||||
CF 00CF
|
||||
D0 0174
|
||||
D1 00D1
|
||||
D2 00D2
|
||||
D3 00D3
|
||||
D4 00D4
|
||||
D5 00D5
|
||||
D6 00D6
|
||||
D7 1E6A
|
||||
D8 00D8
|
||||
D9 00D9
|
||||
DA 00DA
|
||||
DB 00DB
|
||||
DC 00DC
|
||||
DD 00DD
|
||||
DE 0176
|
||||
DF 00DF
|
||||
E0 00E0
|
||||
E1 00E1
|
||||
E2 00E2
|
||||
E3 00E3
|
||||
E4 00E4
|
||||
E5 00E5
|
||||
E6 00E6
|
||||
E7 00E7
|
||||
E8 00E8
|
||||
E9 00E9
|
||||
EA 00EA
|
||||
EB 00EB
|
||||
EC 00EC
|
||||
ED 00ED
|
||||
EE 00EE
|
||||
EF 00EF
|
||||
F0 0175
|
||||
F1 00F1
|
||||
F2 00F2
|
||||
F3 00F3
|
||||
F4 00F4
|
||||
F5 00F5
|
||||
F6 00F6
|
||||
F7 1E6B
|
||||
F8 00F8
|
||||
F9 00F9
|
||||
FA 00FA
|
||||
FB 00FB
|
||||
FC 00FC
|
||||
FD 00FD
|
||||
FE 0177
|
||||
FF 00FF
|
||||
@@ -1,251 +0,0 @@
|
||||
charset 8bit
|
||||
|
||||
#
|
||||
# This file defines the font and character mappings used for ISO-8859-15
|
||||
# (Latin9/West Europe + Euro) text printing.
|
||||
#
|
||||
# The first line consists of:
|
||||
#
|
||||
# direction width normal bold italic bold-italic
|
||||
#
|
||||
# Direction is the string "ltor" or "rtol", indicating left-to-right or
|
||||
# right-to-left text.
|
||||
#
|
||||
# Width is the string "single" or "double"; double means that the glyphs
|
||||
# are twice as wide as ASCII characters in the Courier typeface.
|
||||
#
|
||||
# "Normal", "bold", "italic", and "bold-italic" are the typefaces to use
|
||||
# for each presentation. If characters are only available in a single
|
||||
# style then only one typeface should be listed (e.g. "Symbol")
|
||||
#
|
||||
# Each font that is listed will be used (and downloaded if needed) when
|
||||
# printing.
|
||||
#
|
||||
|
||||
00 ff ltor single Courier Courier-Bold Courier-Italic Courier-BoldItalic
|
||||
|
||||
#
|
||||
# The following lines define the mapping from the 8-bit character set to
|
||||
# the Unicode glyphs for each character:
|
||||
#
|
||||
# char glyph
|
||||
#
|
||||
# "Char" and "glyph" are hexadecimal values.
|
||||
#
|
||||
|
||||
20 0020
|
||||
21 0021
|
||||
22 0022
|
||||
23 0023
|
||||
24 0024
|
||||
25 0025
|
||||
26 0026
|
||||
27 0027
|
||||
28 0028
|
||||
29 0029
|
||||
2A 002A
|
||||
2B 002B
|
||||
2C 002C
|
||||
2D 002D
|
||||
2E 002E
|
||||
2F 002F
|
||||
30 0030
|
||||
31 0031
|
||||
32 0032
|
||||
33 0033
|
||||
34 0034
|
||||
35 0035
|
||||
36 0036
|
||||
37 0037
|
||||
38 0038
|
||||
39 0039
|
||||
3A 003A
|
||||
3B 003B
|
||||
3C 003C
|
||||
3D 003D
|
||||
3E 003E
|
||||
3F 003F
|
||||
40 0040
|
||||
41 0041
|
||||
42 0042
|
||||
43 0043
|
||||
44 0044
|
||||
45 0045
|
||||
46 0046
|
||||
47 0047
|
||||
48 0048
|
||||
49 0049
|
||||
4A 004A
|
||||
4B 004B
|
||||
4C 004C
|
||||
4D 004D
|
||||
4E 004E
|
||||
4F 004F
|
||||
50 0050
|
||||
51 0051
|
||||
52 0052
|
||||
53 0053
|
||||
54 0054
|
||||
55 0055
|
||||
56 0056
|
||||
57 0057
|
||||
58 0058
|
||||
59 0059
|
||||
5A 005A
|
||||
5B 005B
|
||||
5C 005C
|
||||
5D 005D
|
||||
5E 005E
|
||||
5F 005F
|
||||
60 0060
|
||||
61 0061
|
||||
62 0062
|
||||
63 0063
|
||||
64 0064
|
||||
65 0065
|
||||
66 0066
|
||||
67 0067
|
||||
68 0068
|
||||
69 0069
|
||||
6A 006A
|
||||
6B 006B
|
||||
6C 006C
|
||||
6D 006D
|
||||
6E 006E
|
||||
6F 006F
|
||||
70 0070
|
||||
71 0071
|
||||
72 0072
|
||||
73 0073
|
||||
74 0074
|
||||
75 0075
|
||||
76 0076
|
||||
77 0077
|
||||
78 0078
|
||||
79 0079
|
||||
7A 007A
|
||||
7B 007B
|
||||
7C 007C
|
||||
7D 007D
|
||||
7E 007E
|
||||
80 20AC
|
||||
82 201A
|
||||
83 0192
|
||||
84 201E
|
||||
85 2026
|
||||
86 2020
|
||||
87 2021
|
||||
88 02C6
|
||||
89 2030
|
||||
8A 0160
|
||||
8B 2039
|
||||
8C 0152
|
||||
91 2018
|
||||
92 2019
|
||||
93 201C
|
||||
94 201D
|
||||
95 2022
|
||||
96 2013
|
||||
97 2014
|
||||
98 02DC
|
||||
99 2122
|
||||
9A 0161
|
||||
9B 203A
|
||||
9C 0153
|
||||
9F 0178
|
||||
A0 00A0
|
||||
A1 00A1
|
||||
A2 00A2
|
||||
A3 00A3
|
||||
A4 20AC
|
||||
A5 00A5
|
||||
A6 0160
|
||||
A7 00A7
|
||||
A8 0161
|
||||
A9 00A9
|
||||
AA 00AA
|
||||
AB 00AB
|
||||
AC 00AC
|
||||
AD 00AD
|
||||
AE 00AE
|
||||
AF 00AF
|
||||
B0 00B0
|
||||
B1 00B1
|
||||
B2 00B2
|
||||
B3 00B3
|
||||
B4 017D
|
||||
B5 00B5
|
||||
B6 00B6
|
||||
B7 00B7
|
||||
B8 017E
|
||||
B9 00B9
|
||||
BA 00BA
|
||||
BB 00BB
|
||||
BC 0152
|
||||
BD 0153
|
||||
BE 0178
|
||||
BF 00BF
|
||||
C0 00C0
|
||||
C1 00C1
|
||||
C2 00C2
|
||||
C3 00C3
|
||||
C4 00C4
|
||||
C5 00C5
|
||||
C6 00C6
|
||||
C7 00C7
|
||||
C8 00C8
|
||||
C9 00C9
|
||||
CA 00CA
|
||||
CB 00CB
|
||||
CC 00CC
|
||||
CD 00CD
|
||||
CE 00CE
|
||||
CF 00CF
|
||||
D0 00D0
|
||||
D1 00D1
|
||||
D2 00D2
|
||||
D3 00D3
|
||||
D4 00D4
|
||||
D5 00D5
|
||||
D6 00D6
|
||||
D7 00D7
|
||||
D8 00D8
|
||||
D9 00D9
|
||||
DA 00DA
|
||||
DB 00DB
|
||||
DC 00DC
|
||||
DD 00DD
|
||||
DE 00DE
|
||||
DF 00DF
|
||||
E0 00E0
|
||||
E1 00E1
|
||||
E2 00E2
|
||||
E3 00E3
|
||||
E4 00E4
|
||||
E5 00E5
|
||||
E6 00E6
|
||||
E7 00E7
|
||||
E8 00E8
|
||||
E9 00E9
|
||||
EA 00EA
|
||||
EB 00EB
|
||||
EC 00EC
|
||||
ED 00ED
|
||||
EE 00EE
|
||||
EF 00EF
|
||||
F0 00F0
|
||||
F1 00F1
|
||||
F2 00F2
|
||||
F3 00F3
|
||||
F4 00F4
|
||||
F5 00F5
|
||||
F6 00F6
|
||||
F7 00F7
|
||||
F8 00F8
|
||||
F9 00F9
|
||||
FA 00FA
|
||||
FB 00FB
|
||||
FC 00FC
|
||||
FD 00FD
|
||||
FE 00FE
|
||||
FF 00FF
|
||||
@@ -1,253 +0,0 @@
|
||||
charset 8bit
|
||||
|
||||
#
|
||||
# This file defines the font and character mappings used for ISO-8859-2
|
||||
# (Latin2/East European) text printing.
|
||||
#
|
||||
# The first line consists of:
|
||||
#
|
||||
# direction width normal bold italic bold-italic
|
||||
#
|
||||
# Direction is the string "ltor" or "rtol", indicating left-to-right or
|
||||
# right-to-left text.
|
||||
#
|
||||
# Width is the string "single" or "double"; double means that the glyphs
|
||||
# are twice as wide as ASCII characters in the Courier typeface.
|
||||
#
|
||||
# "Normal", "bold", "italic", and "bold-italic" are the typefaces to use
|
||||
# for each presentation. If characters are only available in a single
|
||||
# style then only one typeface should be listed (e.g. "Symbol")
|
||||
#
|
||||
# Each font that is listed will be used (and downloaded if needed) when
|
||||
# printing.
|
||||
#
|
||||
|
||||
00 ff ltor single Courier Courier-Bold Courier-Italic Courier-BoldItalic
|
||||
|
||||
#
|
||||
# The following lines define the mapping from the 8-bit character set to
|
||||
# the Unicode glyphs for each character:
|
||||
#
|
||||
# char glyph
|
||||
#
|
||||
# "Char" and "glyph" are hexadecimal values.
|
||||
#
|
||||
|
||||
20 0020
|
||||
21 0021
|
||||
22 0022
|
||||
23 0023
|
||||
24 0024
|
||||
25 0025
|
||||
26 0026
|
||||
27 0027
|
||||
28 0028
|
||||
29 0029
|
||||
2A 002A
|
||||
2B 002B
|
||||
2C 002C
|
||||
2D 002D
|
||||
2E 002E
|
||||
2F 002F
|
||||
30 0030
|
||||
31 0031
|
||||
32 0032
|
||||
33 0033
|
||||
34 0034
|
||||
35 0035
|
||||
36 0036
|
||||
37 0037
|
||||
38 0038
|
||||
39 0039
|
||||
3A 003A
|
||||
3B 003B
|
||||
3C 003C
|
||||
3D 003D
|
||||
3E 003E
|
||||
3F 003F
|
||||
40 0040
|
||||
41 0041
|
||||
42 0042
|
||||
43 0043
|
||||
44 0044
|
||||
45 0045
|
||||
46 0046
|
||||
47 0047
|
||||
48 0048
|
||||
49 0049
|
||||
4A 004A
|
||||
4B 004B
|
||||
4C 004C
|
||||
4D 004D
|
||||
4E 004E
|
||||
4F 004F
|
||||
50 0050
|
||||
51 0051
|
||||
52 0052
|
||||
53 0053
|
||||
54 0054
|
||||
55 0055
|
||||
56 0056
|
||||
57 0057
|
||||
58 0058
|
||||
59 0059
|
||||
5A 005A
|
||||
5B 005B
|
||||
5C 005C
|
||||
5D 005D
|
||||
5E 005E
|
||||
5F 005F
|
||||
60 0060
|
||||
61 0061
|
||||
62 0062
|
||||
63 0063
|
||||
64 0064
|
||||
65 0065
|
||||
66 0066
|
||||
67 0067
|
||||
68 0068
|
||||
69 0069
|
||||
6A 006A
|
||||
6B 006B
|
||||
6C 006C
|
||||
6D 006D
|
||||
6E 006E
|
||||
6F 006F
|
||||
70 0070
|
||||
71 0071
|
||||
72 0072
|
||||
73 0073
|
||||
74 0074
|
||||
75 0075
|
||||
76 0076
|
||||
77 0077
|
||||
78 0078
|
||||
79 0079
|
||||
7A 007A
|
||||
7B 007B
|
||||
7C 007C
|
||||
7D 007D
|
||||
7E 007E
|
||||
80 20AC
|
||||
82 201A
|
||||
84 201E
|
||||
85 2026
|
||||
86 2020
|
||||
87 2021
|
||||
89 2030
|
||||
8A 0160
|
||||
8B 2039
|
||||
8C 015A
|
||||
8D 0164
|
||||
8E 017D
|
||||
8F 0179
|
||||
91 2018
|
||||
92 2019
|
||||
93 201C
|
||||
94 201D
|
||||
95 2022
|
||||
96 2013
|
||||
97 2014
|
||||
99 2122
|
||||
9A 0161
|
||||
9B 203A
|
||||
8C 015B
|
||||
8D 0165
|
||||
8E 017E
|
||||
8F 017A
|
||||
A0 00A0
|
||||
A1 0104
|
||||
A2 02D8
|
||||
A3 0141
|
||||
A4 00A4
|
||||
A5 013D
|
||||
A6 015A
|
||||
A7 00A7
|
||||
A8 00A8
|
||||
A9 0160
|
||||
AA 015E
|
||||
AB 0164
|
||||
AC 0179
|
||||
AD 00AD
|
||||
AE 017D
|
||||
AF 017B
|
||||
B0 00B0
|
||||
B1 0105
|
||||
B2 02DB
|
||||
B3 0142
|
||||
B4 00B4
|
||||
B5 013E
|
||||
B6 015B
|
||||
B7 02C7
|
||||
B8 00B8
|
||||
B9 0161
|
||||
BA 015F
|
||||
BB 0165
|
||||
BC 017A
|
||||
BD 02DD
|
||||
BE 017E
|
||||
BF 017C
|
||||
C0 0154
|
||||
C1 00C1
|
||||
C2 00C2
|
||||
C3 0102
|
||||
C4 00C4
|
||||
C5 0139
|
||||
C6 0106
|
||||
C7 00C7
|
||||
C8 010C
|
||||
C9 00C9
|
||||
CA 0118
|
||||
CB 00CB
|
||||
CC 011A
|
||||
CD 00CD
|
||||
CE 00CE
|
||||
CF 010E
|
||||
D0 0110
|
||||
D1 0143
|
||||
D2 0147
|
||||
D3 00D3
|
||||
D4 00D4
|
||||
D5 0150
|
||||
D6 00D6
|
||||
D7 00D7
|
||||
D8 0158
|
||||
D9 016E
|
||||
DA 00DA
|
||||
DB 0170
|
||||
DC 00DC
|
||||
DD 00DD
|
||||
DE 0162
|
||||
DF 00DF
|
||||
E0 0155
|
||||
E1 00E1
|
||||
E2 00E2
|
||||
E3 0103
|
||||
E4 00E4
|
||||
E5 013A
|
||||
E6 0107
|
||||
E7 00E7
|
||||
E8 010D
|
||||
E9 00E9
|
||||
EA 0119
|
||||
EB 00EB
|
||||
EC 011B
|
||||
ED 00ED
|
||||
EE 00EE
|
||||
EF 010F
|
||||
F0 0111
|
||||
F1 0144
|
||||
F2 0148
|
||||
F3 00F3
|
||||
F4 00F4
|
||||
F5 0151
|
||||
F6 00F6
|
||||
F7 00F7
|
||||
F8 0159
|
||||
F9 016F
|
||||
FA 00FA
|
||||
FB 0171
|
||||
FC 00FC
|
||||
FD 00FD
|
||||
FE 0163
|
||||
FF 02D9
|
||||
@@ -1,244 +0,0 @@
|
||||
charset 8bit
|
||||
|
||||
#
|
||||
# This file defines the font and character mappings used for ISO-8859-3
|
||||
# (Latin3/South European) text printing.
|
||||
#
|
||||
# The first line consists of:
|
||||
#
|
||||
# direction width normal bold italic bold-italic
|
||||
#
|
||||
# Direction is the string "ltor" or "rtol", indicating left-to-right or
|
||||
# right-to-left text.
|
||||
#
|
||||
# Width is the string "single" or "double"; double means that the glyphs
|
||||
# are twice as wide as ASCII characters in the Courier typeface.
|
||||
#
|
||||
# "Normal", "bold", "italic", and "bold-italic" are the typefaces to use
|
||||
# for each presentation. If characters are only available in a single
|
||||
# style then only one typeface should be listed (e.g. "Symbol")
|
||||
#
|
||||
# Each font that is listed will be used (and downloaded if needed) when
|
||||
# printing.
|
||||
#
|
||||
|
||||
00 ff ltor single Courier Courier-Bold Courier-Italic Courier-BoldItalic
|
||||
|
||||
#
|
||||
# The following lines define the mapping from the 8-bit character set to
|
||||
# the Unicode glyphs for each character:
|
||||
#
|
||||
# char glyph
|
||||
#
|
||||
# "Char" and "glyph" are hexadecimal values.
|
||||
#
|
||||
|
||||
20 0020
|
||||
21 0021
|
||||
22 0022
|
||||
23 0023
|
||||
24 0024
|
||||
25 0025
|
||||
26 0026
|
||||
27 0027
|
||||
28 0028
|
||||
29 0029
|
||||
2A 002A
|
||||
2B 002B
|
||||
2C 002C
|
||||
2D 002D
|
||||
2E 002E
|
||||
2F 002F
|
||||
30 0030
|
||||
31 0031
|
||||
32 0032
|
||||
33 0033
|
||||
34 0034
|
||||
35 0035
|
||||
36 0036
|
||||
37 0037
|
||||
38 0038
|
||||
39 0039
|
||||
3A 003A
|
||||
3B 003B
|
||||
3C 003C
|
||||
3D 003D
|
||||
3E 003E
|
||||
3F 003F
|
||||
40 0040
|
||||
41 0041
|
||||
42 0042
|
||||
43 0043
|
||||
44 0044
|
||||
45 0045
|
||||
46 0046
|
||||
47 0047
|
||||
48 0048
|
||||
49 0049
|
||||
4A 004A
|
||||
4B 004B
|
||||
4C 004C
|
||||
4D 004D
|
||||
4E 004E
|
||||
4F 004F
|
||||
50 0050
|
||||
51 0051
|
||||
52 0052
|
||||
53 0053
|
||||
54 0054
|
||||
55 0055
|
||||
56 0056
|
||||
57 0057
|
||||
58 0058
|
||||
59 0059
|
||||
5A 005A
|
||||
5B 005B
|
||||
5C 005C
|
||||
5D 005D
|
||||
5E 005E
|
||||
5F 005F
|
||||
60 0060
|
||||
61 0061
|
||||
62 0062
|
||||
63 0063
|
||||
64 0064
|
||||
65 0065
|
||||
66 0066
|
||||
67 0067
|
||||
68 0068
|
||||
69 0069
|
||||
6A 006A
|
||||
6B 006B
|
||||
6C 006C
|
||||
6D 006D
|
||||
6E 006E
|
||||
6F 006F
|
||||
70 0070
|
||||
71 0071
|
||||
72 0072
|
||||
73 0073
|
||||
74 0074
|
||||
75 0075
|
||||
76 0076
|
||||
77 0077
|
||||
78 0078
|
||||
79 0079
|
||||
7A 007A
|
||||
7B 007B
|
||||
7C 007C
|
||||
7D 007D
|
||||
7E 007E
|
||||
80 20AC
|
||||
82 201A
|
||||
83 0192
|
||||
84 201E
|
||||
85 2026
|
||||
86 2020
|
||||
87 2021
|
||||
88 02C6
|
||||
89 2030
|
||||
8A 0160
|
||||
8B 2039
|
||||
8C 0152
|
||||
91 2018
|
||||
92 2019
|
||||
93 201C
|
||||
94 201D
|
||||
95 2022
|
||||
96 2013
|
||||
97 2014
|
||||
98 02DC
|
||||
99 2122
|
||||
9A 0161
|
||||
9B 203A
|
||||
9C 0153
|
||||
9F 0178
|
||||
A0 00A0
|
||||
A1 0126
|
||||
A2 02D8
|
||||
A3 00A3
|
||||
A4 00A4
|
||||
A6 0124
|
||||
A7 00A7
|
||||
A8 00A8
|
||||
A9 0130
|
||||
AA 015E
|
||||
AB 011E
|
||||
AC 0134
|
||||
AD 00AD
|
||||
AF 017B
|
||||
B0 00B0
|
||||
B1 0127
|
||||
B2 00B2
|
||||
B3 00B3
|
||||
B4 00B4
|
||||
B5 00B5
|
||||
B6 0125
|
||||
B7 00B7
|
||||
B8 00B8
|
||||
B9 0131
|
||||
BA 015F
|
||||
BB 011F
|
||||
BC 0135
|
||||
BD 00BD
|
||||
BF 017C
|
||||
C0 00C0
|
||||
C1 00C1
|
||||
C2 00C2
|
||||
C4 00C4
|
||||
C5 010A
|
||||
C6 0108
|
||||
C7 00C7
|
||||
C8 00C8
|
||||
C9 00C9
|
||||
CA 00CA
|
||||
CB 00CB
|
||||
CC 00CC
|
||||
CD 00CD
|
||||
CE 00CE
|
||||
CF 00CF
|
||||
D1 00D1
|
||||
D2 00D2
|
||||
D3 00D3
|
||||
D4 00D4
|
||||
D5 0120
|
||||
D6 00D6
|
||||
D7 00D7
|
||||
D8 011C
|
||||
D9 00D9
|
||||
DA 00DA
|
||||
DB 00DB
|
||||
DC 00DC
|
||||
DD 016C
|
||||
DE 015C
|
||||
DF 00DF
|
||||
E0 00E0
|
||||
E1 00E1
|
||||
E2 00E2
|
||||
E4 00E4
|
||||
E5 010B
|
||||
E6 0109
|
||||
E7 00E7
|
||||
E8 00E8
|
||||
E9 00E9
|
||||
EA 00EA
|
||||
EB 00EB
|
||||
EC 00EC
|
||||
ED 00ED
|
||||
EE 00EE
|
||||
EF 00EF
|
||||
F1 00F1
|
||||
F2 00F2
|
||||
F3 00F3
|
||||
F4 00F4
|
||||
F5 0121
|
||||
F6 00F6
|
||||
F7 00F7
|
||||
F8 011D
|
||||
F9 00F9
|
||||
FA 00FA
|
||||
FB 00FB
|
||||
FC 00FC
|
||||
FD 016D
|
||||
FE 015D
|
||||
FF 02D9
|
||||
@@ -1,251 +0,0 @@
|
||||
charset 8bit
|
||||
|
||||
#
|
||||
# This file defines the font and character mappings used for ISO-8859-4
|
||||
# (Latin4/North European) text printing.
|
||||
#
|
||||
# The first line consists of:
|
||||
#
|
||||
# direction width normal bold italic bold-italic
|
||||
#
|
||||
# Direction is the string "ltor" or "rtol", indicating left-to-right or
|
||||
# right-to-left text.
|
||||
#
|
||||
# Width is the string "single" or "double"; double means that the glyphs
|
||||
# are twice as wide as ASCII characters in the Courier typeface.
|
||||
#
|
||||
# "Normal", "bold", "italic", and "bold-italic" are the typefaces to use
|
||||
# for each presentation. If characters are only available in a single
|
||||
# style then only one typeface should be listed (e.g. "Symbol")
|
||||
#
|
||||
# Each font that is listed will be used (and downloaded if needed) when
|
||||
# printing.
|
||||
#
|
||||
|
||||
00 ff ltor single Courier Courier-Bold Courier-Italic Courier-BoldItalic
|
||||
|
||||
#
|
||||
# The following lines define the mapping from the 8-bit character set to
|
||||
# the Unicode glyphs for each character:
|
||||
#
|
||||
# char glyph
|
||||
#
|
||||
# "Char" and "glyph" are hexadecimal values.
|
||||
#
|
||||
|
||||
20 0020
|
||||
21 0021
|
||||
22 0022
|
||||
23 0023
|
||||
24 0024
|
||||
25 0025
|
||||
26 0026
|
||||
27 0027
|
||||
28 0028
|
||||
29 0029
|
||||
2A 002A
|
||||
2B 002B
|
||||
2C 002C
|
||||
2D 002D
|
||||
2E 002E
|
||||
2F 002F
|
||||
30 0030
|
||||
31 0031
|
||||
32 0032
|
||||
33 0033
|
||||
34 0034
|
||||
35 0035
|
||||
36 0036
|
||||
37 0037
|
||||
38 0038
|
||||
39 0039
|
||||
3A 003A
|
||||
3B 003B
|
||||
3C 003C
|
||||
3D 003D
|
||||
3E 003E
|
||||
3F 003F
|
||||
40 0040
|
||||
41 0041
|
||||
42 0042
|
||||
43 0043
|
||||
44 0044
|
||||
45 0045
|
||||
46 0046
|
||||
47 0047
|
||||
48 0048
|
||||
49 0049
|
||||
4A 004A
|
||||
4B 004B
|
||||
4C 004C
|
||||
4D 004D
|
||||
4E 004E
|
||||
4F 004F
|
||||
50 0050
|
||||
51 0051
|
||||
52 0052
|
||||
53 0053
|
||||
54 0054
|
||||
55 0055
|
||||
56 0056
|
||||
57 0057
|
||||
58 0058
|
||||
59 0059
|
||||
5A 005A
|
||||
5B 005B
|
||||
5C 005C
|
||||
5D 005D
|
||||
5E 005E
|
||||
5F 005F
|
||||
60 0060
|
||||
61 0061
|
||||
62 0062
|
||||
63 0063
|
||||
64 0064
|
||||
65 0065
|
||||
66 0066
|
||||
67 0067
|
||||
68 0068
|
||||
69 0069
|
||||
6A 006A
|
||||
6B 006B
|
||||
6C 006C
|
||||
6D 006D
|
||||
6E 006E
|
||||
6F 006F
|
||||
70 0070
|
||||
71 0071
|
||||
72 0072
|
||||
73 0073
|
||||
74 0074
|
||||
75 0075
|
||||
76 0076
|
||||
77 0077
|
||||
78 0078
|
||||
79 0079
|
||||
7A 007A
|
||||
7B 007B
|
||||
7C 007C
|
||||
7D 007D
|
||||
7E 007E
|
||||
80 20AC
|
||||
82 201A
|
||||
83 0192
|
||||
84 201E
|
||||
85 2026
|
||||
86 2020
|
||||
87 2021
|
||||
88 02C6
|
||||
89 2030
|
||||
8A 0160
|
||||
8B 2039
|
||||
8C 0152
|
||||
91 2018
|
||||
92 2019
|
||||
93 201C
|
||||
94 201D
|
||||
95 2022
|
||||
96 2013
|
||||
97 2014
|
||||
98 02DC
|
||||
99 2122
|
||||
9A 0161
|
||||
9B 203A
|
||||
9C 0153
|
||||
9F 0178
|
||||
A0 00A0
|
||||
A1 0104
|
||||
A2 0138
|
||||
A3 0156
|
||||
A4 00A4
|
||||
A5 0128
|
||||
A6 013B
|
||||
A7 00A7
|
||||
A8 00A8
|
||||
A9 0160
|
||||
AA 0112
|
||||
AB 0122
|
||||
AC 0166
|
||||
AD 00AD
|
||||
AE 017D
|
||||
AF 00AF
|
||||
B0 00B0
|
||||
B1 0105
|
||||
B2 02DB
|
||||
B3 0157
|
||||
B4 00B4
|
||||
B5 0129
|
||||
B6 013C
|
||||
B7 02C7
|
||||
B8 00B8
|
||||
B9 0161
|
||||
BA 0113
|
||||
BB 0123
|
||||
BC 0167
|
||||
BD 014A
|
||||
BE 017E
|
||||
BF 014B
|
||||
C0 0100
|
||||
C1 00C1
|
||||
C2 00C2
|
||||
C3 00C3
|
||||
C4 00C4
|
||||
C5 00C5
|
||||
C6 00C6
|
||||
C7 012E
|
||||
C8 010C
|
||||
C9 00C9
|
||||
CA 0118
|
||||
CB 00CB
|
||||
CC 0116
|
||||
CD 00CD
|
||||
CE 00CE
|
||||
CF 012A
|
||||
D0 0110
|
||||
D1 0145
|
||||
D2 014C
|
||||
D3 0136
|
||||
D4 00D4
|
||||
D5 00D5
|
||||
D6 00D6
|
||||
D7 00D7
|
||||
D8 00D8
|
||||
D9 0172
|
||||
DA 00DA
|
||||
DB 00DB
|
||||
DC 00DC
|
||||
DD 0168
|
||||
DE 016A
|
||||
DF 00DF
|
||||
E0 0101
|
||||
E1 00E1
|
||||
E2 00E2
|
||||
E3 00E3
|
||||
E4 00E4
|
||||
E5 00E5
|
||||
E6 00E6
|
||||
E7 012F
|
||||
E8 010D
|
||||
E9 00E9
|
||||
EA 0119
|
||||
EB 00EB
|
||||
EC 0117
|
||||
ED 00ED
|
||||
EE 00EE
|
||||
EF 012B
|
||||
F0 0111
|
||||
F1 0146
|
||||
F2 014D
|
||||
F3 0137
|
||||
F4 00F4
|
||||
F5 00F5
|
||||
F6 00F6
|
||||
F7 00F7
|
||||
F8 00F8
|
||||
F9 0173
|
||||
FA 00FA
|
||||
FB 00FB
|
||||
FC 00FC
|
||||
FD 0169
|
||||
FE 016B
|
||||
FF 02D9
|
||||
@@ -1,251 +0,0 @@
|
||||
charset 8bit
|
||||
|
||||
#
|
||||
# This file defines the font and character mappings used for ISO-8859-5
|
||||
# (Cyrillic) text printing.
|
||||
#
|
||||
# The first line consists of:
|
||||
#
|
||||
# direction width normal bold italic bold-italic
|
||||
#
|
||||
# Direction is the string "ltor" or "rtol", indicating left-to-right or
|
||||
# right-to-left text.
|
||||
#
|
||||
# Width is the string "single" or "double"; double means that the glyphs
|
||||
# are twice as wide as ASCII characters in the Courier typeface.
|
||||
#
|
||||
# "Normal", "bold", "italic", and "bold-italic" are the typefaces to use
|
||||
# for each presentation. If characters are only available in a single
|
||||
# style then only one typeface should be listed (e.g. "Symbol")
|
||||
#
|
||||
# Each font that is listed will be used (and downloaded if needed) when
|
||||
# printing.
|
||||
#
|
||||
|
||||
00 ff ltor single Courier Courier-Bold Courier-Italic Courier-BoldItalic
|
||||
|
||||
#
|
||||
# The following lines define the mapping from the 8-bit character set to
|
||||
# the Unicode glyphs for each character:
|
||||
#
|
||||
# char glyph
|
||||
#
|
||||
# "Char" and "glyph" are hexadecimal values.
|
||||
#
|
||||
|
||||
20 0020
|
||||
21 0021
|
||||
22 0022
|
||||
23 0023
|
||||
24 0024
|
||||
25 0025
|
||||
26 0026
|
||||
27 0027
|
||||
28 0028
|
||||
29 0029
|
||||
2A 002A
|
||||
2B 002B
|
||||
2C 002C
|
||||
2D 002D
|
||||
2E 002E
|
||||
2F 002F
|
||||
30 0030
|
||||
31 0031
|
||||
32 0032
|
||||
33 0033
|
||||
34 0034
|
||||
35 0035
|
||||
36 0036
|
||||
37 0037
|
||||
38 0038
|
||||
39 0039
|
||||
3A 003A
|
||||
3B 003B
|
||||
3C 003C
|
||||
3D 003D
|
||||
3E 003E
|
||||
3F 003F
|
||||
40 0040
|
||||
41 0041
|
||||
42 0042
|
||||
43 0043
|
||||
44 0044
|
||||
45 0045
|
||||
46 0046
|
||||
47 0047
|
||||
48 0048
|
||||
49 0049
|
||||
4A 004A
|
||||
4B 004B
|
||||
4C 004C
|
||||
4D 004D
|
||||
4E 004E
|
||||
4F 004F
|
||||
50 0050
|
||||
51 0051
|
||||
52 0052
|
||||
53 0053
|
||||
54 0054
|
||||
55 0055
|
||||
56 0056
|
||||
57 0057
|
||||
58 0058
|
||||
59 0059
|
||||
5A 005A
|
||||
5B 005B
|
||||
5C 005C
|
||||
5D 005D
|
||||
5E 005E
|
||||
5F 005F
|
||||
60 0060
|
||||
61 0061
|
||||
62 0062
|
||||
63 0063
|
||||
64 0064
|
||||
65 0065
|
||||
66 0066
|
||||
67 0067
|
||||
68 0068
|
||||
69 0069
|
||||
6A 006A
|
||||
6B 006B
|
||||
6C 006C
|
||||
6D 006D
|
||||
6E 006E
|
||||
6F 006F
|
||||
70 0070
|
||||
71 0071
|
||||
72 0072
|
||||
73 0073
|
||||
74 0074
|
||||
75 0075
|
||||
76 0076
|
||||
77 0077
|
||||
78 0078
|
||||
79 0079
|
||||
7A 007A
|
||||
7B 007B
|
||||
7C 007C
|
||||
7D 007D
|
||||
7E 007E
|
||||
80 20AC
|
||||
82 201A
|
||||
83 0192
|
||||
84 201E
|
||||
85 2026
|
||||
86 2020
|
||||
87 2021
|
||||
88 02C6
|
||||
89 2030
|
||||
8A 0160
|
||||
8B 2039
|
||||
8C 0152
|
||||
91 2018
|
||||
92 2019
|
||||
93 201C
|
||||
94 201D
|
||||
95 2022
|
||||
96 2013
|
||||
97 2014
|
||||
98 02DC
|
||||
99 2122
|
||||
9A 0161
|
||||
9B 203A
|
||||
9C 0153
|
||||
9F 0178
|
||||
A0 00A0
|
||||
A1 0401
|
||||
A2 0402
|
||||
A3 0403
|
||||
A4 0404
|
||||
A5 0405
|
||||
A6 0406
|
||||
A7 0407
|
||||
A8 0408
|
||||
A9 0409
|
||||
AA 040A
|
||||
AB 040B
|
||||
AC 040C
|
||||
AD 00AD
|
||||
AE 040E
|
||||
AF 040F
|
||||
B0 0410
|
||||
B1 0411
|
||||
B2 0412
|
||||
B3 0413
|
||||
B4 0414
|
||||
B5 0415
|
||||
B6 0416
|
||||
B7 0417
|
||||
B8 0418
|
||||
B9 0419
|
||||
BA 041A
|
||||
BB 041B
|
||||
BC 041C
|
||||
BD 041D
|
||||
BE 041E
|
||||
BF 041F
|
||||
C0 0420
|
||||
C1 0421
|
||||
C2 0422
|
||||
C3 0423
|
||||
C4 0424
|
||||
C5 0425
|
||||
C6 0426
|
||||
C7 0427
|
||||
C8 0428
|
||||
C9 0429
|
||||
CA 042A
|
||||
CB 042B
|
||||
CC 042C
|
||||
CD 042D
|
||||
CE 042E
|
||||
CF 042F
|
||||
D0 0430
|
||||
D1 0431
|
||||
D2 0432
|
||||
D3 0433
|
||||
D4 0434
|
||||
D5 0435
|
||||
D6 0436
|
||||
D7 0437
|
||||
D8 0438
|
||||
D9 0439
|
||||
DA 043A
|
||||
DB 043B
|
||||
DC 043C
|
||||
DD 043D
|
||||
DE 043E
|
||||
DF 043F
|
||||
E0 0440
|
||||
E1 0441
|
||||
E2 0442
|
||||
E3 0443
|
||||
E4 0444
|
||||
E5 0445
|
||||
E6 0446
|
||||
E7 0447
|
||||
E8 0448
|
||||
E9 0449
|
||||
EA 044A
|
||||
EB 044B
|
||||
EC 044C
|
||||
ED 044D
|
||||
EE 044E
|
||||
EF 044F
|
||||
F0 2116
|
||||
F1 0451
|
||||
F2 0452
|
||||
F3 0453
|
||||
F4 0454
|
||||
F5 0455
|
||||
F6 0456
|
||||
F7 0457
|
||||
F8 0458
|
||||
F9 0459
|
||||
FA 045A
|
||||
FB 045B
|
||||
FC 045C
|
||||
FD 00A7
|
||||
FE 045E
|
||||
FF 045F
|
||||
@@ -1,206 +0,0 @@
|
||||
charset 8bit
|
||||
|
||||
#
|
||||
# This file defines the font and character mappings used for ISO-8859-6
|
||||
# (Arabic) text printing.
|
||||
#
|
||||
# The first line consists of:
|
||||
#
|
||||
# direction width normal bold italic bold-italic
|
||||
#
|
||||
# Direction is the string "ltor" or "rtol", indicating left-to-right or
|
||||
# right-to-left text.
|
||||
#
|
||||
# Width is the string "single" or "double"; double means that the glyphs
|
||||
# are twice as wide as ASCII characters in the Courier typeface.
|
||||
#
|
||||
# "Normal", "bold", "italic", and "bold-italic" are the typefaces to use
|
||||
# for each presentation. If characters are only available in a single
|
||||
# style then only one typeface should be listed (e.g. "Symbol")
|
||||
#
|
||||
# Each font that is listed will be used (and downloaded if needed) when
|
||||
# printing.
|
||||
#
|
||||
|
||||
00 ff rtol single Courier Courier-Bold Courier-Italic Courier-BoldItalic
|
||||
|
||||
#
|
||||
# The following lines define the mapping from the 8-bit character set to
|
||||
# the Unicode glyphs for each character:
|
||||
#
|
||||
# char glyph
|
||||
#
|
||||
# "Char" and "glyph" are hexadecimal values.
|
||||
#
|
||||
|
||||
20 0020
|
||||
21 0021
|
||||
22 0022
|
||||
23 0023
|
||||
24 0024
|
||||
25 0025
|
||||
26 0026
|
||||
27 0027
|
||||
28 0028
|
||||
29 0029
|
||||
2A 002A
|
||||
2B 002B
|
||||
2C 002C
|
||||
2D 002D
|
||||
2E 002E
|
||||
2F 002F
|
||||
30 0660
|
||||
31 0661
|
||||
32 0662
|
||||
33 0663
|
||||
34 0664
|
||||
35 0665
|
||||
36 0666
|
||||
37 0667
|
||||
38 0668
|
||||
39 0669
|
||||
3A 003A
|
||||
3B 003B
|
||||
3C 003C
|
||||
3D 003D
|
||||
3E 003E
|
||||
3F 003F
|
||||
40 0040
|
||||
41 0041
|
||||
42 0042
|
||||
43 0043
|
||||
44 0044
|
||||
45 0045
|
||||
46 0046
|
||||
47 0047
|
||||
48 0048
|
||||
49 0049
|
||||
4A 004A
|
||||
4B 004B
|
||||
4C 004C
|
||||
4D 004D
|
||||
4E 004E
|
||||
4F 004F
|
||||
50 0050
|
||||
51 0051
|
||||
52 0052
|
||||
53 0053
|
||||
54 0054
|
||||
55 0055
|
||||
56 0056
|
||||
57 0057
|
||||
58 0058
|
||||
59 0059
|
||||
5A 005A
|
||||
5B 005B
|
||||
5C 005C
|
||||
5D 005D
|
||||
5E 005E
|
||||
5F 005F
|
||||
60 0060
|
||||
61 0061
|
||||
62 0062
|
||||
63 0063
|
||||
64 0064
|
||||
65 0065
|
||||
66 0066
|
||||
67 0067
|
||||
68 0068
|
||||
69 0069
|
||||
6A 006A
|
||||
6B 006B
|
||||
6C 006C
|
||||
6D 006D
|
||||
6E 006E
|
||||
6F 006F
|
||||
70 0070
|
||||
71 0071
|
||||
72 0072
|
||||
73 0073
|
||||
74 0074
|
||||
75 0075
|
||||
76 0076
|
||||
77 0077
|
||||
78 0078
|
||||
79 0079
|
||||
7A 007A
|
||||
7B 007B
|
||||
7C 007C
|
||||
7D 007D
|
||||
7E 007E
|
||||
80 20AC
|
||||
82 201A
|
||||
83 0192
|
||||
84 201E
|
||||
85 2026
|
||||
86 2020
|
||||
87 2021
|
||||
88 02C6
|
||||
89 2030
|
||||
8A 0160
|
||||
8B 2039
|
||||
8C 0152
|
||||
91 2018
|
||||
92 2019
|
||||
93 201C
|
||||
94 201D
|
||||
95 2022
|
||||
96 2013
|
||||
97 2014
|
||||
98 02DC
|
||||
99 2122
|
||||
9A 0161
|
||||
9B 203A
|
||||
9C 0153
|
||||
9F 0178
|
||||
A0 00A0
|
||||
A4 00A4
|
||||
AC 060C
|
||||
AD 00AD
|
||||
BB 061B
|
||||
BF 061F
|
||||
C1 0621
|
||||
C2 0622
|
||||
C3 0623
|
||||
C4 0624
|
||||
C5 0625
|
||||
C6 0626
|
||||
C7 0627
|
||||
C8 0628
|
||||
C9 0629
|
||||
CA 062A
|
||||
CB 062B
|
||||
CC 062C
|
||||
CD 062D
|
||||
CE 062E
|
||||
CF 062F
|
||||
D0 0630
|
||||
D1 0631
|
||||
D2 0632
|
||||
D3 0633
|
||||
D4 0634
|
||||
D5 0635
|
||||
D6 0636
|
||||
D7 0637
|
||||
D8 0638
|
||||
D9 0639
|
||||
DA 063A
|
||||
E0 0640
|
||||
E1 0641
|
||||
E2 0642
|
||||
E3 0643
|
||||
E4 0644
|
||||
E5 0645
|
||||
E6 0646
|
||||
E7 0647
|
||||
E8 0648
|
||||
E9 0649
|
||||
EA 064A
|
||||
EB 064B
|
||||
EC 064C
|
||||
ED 064D
|
||||
EE 064E
|
||||
EF 064F
|
||||
F0 0650
|
||||
F1 0651
|
||||
F2 0652
|
||||
@@ -1,246 +0,0 @@
|
||||
charset 8bit
|
||||
|
||||
#
|
||||
# This file defines the font and character mappings used for ISO-8859-7
|
||||
# (Greek) text printing.
|
||||
#
|
||||
# The first line consists of:
|
||||
#
|
||||
# direction width normal bold italic bold-italic
|
||||
#
|
||||
# Direction is the string "ltor" or "rtol", indicating left-to-right or
|
||||
# right-to-left text.
|
||||
#
|
||||
# Width is the string "single" or "double"; double means that the glyphs
|
||||
# are twice as wide as ASCII characters in the Courier typeface.
|
||||
#
|
||||
# "Normal", "bold", "italic", and "bold-italic" are the typefaces to use
|
||||
# for each presentation. If characters are only available in a single
|
||||
# style then only one typeface should be listed (e.g. "Symbol")
|
||||
#
|
||||
# Each font that is listed will be used (and downloaded if needed) when
|
||||
# printing.
|
||||
#
|
||||
|
||||
00 9f ltor single Courier Courier-Bold Courier-Italic Courier-BoldItalic
|
||||
a0 ff ltor single Symbol
|
||||
|
||||
#
|
||||
# The following lines define the mapping from the 8-bit character set to
|
||||
# the Unicode glyphs for each character:
|
||||
#
|
||||
# char glyph
|
||||
#
|
||||
# "Char" and "glyph" are hexadecimal values.
|
||||
#
|
||||
|
||||
20 0020
|
||||
21 0021
|
||||
22 0022
|
||||
23 0023
|
||||
24 0024
|
||||
25 0025
|
||||
26 0026
|
||||
27 0027
|
||||
28 0028
|
||||
29 0029
|
||||
2A 002A
|
||||
2B 002B
|
||||
2C 002C
|
||||
2D 002D
|
||||
2E 002E
|
||||
2F 002F
|
||||
30 0030
|
||||
31 0031
|
||||
32 0032
|
||||
33 0033
|
||||
34 0034
|
||||
35 0035
|
||||
36 0036
|
||||
37 0037
|
||||
38 0038
|
||||
39 0039
|
||||
3A 003A
|
||||
3B 003B
|
||||
3C 003C
|
||||
3D 003D
|
||||
3E 003E
|
||||
3F 003F
|
||||
40 0040
|
||||
41 0041
|
||||
42 0042
|
||||
43 0043
|
||||
44 0044
|
||||
45 0045
|
||||
46 0046
|
||||
47 0047
|
||||
48 0048
|
||||
49 0049
|
||||
4A 004A
|
||||
4B 004B
|
||||
4C 004C
|
||||
4D 004D
|
||||
4E 004E
|
||||
4F 004F
|
||||
50 0050
|
||||
51 0051
|
||||
52 0052
|
||||
53 0053
|
||||
54 0054
|
||||
55 0055
|
||||
56 0056
|
||||
57 0057
|
||||
58 0058
|
||||
59 0059
|
||||
5A 005A
|
||||
5B 005B
|
||||
5C 005C
|
||||
5D 005D
|
||||
5E 005E
|
||||
5F 005F
|
||||
60 0060
|
||||
61 0061
|
||||
62 0062
|
||||
63 0063
|
||||
64 0064
|
||||
65 0065
|
||||
66 0066
|
||||
67 0067
|
||||
68 0068
|
||||
69 0069
|
||||
6A 006A
|
||||
6B 006B
|
||||
6C 006C
|
||||
6D 006D
|
||||
6E 006E
|
||||
6F 006F
|
||||
70 0070
|
||||
71 0071
|
||||
72 0072
|
||||
73 0073
|
||||
74 0074
|
||||
75 0075
|
||||
76 0076
|
||||
77 0077
|
||||
78 0078
|
||||
79 0079
|
||||
7A 007A
|
||||
7B 007B
|
||||
7C 007C
|
||||
7D 007D
|
||||
7E 007E
|
||||
80 20AC
|
||||
82 201A
|
||||
83 0192
|
||||
84 201E
|
||||
85 2026
|
||||
86 2020
|
||||
87 2021
|
||||
88 02C6
|
||||
89 2030
|
||||
8A 0160
|
||||
8B 2039
|
||||
8C 0152
|
||||
91 2018
|
||||
92 2019
|
||||
93 201C
|
||||
94 201D
|
||||
95 2022
|
||||
96 2013
|
||||
97 2014
|
||||
98 02DC
|
||||
99 2122
|
||||
9A 0161
|
||||
9B 203A
|
||||
9C 0153
|
||||
9F 0178
|
||||
A0 00A0
|
||||
A1 02BD
|
||||
A2 02BC
|
||||
A3 00A3
|
||||
A6 00A6
|
||||
A7 00A7
|
||||
A8 00A8
|
||||
A9 00A9
|
||||
AB 00AB
|
||||
AC 00AC
|
||||
AD 00AD
|
||||
AF 2015
|
||||
B0 00B0
|
||||
B1 00B1
|
||||
B2 00B2
|
||||
B3 00B3
|
||||
B4 0384
|
||||
B5 0385
|
||||
B6 0386
|
||||
B7 00B7
|
||||
B8 0388
|
||||
B9 0389
|
||||
BA 038A
|
||||
BB 00BB
|
||||
BC 038C
|
||||
BD 00BD
|
||||
BE 038E
|
||||
BF 038F
|
||||
C0 0390
|
||||
C1 0391
|
||||
C2 0392
|
||||
C3 0393
|
||||
C4 0394
|
||||
C5 0395
|
||||
C6 0396
|
||||
C7 0397
|
||||
C8 0398
|
||||
C9 0399
|
||||
CA 039A
|
||||
CB 039B
|
||||
CC 039C
|
||||
CD 039D
|
||||
CE 039E
|
||||
CF 039F
|
||||
D0 03A0
|
||||
D1 03A1
|
||||
D3 03A3
|
||||
D4 03A4
|
||||
D5 03A5
|
||||
D6 03A6
|
||||
D7 03A7
|
||||
D8 03A8
|
||||
D9 03A9
|
||||
DA 03AA
|
||||
DB 03AB
|
||||
DC 03AC
|
||||
DD 03AD
|
||||
DE 03AE
|
||||
DF 03AF
|
||||
E0 03B0
|
||||
E1 03B1
|
||||
E2 03B2
|
||||
E3 03B3
|
||||
E4 03B4
|
||||
E5 03B5
|
||||
E6 03B6
|
||||
E7 03B7
|
||||
E8 03B8
|
||||
E9 03B9
|
||||
EA 03BA
|
||||
EB 03BB
|
||||
EC 03BC
|
||||
ED 03BD
|
||||
EE 03BE
|
||||
EF 03BF
|
||||
F0 03C0
|
||||
F1 03C1
|
||||
F2 03C2
|
||||
F3 03C3
|
||||
F4 03C4
|
||||
F5 03C5
|
||||
F6 03C6
|
||||
F7 03C7
|
||||
F8 03C8
|
||||
F9 03C9
|
||||
FA 03CA
|
||||
FB 03CB
|
||||
FC 03CC
|
||||
FD 03CD
|
||||
FE 03CE
|
||||
@@ -1,214 +0,0 @@
|
||||
charset 8bit
|
||||
|
||||
#
|
||||
# This file defines the font and character mappings used for ISO-8859-8
|
||||
# (Hebrew) text printing.
|
||||
#
|
||||
# The first line consists of:
|
||||
#
|
||||
# direction width normal bold italic bold-italic
|
||||
#
|
||||
# Direction is the string "ltor" or "rtol", indicating left-to-right or
|
||||
# right-to-left text.
|
||||
#
|
||||
# Width is the string "single" or "double"; double means that the glyphs
|
||||
# are twice as wide as ASCII characters in the Courier typeface.
|
||||
#
|
||||
# "Normal", "bold", "italic", and "bold-italic" are the typefaces to use
|
||||
# for each presentation. If characters are only available in a single
|
||||
# style then only one typeface should be listed (e.g. "Symbol")
|
||||
#
|
||||
# Each font that is listed will be used (and downloaded if needed) when
|
||||
# printing.
|
||||
#
|
||||
|
||||
00 7f ltor single Courier Courier-Bold Courier-Italic Courier-BoldItalic
|
||||
80 ff rtol single Courier
|
||||
|
||||
#
|
||||
# The following lines define the mapping from the 8-bit character set to
|
||||
# the Unicode glyphs for each character:
|
||||
#
|
||||
# char glyph
|
||||
#
|
||||
# "Char" and "glyph" are hexadecimal values.
|
||||
#
|
||||
|
||||
20 0020
|
||||
21 0021
|
||||
22 0022
|
||||
23 0023
|
||||
24 0024
|
||||
25 0025
|
||||
26 0026
|
||||
27 0027
|
||||
28 0028
|
||||
29 0029
|
||||
2A 002A
|
||||
2B 002B
|
||||
2C 002C
|
||||
2D 002D
|
||||
2E 002E
|
||||
2F 002F
|
||||
30 0030
|
||||
31 0031
|
||||
32 0032
|
||||
33 0033
|
||||
34 0034
|
||||
35 0035
|
||||
36 0036
|
||||
37 0037
|
||||
38 0038
|
||||
39 0039
|
||||
3A 003A
|
||||
3B 003B
|
||||
3C 003C
|
||||
3D 003D
|
||||
3E 003E
|
||||
3F 003F
|
||||
40 0040
|
||||
41 0041
|
||||
42 0042
|
||||
43 0043
|
||||
44 0044
|
||||
45 0045
|
||||
46 0046
|
||||
47 0047
|
||||
48 0048
|
||||
49 0049
|
||||
4A 004A
|
||||
4B 004B
|
||||
4C 004C
|
||||
4D 004D
|
||||
4E 004E
|
||||
4F 004F
|
||||
50 0050
|
||||
51 0051
|
||||
52 0052
|
||||
53 0053
|
||||
54 0054
|
||||
55 0055
|
||||
56 0056
|
||||
57 0057
|
||||
58 0058
|
||||
59 0059
|
||||
5A 005A
|
||||
5B 005B
|
||||
5C 005C
|
||||
5D 005D
|
||||
5E 005E
|
||||
5F 005F
|
||||
60 0060
|
||||
61 0061
|
||||
62 0062
|
||||
63 0063
|
||||
64 0064
|
||||
65 0065
|
||||
66 0066
|
||||
67 0067
|
||||
68 0068
|
||||
69 0069
|
||||
6A 006A
|
||||
6B 006B
|
||||
6C 006C
|
||||
6D 006D
|
||||
6E 006E
|
||||
6F 006F
|
||||
70 0070
|
||||
71 0071
|
||||
72 0072
|
||||
73 0073
|
||||
74 0074
|
||||
75 0075
|
||||
76 0076
|
||||
77 0077
|
||||
78 0078
|
||||
79 0079
|
||||
7A 007A
|
||||
7B 007B
|
||||
7C 007C
|
||||
7D 007D
|
||||
7E 007E
|
||||
80 20AC
|
||||
82 201A
|
||||
83 0192
|
||||
84 201E
|
||||
85 2026
|
||||
86 2020
|
||||
87 2021
|
||||
88 02C6
|
||||
89 2030
|
||||
8A 0160
|
||||
8B 2039
|
||||
8C 0152
|
||||
91 2018
|
||||
92 2019
|
||||
93 201C
|
||||
94 201D
|
||||
95 2022
|
||||
96 2013
|
||||
97 2014
|
||||
98 02DC
|
||||
99 2122
|
||||
9A 0161
|
||||
9B 203A
|
||||
9C 0153
|
||||
9F 0178
|
||||
A0 00A0
|
||||
A2 00A2
|
||||
A3 00A3
|
||||
A4 00A4
|
||||
A5 00A5
|
||||
A6 00A6
|
||||
A7 00A7
|
||||
A8 00A8
|
||||
A9 00A9
|
||||
AA 00D7
|
||||
AB 00AB
|
||||
AC 00AC
|
||||
AD 00AD
|
||||
AE 00AE
|
||||
AF 203E
|
||||
B0 00B0
|
||||
B1 00B1
|
||||
B2 00B2
|
||||
B3 00B3
|
||||
B4 00B4
|
||||
B5 00B5
|
||||
B6 00B6
|
||||
B7 00B7
|
||||
B8 00B8
|
||||
B9 00B9
|
||||
BA 00F7
|
||||
BB 00BB
|
||||
BC 00BC
|
||||
BD 00BD
|
||||
BE 00BE
|
||||
DF 2017
|
||||
E0 05D0
|
||||
E1 05D1
|
||||
E2 05D2
|
||||
E3 05D3
|
||||
E4 05D4
|
||||
E5 05D5
|
||||
E6 05D6
|
||||
E7 05D7
|
||||
E8 05D8
|
||||
E9 05D9
|
||||
EA 05DA
|
||||
EB 05DB
|
||||
EC 05DC
|
||||
ED 05DD
|
||||
EE 05DE
|
||||
EF 05DF
|
||||
F0 05E0
|
||||
F1 05E1
|
||||
F2 05E2
|
||||
F3 05E3
|
||||
F4 05E4
|
||||
F5 05E5
|
||||
F6 05E6
|
||||
F7 05E7
|
||||
F8 05E8
|
||||
F9 05E9
|
||||
FA 05EA
|
||||
@@ -1,251 +0,0 @@
|
||||
charset 8bit
|
||||
|
||||
#
|
||||
# This file defines the font and character mappings used for ISO-8859-9
|
||||
# (Latin5/Turkish) text printing.
|
||||
#
|
||||
# The first line consists of:
|
||||
#
|
||||
# direction width normal bold italic bold-italic
|
||||
#
|
||||
# Direction is the string "ltor" or "rtol", indicating left-to-right or
|
||||
# right-to-left text.
|
||||
#
|
||||
# Width is the string "single" or "double"; double means that the glyphs
|
||||
# are twice as wide as ASCII characters in the Courier typeface.
|
||||
#
|
||||
# "Normal", "bold", "italic", and "bold-italic" are the typefaces to use
|
||||
# for each presentation. If characters are only available in a single
|
||||
# style then only one typeface should be listed (e.g. "Symbol")
|
||||
#
|
||||
# Each font that is listed will be used (and downloaded if needed) when
|
||||
# printing.
|
||||
#
|
||||
|
||||
00 ff ltor single Courier Courier-Bold Courier-Italic Courier-BoldItalic
|
||||
|
||||
#
|
||||
# The following lines define the mapping from the 8-bit character set to
|
||||
# the Unicode glyphs for each character:
|
||||
#
|
||||
# char glyph
|
||||
#
|
||||
# "Char" and "glyph" are hexadecimal values.
|
||||
#
|
||||
|
||||
20 0020
|
||||
21 0021
|
||||
22 0022
|
||||
23 0023
|
||||
24 0024
|
||||
25 0025
|
||||
26 0026
|
||||
27 0027
|
||||
28 0028
|
||||
29 0029
|
||||
2A 002A
|
||||
2B 002B
|
||||
2C 002C
|
||||
2D 002D
|
||||
2E 002E
|
||||
2F 002F
|
||||
30 0030
|
||||
31 0031
|
||||
32 0032
|
||||
33 0033
|
||||
34 0034
|
||||
35 0035
|
||||
36 0036
|
||||
37 0037
|
||||
38 0038
|
||||
39 0039
|
||||
3A 003A
|
||||
3B 003B
|
||||
3C 003C
|
||||
3D 003D
|
||||
3E 003E
|
||||
3F 003F
|
||||
40 0040
|
||||
41 0041
|
||||
42 0042
|
||||
43 0043
|
||||
44 0044
|
||||
45 0045
|
||||
46 0046
|
||||
47 0047
|
||||
48 0048
|
||||
49 0049
|
||||
4A 004A
|
||||
4B 004B
|
||||
4C 004C
|
||||
4D 004D
|
||||
4E 004E
|
||||
4F 004F
|
||||
50 0050
|
||||
51 0051
|
||||
52 0052
|
||||
53 0053
|
||||
54 0054
|
||||
55 0055
|
||||
56 0056
|
||||
57 0057
|
||||
58 0058
|
||||
59 0059
|
||||
5A 005A
|
||||
5B 005B
|
||||
5C 005C
|
||||
5D 005D
|
||||
5E 005E
|
||||
5F 005F
|
||||
60 0060
|
||||
61 0061
|
||||
62 0062
|
||||
63 0063
|
||||
64 0064
|
||||
65 0065
|
||||
66 0066
|
||||
67 0067
|
||||
68 0068
|
||||
69 0069
|
||||
6A 006A
|
||||
6B 006B
|
||||
6C 006C
|
||||
6D 006D
|
||||
6E 006E
|
||||
6F 006F
|
||||
70 0070
|
||||
71 0071
|
||||
72 0072
|
||||
73 0073
|
||||
74 0074
|
||||
75 0075
|
||||
76 0076
|
||||
77 0077
|
||||
78 0078
|
||||
79 0079
|
||||
7A 007A
|
||||
7B 007B
|
||||
7C 007C
|
||||
7D 007D
|
||||
7E 007E
|
||||
80 20AC
|
||||
82 201A
|
||||
83 0192
|
||||
84 201E
|
||||
85 2026
|
||||
86 2020
|
||||
87 2021
|
||||
88 02C6
|
||||
89 2030
|
||||
8A 0160
|
||||
8B 2039
|
||||
8C 0152
|
||||
91 2018
|
||||
92 2019
|
||||
93 201C
|
||||
94 201D
|
||||
95 2022
|
||||
96 2013
|
||||
97 2014
|
||||
98 02DC
|
||||
99 2122
|
||||
9A 0161
|
||||
9B 203A
|
||||
9C 0153
|
||||
9F 0178
|
||||
A0 00A0
|
||||
A1 00A1
|
||||
A2 00A2
|
||||
A3 00A3
|
||||
A4 00A4
|
||||
A5 00A5
|
||||
A6 00A6
|
||||
A7 00A7
|
||||
A8 00A8
|
||||
A9 00A9
|
||||
AA 00AA
|
||||
AB 00AB
|
||||
AC 00AC
|
||||
AD 00AD
|
||||
AE 00AE
|
||||
AF 00AF
|
||||
B0 00B0
|
||||
B1 00B1
|
||||
B2 00B2
|
||||
B3 00B3
|
||||
B4 00B4
|
||||
B5 00B5
|
||||
B6 00B6
|
||||
B7 00B7
|
||||
B8 00B8
|
||||
B9 00B9
|
||||
BA 00BA
|
||||
BB 00BB
|
||||
BC 00BC
|
||||
BD 00BD
|
||||
BE 00BE
|
||||
BF 00BF
|
||||
C0 00C0
|
||||
C1 00C1
|
||||
C2 00C2
|
||||
C3 00C3
|
||||
C4 00C4
|
||||
C5 00C5
|
||||
C6 00C6
|
||||
C7 00C7
|
||||
C8 00C8
|
||||
C9 00C9
|
||||
CA 00CA
|
||||
CB 00CB
|
||||
CC 00CC
|
||||
CD 00CD
|
||||
CE 00CE
|
||||
CF 00CF
|
||||
D0 011E
|
||||
D1 00D1
|
||||
D2 00D2
|
||||
D3 00D3
|
||||
D4 00D4
|
||||
D5 00D5
|
||||
D6 00D6
|
||||
D7 00D7
|
||||
D8 00D8
|
||||
D9 00D9
|
||||
DA 00DA
|
||||
DB 00DB
|
||||
DC 00DC
|
||||
DD 0130
|
||||
DE 015E
|
||||
DF 00DF
|
||||
E0 00E0
|
||||
E1 00E1
|
||||
E2 00E2
|
||||
E3 00E3
|
||||
E4 00E4
|
||||
E5 00E5
|
||||
E6 00E6
|
||||
E7 00E7
|
||||
E8 00E8
|
||||
E9 00E9
|
||||
EA 00EA
|
||||
EB 00EB
|
||||
EC 00EC
|
||||
ED 00ED
|
||||
EE 00EE
|
||||
EF 00EF
|
||||
F0 011F
|
||||
F1 00F1
|
||||
F2 00F2
|
||||
F3 00F3
|
||||
F4 00F4
|
||||
F5 00F5
|
||||
F6 00F6
|
||||
F7 00F7
|
||||
F8 00F8
|
||||
F9 00F9
|
||||
FA 00FA
|
||||
FB 00FB
|
||||
FC 00FC
|
||||
FD 0131
|
||||
FE 015F
|
||||
FF 00FF
|
||||
-261
@@ -1,261 +0,0 @@
|
||||
charset 8bit
|
||||
|
||||
#
|
||||
# This file defines the font and character mappings used for Russian
|
||||
# Code Page KOI8-R text printing.
|
||||
#
|
||||
# The first line consists of:
|
||||
#
|
||||
# direction width normal bold italic bold-italic
|
||||
#
|
||||
# Direction is the string "ltor" or "rtol", indicating left-to-right or
|
||||
# right-to-left text.
|
||||
#
|
||||
# Width is the string "single" or "double"; double means that the glyphs
|
||||
# are twice as wide as ASCII characters in the Courier typeface.
|
||||
#
|
||||
# "Normal", "bold", "italic", and "bold-italic" are the typefaces to use
|
||||
# for each presentation. If characters are only available in a single
|
||||
# style then only one typeface should be listed (e.g. "Symbol")
|
||||
#
|
||||
# Each font that is listed will be used (and downloaded if needed) when
|
||||
# printing.
|
||||
#
|
||||
|
||||
00 ff ltor single Courier Courier-Bold Courier-Italic Courier-BoldItalic
|
||||
|
||||
#
|
||||
# The following lines define the mapping from the 8-bit character set to
|
||||
# the Unicode glyphs for each character:
|
||||
#
|
||||
# char glyph
|
||||
#
|
||||
# "Char" and "glyph" are hexadecimal values.
|
||||
#
|
||||
|
||||
20 0020
|
||||
21 0021
|
||||
22 0022
|
||||
23 0023
|
||||
24 0024
|
||||
25 0025
|
||||
26 0026
|
||||
27 0027
|
||||
28 0028
|
||||
29 0029
|
||||
2A 002A
|
||||
2B 002B
|
||||
2C 002C
|
||||
2D 002D
|
||||
2E 002E
|
||||
2F 002F
|
||||
30 0030
|
||||
31 0031
|
||||
32 0032
|
||||
33 0033
|
||||
34 0034
|
||||
35 0035
|
||||
36 0036
|
||||
37 0037
|
||||
38 0038
|
||||
39 0039
|
||||
3A 003A
|
||||
3B 003B
|
||||
3C 003C
|
||||
3D 003D
|
||||
3E 003E
|
||||
3F 003F
|
||||
40 0040
|
||||
41 0041
|
||||
42 0042
|
||||
43 0043
|
||||
44 0044
|
||||
45 0045
|
||||
46 0046
|
||||
47 0047
|
||||
48 0048
|
||||
49 0049
|
||||
4A 004A
|
||||
4B 004B
|
||||
4C 004C
|
||||
4D 004D
|
||||
4E 004E
|
||||
4F 004F
|
||||
50 0050
|
||||
51 0051
|
||||
52 0052
|
||||
53 0053
|
||||
54 0054
|
||||
55 0055
|
||||
56 0056
|
||||
57 0057
|
||||
58 0058
|
||||
59 0059
|
||||
5A 005A
|
||||
5B 005B
|
||||
5C 005C
|
||||
5D 005D
|
||||
5E 005E
|
||||
5F 005F
|
||||
60 0060
|
||||
61 0061
|
||||
62 0062
|
||||
63 0063
|
||||
64 0064
|
||||
65 0065
|
||||
66 0066
|
||||
67 0067
|
||||
68 0068
|
||||
69 0069
|
||||
6A 006A
|
||||
6B 006B
|
||||
6C 006C
|
||||
6D 006D
|
||||
6E 006E
|
||||
6F 006F
|
||||
70 0070
|
||||
71 0071
|
||||
72 0072
|
||||
73 0073
|
||||
74 0074
|
||||
75 0075
|
||||
76 0076
|
||||
77 0077
|
||||
78 0078
|
||||
79 0079
|
||||
7A 007A
|
||||
7B 007B
|
||||
7C 007C
|
||||
7D 007D
|
||||
7E 007E
|
||||
7F 007F
|
||||
80 2500
|
||||
81 2502
|
||||
82 250C
|
||||
83 2510
|
||||
84 2514
|
||||
85 2518
|
||||
86 251C
|
||||
87 2524
|
||||
88 252C
|
||||
89 2534
|
||||
8A 253C
|
||||
8B 2580
|
||||
8C 2584
|
||||
8D 2588
|
||||
8E 258C
|
||||
8F 2590
|
||||
90 2591
|
||||
91 2592
|
||||
92 2593
|
||||
93 2320
|
||||
94 25A0
|
||||
95 2219
|
||||
96 221A
|
||||
97 2248
|
||||
98 2264
|
||||
99 2265
|
||||
9A 00A0
|
||||
9B 2321
|
||||
9C 00B0
|
||||
9D 00B2
|
||||
9E 00B7
|
||||
9F 00F7
|
||||
A0 2550
|
||||
A1 2551
|
||||
A2 2552
|
||||
A3 0451
|
||||
A4 2553
|
||||
A5 2554
|
||||
A6 2555
|
||||
A7 2556
|
||||
A8 2557
|
||||
A9 2558
|
||||
AA 2559
|
||||
AB 255A
|
||||
AC 255B
|
||||
AD 255C
|
||||
AE 255D
|
||||
AF 255E
|
||||
B0 255F
|
||||
B1 2560
|
||||
B2 2561
|
||||
B3 0401
|
||||
B4 2562
|
||||
B5 2563
|
||||
B6 2564
|
||||
B7 2565
|
||||
B8 2566
|
||||
B9 2567
|
||||
BA 2568
|
||||
BB 2569
|
||||
BC 256A
|
||||
BD 256B
|
||||
BE 256C
|
||||
BF 00A9
|
||||
C0 044E
|
||||
C1 0430
|
||||
C2 0431
|
||||
C3 0446
|
||||
C4 0434
|
||||
C5 0435
|
||||
C6 0444
|
||||
C7 0433
|
||||
C8 0445
|
||||
C9 0438
|
||||
CA 0439
|
||||
CB 043A
|
||||
CC 043B
|
||||
CD 043C
|
||||
CE 043D
|
||||
CF 043E
|
||||
D0 043F
|
||||
D1 044F
|
||||
D2 0440
|
||||
D3 0441
|
||||
D4 0442
|
||||
D5 0443
|
||||
D6 0436
|
||||
D7 0432
|
||||
D8 044C
|
||||
D9 044B
|
||||
DA 0437
|
||||
DB 0448
|
||||
DC 044D
|
||||
DD 0449
|
||||
DE 0447
|
||||
DF 044A
|
||||
E0 042E
|
||||
E1 0410
|
||||
E2 0411
|
||||
E3 0426
|
||||
E4 0414
|
||||
E5 0415
|
||||
E6 0424
|
||||
E7 0413
|
||||
E8 0425
|
||||
E9 0418
|
||||
EA 0419
|
||||
EB 041A
|
||||
EC 041B
|
||||
ED 041C
|
||||
EE 041D
|
||||
EF 041E
|
||||
F0 041F
|
||||
F1 042F
|
||||
F2 0420
|
||||
F3 0421
|
||||
F4 0422
|
||||
F5 0423
|
||||
F6 0416
|
||||
F7 0412
|
||||
F8 042C
|
||||
F9 042B
|
||||
FA 0417
|
||||
FB 0428
|
||||
FC 042D
|
||||
FD 0429
|
||||
FE 0427
|
||||
FF 042A
|
||||
|
||||
|
||||
-259
@@ -1,259 +0,0 @@
|
||||
charset 8bit
|
||||
|
||||
#
|
||||
# This file defines the font and character mappings used for Ukrainian
|
||||
# Code Page KOI8-U text printing.
|
||||
#
|
||||
# The first line consists of:
|
||||
#
|
||||
# direction width normal bold italic bold-italic
|
||||
#
|
||||
# Direction is the string "ltor" or "rtol", indicating left-to-right or
|
||||
# right-to-left text.
|
||||
#
|
||||
# Width is the string "single" or "double"; double means that the glyphs
|
||||
# are twice as wide as ASCII characters in the Courier typeface.
|
||||
#
|
||||
# "Normal", "bold", "italic", and "bold-italic" are the typefaces to use
|
||||
# for each presentation. If characters are only available in a single
|
||||
# style then only one typeface should be listed (e.g. "Symbol")
|
||||
#
|
||||
# Each font that is listed will be used (and downloaded if needed) when
|
||||
# printing.
|
||||
#
|
||||
|
||||
00 ff ltor single Courier Courier-Bold Courier-Italic Courier-BoldItalic
|
||||
|
||||
#
|
||||
# The following lines define the mapping from the 8-bit character set to
|
||||
# the Unicode glyphs for each character:
|
||||
#
|
||||
# char glyph
|
||||
#
|
||||
# "Char" and "glyph" are hexadecimal values.
|
||||
#
|
||||
|
||||
20 0020
|
||||
21 0021
|
||||
22 0022
|
||||
23 0023
|
||||
24 0024
|
||||
25 0025
|
||||
26 0026
|
||||
27 0027
|
||||
28 0028
|
||||
29 0029
|
||||
2A 002A
|
||||
2B 002B
|
||||
2C 002C
|
||||
2D 002D
|
||||
2E 002E
|
||||
2F 002F
|
||||
30 0030
|
||||
31 0031
|
||||
32 0032
|
||||
33 0033
|
||||
34 0034
|
||||
35 0035
|
||||
36 0036
|
||||
37 0037
|
||||
38 0038
|
||||
39 0039
|
||||
3A 003A
|
||||
3B 003B
|
||||
3C 003C
|
||||
3D 003D
|
||||
3E 003E
|
||||
3F 003F
|
||||
40 0040
|
||||
41 0041
|
||||
42 0042
|
||||
43 0043
|
||||
44 0044
|
||||
45 0045
|
||||
46 0046
|
||||
47 0047
|
||||
48 0048
|
||||
49 0049
|
||||
4A 004A
|
||||
4B 004B
|
||||
4C 004C
|
||||
4D 004D
|
||||
4E 004E
|
||||
4F 004F
|
||||
50 0050
|
||||
51 0051
|
||||
52 0052
|
||||
53 0053
|
||||
54 0054
|
||||
55 0055
|
||||
56 0056
|
||||
57 0057
|
||||
58 0058
|
||||
59 0059
|
||||
5A 005A
|
||||
5B 005B
|
||||
5C 005C
|
||||
5D 005D
|
||||
5E 005E
|
||||
5F 005F
|
||||
60 0060
|
||||
61 0061
|
||||
62 0062
|
||||
63 0063
|
||||
64 0064
|
||||
65 0065
|
||||
66 0066
|
||||
67 0067
|
||||
68 0068
|
||||
69 0069
|
||||
6A 006A
|
||||
6B 006B
|
||||
6C 006C
|
||||
6D 006D
|
||||
6E 006E
|
||||
6F 006F
|
||||
70 0070
|
||||
71 0071
|
||||
72 0072
|
||||
73 0073
|
||||
74 0074
|
||||
75 0075
|
||||
76 0076
|
||||
77 0077
|
||||
78 0078
|
||||
79 0079
|
||||
7A 007A
|
||||
7B 007B
|
||||
7C 007C
|
||||
7D 007D
|
||||
7E 007E
|
||||
7F 007F
|
||||
80 2500
|
||||
81 2502
|
||||
82 250C
|
||||
83 2510
|
||||
84 2514
|
||||
85 2518
|
||||
86 251C
|
||||
87 2524
|
||||
88 252C
|
||||
89 2534
|
||||
8A 253C
|
||||
8B 2580
|
||||
8C 2584
|
||||
8D 2588
|
||||
8E 258C
|
||||
8F 2590
|
||||
90 2591
|
||||
91 2592
|
||||
92 2593
|
||||
93 2320
|
||||
94 25A0
|
||||
95 2219
|
||||
96 221A
|
||||
97 2248
|
||||
98 2264
|
||||
99 2265
|
||||
9A 00A0
|
||||
9B 2321
|
||||
9C 00B0
|
||||
9D 00B2
|
||||
9E 00B7
|
||||
9F 00F7
|
||||
A0 2550
|
||||
A1 2551
|
||||
A2 2552
|
||||
A3 0451
|
||||
A4 0454
|
||||
A5 2554
|
||||
A6 0456
|
||||
A7 0457
|
||||
A8 2557
|
||||
A9 2558
|
||||
AA 2559
|
||||
AB 255A
|
||||
AC 255B
|
||||
AD 0491
|
||||
AE 255D
|
||||
AF 255E
|
||||
B0 255F
|
||||
B1 2560
|
||||
B2 2561
|
||||
B3 0401
|
||||
B4 0404
|
||||
B5 2563
|
||||
B6 0406
|
||||
B7 0407
|
||||
B8 2566
|
||||
B9 2567
|
||||
BA 2568
|
||||
BB 2569
|
||||
BC 256A
|
||||
BD 0490
|
||||
BE 256C
|
||||
BF 00A9
|
||||
C0 044E
|
||||
C1 0430
|
||||
C2 0431
|
||||
C3 0446
|
||||
C4 0434
|
||||
C5 0435
|
||||
C6 0444
|
||||
C7 0433
|
||||
C8 0445
|
||||
C9 0438
|
||||
CA 0439
|
||||
CB 043A
|
||||
CC 043B
|
||||
CD 043C
|
||||
CE 043D
|
||||
CF 043E
|
||||
D0 043F
|
||||
D1 044F
|
||||
D2 0440
|
||||
D3 0441
|
||||
D4 0442
|
||||
D5 0443
|
||||
D6 0436
|
||||
D7 0432
|
||||
D8 044C
|
||||
D9 044B
|
||||
DA 0437
|
||||
DB 0448
|
||||
DC 044D
|
||||
DD 0449
|
||||
DE 0447
|
||||
DF 044A
|
||||
E0 042E
|
||||
E1 0410
|
||||
E2 0411
|
||||
E3 0426
|
||||
E4 0414
|
||||
E5 0415
|
||||
E6 0424
|
||||
E7 0413
|
||||
E8 0425
|
||||
E9 0418
|
||||
EA 0419
|
||||
EB 041A
|
||||
EC 041B
|
||||
ED 041C
|
||||
EE 041D
|
||||
EF 041E
|
||||
F0 041F
|
||||
F1 042F
|
||||
F2 0420
|
||||
F3 0421
|
||||
F4 0422
|
||||
F5 0423
|
||||
F6 0416
|
||||
F7 0412
|
||||
F8 042C
|
||||
F9 042B
|
||||
FA 0417
|
||||
FB 0428
|
||||
FC 042D
|
||||
FD 0429
|
||||
FE 0427
|
||||
FF 042A
|
||||
+4
-4
@@ -14,7 +14,7 @@
|
||||
%
|
||||
% PostScript test page for the Common UNIX Printing System ("CUPS").
|
||||
%
|
||||
% Copyright 2007 Apple Inc.
|
||||
% Copyright 2007-2008 Apple Inc.
|
||||
% Copyright 1993-2007 Easy Software Products
|
||||
%
|
||||
% These coded instructions, statements, and computer programs are the
|
||||
@@ -573,10 +573,10 @@ gsave
|
||||
pageHeight 8 mul % Move down...
|
||||
2 copy moveto % Position text
|
||||
smallFont setfont % Font
|
||||
(Copyright 2007 Apple Inc., All Rights Reserved. CUPS and the CUPS logo are the trademark) show
|
||||
(Copyright 2007-2008 Apple Inc., All Rights Reserved. CUPS and the CUPS logo are the) show
|
||||
pageHeight 2 add sub % Move down...
|
||||
2 copy moveto % Position text
|
||||
(property of Apple Inc., 1 Infinite Loop, Cupertino, CA 95014, USA.) show
|
||||
(trademark property of Apple Inc., 1 Infinite Loop, Cupertino, CA 95014, USA.) show
|
||||
pageHeight 2 mul 4 add sub % Move down...
|
||||
moveto % Position text
|
||||
(Need help? Contact your operating system vendor or visit "http://www.cups.org/".) show
|
||||
@@ -593,6 +593,6 @@ gsave
|
||||
grestore
|
||||
showpage
|
||||
%
|
||||
% End of "$Id: testprint.ps 6649 2007-07-11 21:46:42Z mike $".
|
||||
% End of "$Id: testprint.ps 7158 2008-01-02 21:23:11Z mike $".
|
||||
%
|
||||
%%EOF
|
||||
|
||||
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