1 <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
3 <!-- SECTION: Programming -->
5 <title>Filter and Backend APIs
</title>
6 <meta name='keywords' content='Programming'
>
7 <meta name='creator' content='Mini-XML v2.3'
>
8 <style type='text/css'
><!--
9 h1, h2, h3, p { font-family: sans-serif; text-align: justify; }
10 tt, pre a:link, pre a:visited, tt a:link, tt a:visited { font-weight: bold; color: #7f0000; }
11 pre { font-weight: bold; color: #7f0000; margin-left: 2em; }
12 span.info { background: #000000; border: solid thin #000000; color: #ffffff; font-size: 80%; font-style: italic; font-weight: bold; white-space: nowrap; }
13 h3 span.info { float: right; font-size: 100%; }
14 h1.title, h2.title, h3.title { border-bottom: solid 2px #000000; }
21 Filter and backend API introduction for the Common UNIX Printing System (CUPS).
23 Copyright 1997-2005 by Easy Software Products.
25 These coded instructions, statements, and computer programs are the
26 property of Easy Software Products and are protected by Federal
27 copyright law. Distribution and use rights are outlined in the file
28 "LICENSE.txt" which should have been included with this file. If this
29 file is missing or damaged please contact Easy Software Products
32 Attn: CUPS Licensing Information
33 Easy Software Products
34 44141 Airport View Drive, Suite 204
35 Hollywood, Maryland 20636 USA
38 EMail: cups-info@cups.org
39 WWW: http://www.cups.org
42 <h2 class='title'
>Introduction
</h2>
44 <p>The CUPS filter and backend APIs provide...
</p>
46 <h2 class='title'
>General Usage
</h2>
48 <p>The
<var><cups/backend.h
></var> and
49 <var><cups/cups.h
></var> header files must be included to
50 use the
<tt>CUPS_BACKEND_
</tt> constants and
51 <tt>cupsBackchannel
</tt> functions, respectively.
</p>
53 <p>Programs using these functions must be linked to the CUPS
54 library:
<var>libcups.a
</var>,
<var>libcups.so
.2</var>,
55 <var>libcups
.2.dylib
</var>,
<var>libcups_s.a
</var>, or
56 <var>libcups2.lib
</var> depending on the platform. The following
57 command compiles
<var>myprogram.c
</var> using GCC and the CUPS
61 <kbd>gcc -o myprogram myprogram.c -lcups
</kbd>
64 <h2 class='title'
>Compatibility
</h2>
66 <p>All of these functions require CUPS
1.2 or higher.
</p>
67 <h2 class='title'
>Contents
</h2>
69 <li><a href='#FUNCTIONS'
>Functions
</a></li>
72 <h2 class='title'
><a name='FUNCTIONS'
>Functions
</a></h2>
74 <li><a href='#cupsBackchannelRead'
><tt>cupsBackchannelRead()
</tt></a> <span class='info'
> CUPS
1.2 </span></li>
75 <li><a href='#cupsBackchannelWrite'
><tt>cupsBackchannelWrite()
</tt></a> <span class='info'
> CUPS
1.2 </span></li>
78 <h3 class='title'
><span class='info'
> CUPS
1.2 </span><a name='cupsBackchannelRead'
>cupsBackchannelRead()
</a></h3>
80 <p>Read data from the backchannel.
82 Reads up to
"bytes
" bytes from the backchannel. The
"timeout
"
83 parameter controls how many seconds to wait for the data - use
84 0.0 to return immediately if there is no data, -
1.0 to wait
85 for data indefinitely.
97 <div class='table'
><table align='center' border='
1' width='
80%' cellpadding='
5' cellspacing='
0'
>
98 <thead><tr><th>Name
</th><th>Description
</th></tr></thead>
100 <tr><td><tt>buffer
</tt></td><td>Buffer to read
</td></tr>
101 <tr><td><tt>bytes
</tt></td><td>Bytes to read
</td></tr>
102 <tr><td><tt>timeout
</tt></td><td>Timeout in seconds
</td></tr>
103 </tbody></table></div>
105 <p>Bytes read or -
1 on error
</p>
107 <h3 class='title'
><span class='info'
> CUPS
1.2 </span><a name='cupsBackchannelWrite'
>cupsBackchannelWrite()
</a></h3>
109 <p>Write data to the backchannel.
111 Writes
"bytes
" bytes to the backchannel. The
"timeout
" parameter
112 controls how many seconds to wait for the data to be written - use
113 0.0 to return immediately if the data cannot be written, -
1.0 to wait
120 cupsBackchannelWrite(
126 <div class='table'
><table align='center' border='
1' width='
80%' cellpadding='
5' cellspacing='
0'
>
127 <thead><tr><th>Name
</th><th>Description
</th></tr></thead>
129 <tr><td><tt>buffer
</tt></td><td>Buffer to write
</td></tr>
130 <tr><td><tt>bytes
</tt></td><td>Bytes to write
</td></tr>
131 <tr><td><tt>timeout
</tt></td><td>Timeout in seconds
</td></tr>
132 </tbody></table></div>
134 <p>Bytes written or -
1 on error
</p>