]> git.ipfire.org Git - thirdparty/cups.git/blame - man/backend.man
Update copyrights in man pages.
[thirdparty/cups.git] / man / backend.man
CommitLineData
ef416fc2 1.\"
e4e5666b 2.\" "$Id$"
ef416fc2 3.\"
bfbd0197 4.\" Backend man page for CUPS.
ef416fc2 5.\"
bfbd0197
MS
6.\" Copyright 2007-2014 by Apple Inc.
7.\" Copyright 1997-2006 by Easy Software Products.
ef416fc2 8.\"
bfbd0197
MS
9.\" These coded instructions, statements, and computer programs are the
10.\" property of Apple Inc. and are protected by Federal copyright
11.\" law. Distribution and use rights are outlined in the file "LICENSE.txt"
12.\" which should have been included with this file. If this file is
13.\" file is missing or damaged, see the license at "http://www.cups.org/".
ef416fc2 14.\"
bfbd0197 15.TH backend 7 "CUPS" "4 April 2014" "Apple Inc."
ef416fc2 16.SH NAME
17backend \- cups backend transmission interfaces
ef416fc2 18.SH SYNOPSIS
19.B backend
20.br
21.B backend
bfbd0197
MS
22.I job
23.I user
24.I title
25.I num-copies
26.I options
27[
ef416fc2 28.I filename
29]
bfbd0197
MS
30.nf
31
32\fB#include <cups/cups.h>\fR
33
34\fBconst char *cupsBackendDeviceURI\fR(\fBchar **\fIargv\fR);
35
36\fBvoid cupsBackendReport\fR(\fBconst char *\fIdevice_scheme\fR,
37 \fBconst char *\fIdevice_uri\fR,
38 \fBconst char *\fIdevice_make_and_model\fR,
39 \fBconst char *\fIdevice_info\fR,
40 \fBconst char *\fIdevice_id\fR,
41 \fBconst char *\fIdevice_location\fR);
42
43\fBssize_t cupsBackChannelWrite\fR(\fBconst char *\fIbuffer\fR,
44 \fBsize_t \fIbytes\fR, \fBdouble \fItimeout\fR);
45
46\fBint cupsSideChannelRead\fR(\fBcups_sc_command_t *\fIcommand\fR,
47 \fBcups_sc_status_t *\fIstatus\fR, \fBchar *\fIdata\fR,
48 \fBint *\fIdatalen\fR, \fBdouble \fItimeout\fR);
49
50\fBint cupsSideChannelWrite\fR(\fBcups_sc_command_t \fIcommand\fR,
51 \fBcups_sc_status_t \fIstatus\fR, \fBconst char *\fIdata\fR,
52 \fBint \fIdatalen\fR, \fBdouble \fItimeout\fR);
53.fi
ef416fc2 54.SH DESCRIPTION
bfbd0197
MS
55Backends are a special type of
56.BR filter (7)
57which is used to send print data to and discover different devices on the system.
ef416fc2 58.LP
bfbd0197 59Like filters, backends must be capable of reading from a filename on the command-line or from the standard input, copying the standard input to a temporary file as required by the physical interface.
ef416fc2 60.LP
bfbd0197
MS
61The command name (\fIargv[0]\fR) is set to the device URI of the destination printer. Authentication information in
62.I argv[0]
63is removed, so backend developers are urged to use the
64.B DEVICE_URI
65environment variable whenever authentication information is required. The
66.BR cupsBackendDeviceURI ()
67function may be used to retrieve the correct device URI.
ef416fc2 68.LP
bfbd0197 69Back-channel data from the device should be relayed to the job filters using the \fIcupsBackChannelWrite\fR function.
f3c17241 70.LP
bfbd0197
MS
71Backends are responsible for reading side-channel requests using the
72.BR cupsSideChannelRead ()
73function and responding with the
74.BR cupsSideChannelWrite()
75function. The
76.B CUPS_SC_FD
77constant defines the file descriptor that should be monitored for incoming requests.
78.SS DEVICE DISCOVERY
79When run with no arguments, the backend should list the devices and schemes it supports or is advertising to the standard output. The output consists of zero or more lines consisting of any of the following forms:
ef416fc2 80.nf
bfbd0197 81
bd7854cb 82 device-class scheme "Unknown" "device-info"
83 device-class device-uri "device-make-and-model" "device-info"
84 device-class device-uri "device-make-and-model" "device-info" "device-id"
749b1e90 85 device-class device-uri "device-make-and-model" "device-info" "device-id" "device-location"
ef416fc2 86.fi
ef416fc2 87.LP
bfbd0197
MS
88The
89.BR cupsBackendReport ()
90function can be used to generate these lines and handle any necessary escaping of characters in the various strings.
91.LP
92The
93.I device-class
94field is one of the following values:
ef416fc2 95.TP 5
bfbd0197
MS
96.B direct
97The device-uri refers to a specific direct-access device with no options, such as a parallel, USB, or SCSI device.
ef416fc2 98.TP 5
bfbd0197 99.B file
ef416fc2 100The device-uri refers to a file on disk.
ef416fc2 101.TP 5
bfbd0197 102.B network
f3c17241
MS
103The device-uri refers to a networked device and conforms to the general form for
104network URIs.
ef416fc2 105.TP 5
bfbd0197
MS
106.B serial
107The device-uri refers to a serial device with configurable baud rate and other options. If the device-uri contains a baud value, it represents the maximum baud rate supported by the device.
ef416fc2 108.LP
fbfee7a8 109The
bfbd0197
MS
110.I scheme
111field provides the URI scheme that is supported by the backend. Backends should use this form only when the backend supports any URI using that scheme. The
112.I device-uri
113field specifies the full URI to use when communicating with the device.
ef416fc2 114.LP
bfbd0197
MS
115The
116.I device-make-and-model
117field specifies the make and model of the device, e.g. "Example Foojet 2000". If the make and model is not known, you must report "Unknown".
ef416fc2 118.LP
bfbd0197
MS
119The
120.I device-info
121field specifies additional information about the device. Typically this includes the make and model along with the port number or network address, e.g. "Example Foojet 2000 USB #1".
ef416fc2 122.LP
bfbd0197
MS
123The optional
124.I device-id
125field specifies the IEEE-1284 device ID string for the device, which is used to select a matching driver.
749b1e90 126.LP
bfbd0197
MS
127The optional
128.I device-location
129field specifies the physical location of the device, which is often used to pre-populate the printer-location attribute when adding a printer.
130.SS PERMISSIONS
131Backends without world read and execute permissions are run as the root user. Otherwise, the backend is run using an unprivileged user account, typically "lp".
132.SH EXIT STATUS
133The following exit codes are defined for backends:
ef416fc2 134.TP 5
bfbd0197 135.B CUPS_BACKEND_OK
f3c17241 136The print file was successfully transmitted to the device or remote server.
ef416fc2 137.TP 5
bfbd0197 138.B CUPS_BACKEND_FAILED
ef416fc2 139.br
bfbd0197
MS
140The print file was not successfully transmitted to the device or remote server. The scheduler will respond to this by canceling the job, retrying the job, or stopping the queue depending on the state of the
141.I printer-error-policy
f3c17241 142attribute.
ef416fc2 143.TP 5
bfbd0197
MS
144.B CUPS_BACKEND_AUTH_REQUIRED
145The print file was not successfully transmitted because valid authentication information is required. The scheduler will respond to this by holding the job and adding the 'cups-held-for-authentication' keyword to the "job-reasons" Job Description attribute.
ef416fc2 146.TP 5
bfbd0197
MS
147.B CUPS_BACKEND_HOLD
148The print file was not successfully transmitted because it cannot be printed at this time. The scheduler will respond to this by holding the job.
ef416fc2 149.TP 5
bfbd0197
MS
150.B CUPS_BACKEND_STOP
151The print file was not successfully transmitted because it cannot be printed at this time. The scheduler will respond to this by stopping the queue.
22c9029b 152.TP 5
bfbd0197
MS
153.B CUPS_BACKEND_CANCEL
154The print file was not successfully transmitted because one or more attributes are not supported or the job was canceled at the printer. The scheduler will respond to this by canceling the job.
22c9029b 155.TP 5
bfbd0197
MS
156.B CUPS_BACKEND_RETRY
157The print file was not successfully transmitted because of a temporary issue. The scheduler will retry the job at a future time - other jobs may print before this one.
158.TP 5
159.B CUPS_BACKEND_RETRY_CURRENT
160The print file was not successfully transmitted because of a temporary issue. The scheduler will retry the job immediately without allowing intervening jobs.
ef416fc2 161.PP
162All other exit code values are reserved.
bfbd0197
MS
163.SH ENVIRONMENT
164In addition to the environment variables listed in
165.BR cups (1)
166and
167.BR filter (7),
168CUPS backends can expect the following environment variable:
169.TP 5
170.B DEVICE_URI
171The device URI associated with the printer.
172.SH FILES
173.I /etc/cups/cups-files.conf
174.SH NOTES
175CUPS backends are not generally design to be run directly by the user. Aside from the device URI issue (
176.I argv[0]
177and
178.B DEVICE_URI
179environment variable contain the device URI), CUPS backends also expect specific environment variables and file descriptors, and typically run in a user session that (on OS X) has additional restrictions that affect how it runs. Backends can also be installed with restricted permissions (0500 or 0700) that tell the scheduler to run them as the "root" user instead of an unprivileged user (typically "lp") on the system.
180.LP
181Unless you are a developer and know what you are doing, please do not run backends directly. Instead, use the
182.BR lp (1)
183or
184.BR lpr (1)
185programs to send print jobs or
186.BR lpinfo (8)
187to query for available printers using the backend. The one exception is the SNMP backend - see
188.BR cups-snmp (8)
189for more information.
ef416fc2 190.SH SEE ALSO
bfbd0197
MS
191.IR cups (1),
192.IR cups-files.conf (5),
193.IR cups-snmp (8),
194.IR cupsd (8),
195.IR filter (7),
196.IR lp (1),
197.IR lpinfo (8),
198.IR lpr (1),
ef416fc2 199.br
bfbd0197 200CUPS Online Help (http://localhost:631/help)
ef416fc2 201.SH COPYRIGHT
fbfee7a8 202Copyright \[co] 2007-2015 by Apple Inc.
ef416fc2 203.\"
e4e5666b 204.\" End of "$Id$".
ef416fc2 205.\"