[cups.development] [RFE] STR #2638: Add cupsGetNamedDest() API for faster command-line printing

Michael Sweet msweet at apple.com
Wed Dec 19 10:37:55 PST 2007


DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

Currently lp and lpr need to get the full list of printers and classes from
the server before they will decide a) which printer to use and b) what
default options to use.

The cups-lpd code contains an implementation of a "fast" path for when the
destination name is known - this could be expanded into a CUPS API to speed
up lp and lpr when there are large numbers of printers, and could
conceivably be used by GUI apps when the user has already selected a
printer.

To support the selection of a default printer, the API would need to look
in the following places:

    1. LPDEST env var
    2. PRINTER env var
    3. ~/.cups/lpoptions or ~/.lpoptions file
    4. /etc/cups/lpoptions file
    5. CUPS_GET_DEFAULT operation

The latter call could be incorporated into the request that gets the
printer attributes, i.e. when we have a name, use
IPP_GET_PRINTER_ATTRIBUTES, otherwise CUPS_GET_DEFAULT.

Once the server-side defaults are retrieved, the API would then need to
read the /etc/cups/lpoptions and ~/.lpoptions or ~/.cups/lpoptions files
to get any overrides, returning the composite result to the caller.

The caller could then free the return value with the cupsFreeDests()
function, specifying 1 for the number of destinations.

Link: http://www.cups.org/str.php?L2638
Version: 1.4-feature





More information about the cups-devel mailing list