<!--
"$Id$"
- Filter and backend programming introduction for the Common UNIX Printing
- System (CUPS).
+ Filter and backend programming introduction for CUPS.
- Copyright 2007-2009 by Apple Inc.
+ Copyright 2007-2011 by Apple Inc.
Copyright 1997-2006 by Easy Software Products, all rights reserved.
These coded instructions, statements, and computer programs are the
Mac OS X, for example, no backend may write to a user's home directory.</p>
</blockquote>
+<h3><a name="SIGNALS">Signal Handling</a><h3>
+
+<p>The scheduler sends <code>SIGTERM</code> when a printing job is canceled or
+held. Filters, backends, and port monitors <em>must</em> catch
+<code>SIGTERM</code> and perform any cleanup necessary to produce a valid output
+file or return the printer to a known good state. The recommended behavior is to
+end the output on the current page.</p>
+
<h3><a name="PERMISSIONS">File Permissions</a></h3>
<p>For security reasons, CUPS will only run filters and backends that are owned
<p>Filters can communicate with the backend via the
<a href="#cupsBackChannelRead"><code>cupsBackChannelRead</code></a> and
<a href="#cupsSideChannelDoRequest"><code>cupsSideChannelDoRequest</code></a>
-functions. The
+functions. The
<a href="#cupsBackChannelRead"><code>cupsBackChannelRead</code></a> function
reads data that has been sent back from the device and is typically used to
obtain status and configuration information. For example, the following code
<li><a href="#cupsFileFind" title="Find a file using the specified path.">cupsFileFind</a></li>
<li><a href="#cupsFileFlush" title="Flush pending output.">cupsFileFlush</a></li>
<li><a href="#cupsFileGetChar" title="Get a single character from a file.">cupsFileGetChar</a></li>
- <li><a href="#cupsFileGetConf" title="Get a line from a configuration file...">cupsFileGetConf</a></li>
+ <li><a href="#cupsFileGetConf" title="Get a line from a configuration file.">cupsFileGetConf</a></li>
<li><a href="#cupsFileGetLine" title="Get a CR and/or LF-terminated line that may
contain binary data.">cupsFileGetLine</a></li>
<li><a href="#cupsFileGets" title="Get a CR and/or LF-terminated line.">cupsFileGets</a></li>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Character or -1 on end of file</p>
<h3 class="function"><span class="info"> CUPS 1.2/Mac OS X 10.5 </span><a name="cupsFileGetConf">cupsFileGetConf</a></h3>
-<p class="description">Get a line from a configuration file...</p>
+<p class="description">Get a line from a configuration file.</p>
<p class="code">
char *cupsFileGetConf (<br>
<a href="#cups_file_t">cups_file_t</a> *fp,<br>
<ul class="contents">
<li><a href="#OVERVIEW">Overview</a><ul class="subcontents">
<li><a href="#SECURITY">Security Considerations</a></li>
- <li><a href="#PERMISSIONS">File Permissions</a></li>
+ <li><a href="#SIGNALS">Signal Handling</a></li>
<li><a href="#TEMPFILES">Temporary Files</a></li>
<li><a href="#COPIES">Copy Generation</a></li>
<li><a href="#EXITCODES">Exit Codes</a></li>
<!--
"$Id$"
- Filter and backend programming introduction for the Common UNIX Printing
- System (CUPS).
+ Filter and backend programming introduction for CUPS.
- Copyright 2007-2009 by Apple Inc.
+ Copyright 2007-2011 by Apple Inc.
Copyright 1997-2006 by Easy Software Products, all rights reserved.
These coded instructions, statements, and computer programs are the
Mac OS X, for example, no backend may write to a user's home directory.</p>
</blockquote>
+<h3><a name="SIGNALS">Signal Handling</a><h3>
+
+<p>The scheduler sends <code>SIGTERM</code> when a printing job is canceled or
+held. Filters, backends, and port monitors <em>must</em> catch
+<code>SIGTERM</code> and perform any cleanup necessary to produce a valid output
+file or return the printer to a known good state. The recommended behavior is to
+end the output on the current page.</p>
+
<h3><a name="PERMISSIONS">File Permissions</a></h3>
<p>For security reasons, CUPS will only run filters and backends that are owned
<p>Filters can communicate with the backend via the
<a href="#cupsBackChannelRead"><code>cupsBackChannelRead</code></a> and
<a href="#cupsSideChannelDoRequest"><code>cupsSideChannelDoRequest</code></a>
-functions. The
+functions. The
<a href="#cupsBackChannelRead"><code>cupsBackChannelRead</code></a> function
reads data that has been sent back from the device and is typically used to
obtain status and configuration information. For example, the following code
<dd class="description">Job failed, hold job</dd>
<dt>CUPS_BACKEND_OK </dt>
<dd class="description">Job completed successfully</dd>
+<dt>CUPS_BACKEND_RETRY </dt>
+<dd class="description">Job failed, retry this job later</dd>
+<dt>CUPS_BACKEND_RETRY_CURRENT </dt>
+<dd class="description">Job failed, retry this job immediately</dd>
<dt>CUPS_BACKEND_STOP </dt>
<dd class="description">Job failed, stop queue</dd>
</dl>
<li><a href="#mimeLoadTypes" title="Load type definitions from disk.">mimeLoadTypes</a></li>
<li><a href="#mimeNextFilter" title="Get the next filter in the MIME database.">mimeNextFilter</a></li>
<li><a href="#mimeNextType" title="Get the next type in the MIME database.">mimeNextType</a></li>
- <li><a href="#mimeNumFilters" title="MIME database">mimeNumFilters</a></li>
+ <li><a href="#mimeNumFilters" title="Next type">mimeNumFilters</a></li>
<li><a href="#mimeNumTypes" title="MIME database">mimeNumTypes</a></li>
<li><a href="#mimeType" title="Lookup a file type.">mimeType</a></li>
</ul></li>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Type or NULL</p>
<h3 class="function"><a name="mimeNumFilters">mimeNumFilters</a></h3>
-<p class="description">MIME database</p>
+<p class="description">Next type</p>
<p class="code">
int mimeNumFilters (<br>
<a href="#mime_t">mime_t</a> *mime<br>