]>
Commit | Line | Data |
---|---|---|
ef416fc2 | 1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"> |
2 | <html> | |
3 | <!-- SECTION: Programming --> | |
4 | <head> | |
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; } | |
15 | --></style> | |
16 | </head> | |
17 | <body> | |
18 | <!-- | |
19 | "$Id$" | |
20 | ||
21 | Filter and backend API introduction for the Common UNIX Printing System (CUPS). | |
22 | ||
23 | Copyright 1997-2005 by Easy Software Products. | |
24 | ||
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 | |
30 | at: | |
31 | ||
32 | Attn: CUPS Licensing Information | |
33 | Easy Software Products | |
34 | 44141 Airport View Drive, Suite 204 | |
35 | Hollywood, Maryland 20636 USA | |
36 | ||
37 | Voice: (301) 373-9600 | |
38 | EMail: cups-info@cups.org | |
39 | WWW: http://www.cups.org | |
40 | --> | |
41 | ||
42 | <h2 class='title'>Introduction</h2> | |
43 | ||
44 | <p>The CUPS filter and backend APIs provide...</p> | |
45 | ||
46 | <h2 class='title'>General Usage</h2> | |
47 | ||
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> | |
52 | ||
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 | |
58 | library:</p> | |
59 | ||
60 | <pre class='command'> | |
61 | <kbd>gcc -o myprogram myprogram.c -lcups</kbd> | |
62 | </pre> | |
63 | ||
64 | <h2 class='title'>Compatibility</h2> | |
65 | ||
66 | <p>All of these functions require CUPS 1.2 or higher.</p> | |
67 | <h2 class='title'>Contents</h2> | |
68 | <ul> | |
69 | <li><a href='#FUNCTIONS'>Functions</a></li> | |
70 | </ul> | |
71 | <!-- NEW PAGE --> | |
72 | <h2 class='title'><a name='FUNCTIONS'>Functions</a></h2> | |
73 | <ul> | |
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> | |
76 | </ul> | |
77 | <!-- NEW PAGE --> | |
78 | <h3 class='title'><span class='info'> CUPS 1.2 </span><a name='cupsBackchannelRead'>cupsBackchannelRead()</a></h3> | |
79 | <h4>Description</h4> | |
80 | <p>Read data from the backchannel. | |
81 | ||
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. | |
86 | ||
87 | </p> | |
88 | <h4>Syntax</h4> | |
89 | <pre> | |
90 | int | |
91 | cupsBackchannelRead( | |
92 | char * buffer, | |
93 | int bytes, | |
94 | double timeout); | |
95 | </pre> | |
96 | <h4>Arguments</h4> | |
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> | |
99 | <tbody> | |
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> | |
104 | <h4>Returns</h4> | |
105 | <p>Bytes read or -1 on error</p> | |
106 | <!-- NEW PAGE --> | |
107 | <h3 class='title'><span class='info'> CUPS 1.2 </span><a name='cupsBackchannelWrite'>cupsBackchannelWrite()</a></h3> | |
108 | <h4>Description</h4> | |
109 | <p>Write data to the backchannel. | |
110 | ||
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 | |
114 | indefinitely. | |
115 | ||
116 | </p> | |
117 | <h4>Syntax</h4> | |
118 | <pre> | |
119 | int | |
120 | cupsBackchannelWrite( | |
121 | const char * buffer, | |
122 | int bytes, | |
123 | double timeout); | |
124 | </pre> | |
125 | <h4>Arguments</h4> | |
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> | |
128 | <tbody> | |
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> | |
133 | <h4>Returns</h4> | |
134 | <p>Bytes written or -1 on error</p> | |
135 | </body> | |
136 | </html> |