- SECURITY: The PNG image reading code did not validate the
image size properly, leading to a potential buffer overflow
(STR #2974)
+ - Fixed some configure script bugs with rc/xinetd directories
+ (STR #2970)
+ - The Epson sample driver PPDs contained errors (STR #2979)
CHANGES IN CUPS V1.3.9
if (usb_control_msg(printer->handle,
USB_TYPE_CLASS | USB_ENDPOINT_IN | USB_RECIP_INTERFACE,
- 0, 0,
- (printer->iface << 8) |
- printer->device->config[printer->conf].
- interface[printer->iface].
- altsetting[printer->altset].bAlternateSetting,
+ 0, printer->conf, printer->iface,
buffer, bufsize, 5000) < 0)
{
*buffer = '\0';
fputs("STATE: +connecting-to-device\n", stderr);
number = printer->device->config[printer->conf].bConfigurationValue;
- while (usb_set_configuration(printer->handle, number) < 0)
+
+ if (usb_set_configuration(printer->handle, number) < 0)
{
+ /*
+ * If the set fails, chances are that the printer only supports a
+ * single configuration. Technically these printers don't conform to
+ * the USB printer specification, but otherwise they'll work...
+ */
+
if (errno != EBUSY)
fprintf(stderr, "DEBUG: Failed to set configuration %d for %04x:%04x\n",
number, printer->device->descriptor.idVendor,
printer->device->descriptor.idProduct);
-
- goto error;
}
/*
while (usb_claim_interface(printer->handle, number) < 0)
{
if (errno != EBUSY)
- fprintf(stderr, "DEBUG: Failed to claim interface %d for %04x:%04x\n",
+ fprintf(stderr, "DEBUG: Failed to claim interface %d for %04x:%04x: %s\n",
number, printer->device->descriptor.idVendor,
- printer->device->descriptor.idProduct);
+ printer->device->descriptor.idProduct, strerror(errno));
goto error;
}
while (usb_claim_interface(printer->handle, 0) < 0)
{
if (errno != EBUSY)
- fprintf(stderr, "DEBUG: Failed to claim interface 0 for %04x:%04x\n",
+ fprintf(stderr, "DEBUG: Failed to claim interface 0 for %04x:%04x: %s\n",
printer->device->descriptor.idVendor,
- printer->device->descriptor.idProduct);
+ printer->device->descriptor.idProduct, strerror(errno));
goto error;
}
{
if (errno != EBUSY)
fprintf(stderr,
- "DEBUG: Failed to set alternate interface %d for %04x:%04x\n",
+ "DEBUG: Failed to set alternate interface %d for %04x:%04x: %s\n",
number, printer->device->descriptor.idVendor,
- printer->device->descriptor.idProduct);
+ printer->device->descriptor.idProduct, strerror(errno));
goto error;
}
* Update the page...
*/
+ if (!last_device_time)
+ cgiStartMultipart();
+
cgiStartHTML(title);
cgiCopyTemplateLang("choose-device.tmpl");
cgiEndHTML();
cgiSetVariable("CURRENT_DEVICE_SCHEME", uri);
}
- /*
- * Prime the page with the current device listed...
- */
-
- cgiStartMultipart();
- cgiStartHTML(title);
- cgiCopyTemplateLang("choose-device.tmpl");
- cgiEndHTML();
- fflush(stdout);
-
/*
* Scan for devices for up to 30 seconds, updating the page as we find
* them...
fputs("DEBUG: Getting list of devices...\n", stderr);
- time(&last_device_time);
- current_device = 0;
+ last_device_time = 0;
+ current_device = 0;
if (cupsGetDevices(http, 30, NULL, (cups_device_cb_t)choose_device_cb,
(void *)title) == IPP_OK)
fputs("DEBUG: Got device list!\n", stderr);
else
+ {
fprintf(stderr,
"ERROR: CUPS-Get-Devices request failed with status %x: %s\n",
cupsLastError(), cupsLastErrorString());
+ if (cupsLastError() == IPP_NOT_AUTHORIZED)
+ {
+ puts("Status: 401\n");
+ exit(0);
+ }
+ else
+ {
+ cgiStartHTML(title);
+ cgiShowIPPError(modify ? _("Unable to modify printer:") :
+ _("Unable to add printer:"));
+ cgiEndHTML();
+ return;
+ }
+ }
/*
* Show the final selection page...
var = cgiGetVariable("PPD_MAKE");
if (var)
{
+ const char *make_model; /* Make and model */
+
+
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_TEXT,
"ppd-make", NULL, var);
- if ((var = cgiGetVariable("CURRENT_MAKE_AND_MODEL")) != NULL)
+ if ((make_model = cgiGetVariable("CURRENT_MAKE_AND_MODEL")) != NULL &&
+ !cgiGetVariable("SELECT_MAKE"))
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_TEXT,
- "ppd-make-and-model", NULL, var);
+ "ppd-make-and-model", NULL, make_model);
}
else
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD,
#if test -z "$CUPS_REVISION" -a -d .svn; then
# CUPS_REVISION="-r`svnversion . | awk -F: '{print $NF}' | sed -e '1,$s/[[a-zA-Z]]*//g'`"
#fi
+CUPS_BUILD="cups-$CUPS_VERSION"
+
+AC_ARG_WITH(cups_build, [ --with-cups-build set "cups-config --build" string ],
+ CUPS_BUILD="$withval")
AC_SUBST(CUPS_VERSION)
AC_SUBST(CUPS_REVISION)
+AC_SUBST(CUPS_BUILD)
AC_DEFINE_UNQUOTED(CUPS_SVERSION, "CUPS v$CUPS_VERSION$CUPS_REVISION")
AC_DEFINE_UNQUOTED(CUPS_MINIMAL, "CUPS/$CUPS_VERSION$CUPS_REVISION")
;;
esac
-else
+elif test "x$rcdir" != xno; then
if test "x$rclevels" = x; then
INITDDIR="$rcdir"
else
break
fi
done
+elif test "x$XINETD" = xno; then
+ XINETD=""
fi
AC_SUBST(XINETD)
#
# CUPS configuration utility.
#
-# Copyright 2007 by Apple Inc.
+# Copyright 2007-2008 by Apple Inc.
# Copyright 2001-2006 by Easy Software Products, all rights reserved.
#
# These coded instructions, statements, and computer programs are the
VERSION="@CUPS_VERSION@"
APIVERSION="1.4"
+BUILD="@CUPS_BUILD@"
prefix=@prefix@
exec_prefix=@exec_prefix@
usage ()
{
echo "Usage: cups-config --api-version"
+ echo " cups-config --build"
echo " cups-config --cflags"
echo " cups-config --datadir"
echo " cups-config --help"
--api-version)
echo $APIVERSION
;;
+ --build)
+ echo $BUILD
+ ;;
--cflags)
echo $CFLAGS
;;
file is missing or damaged, see the license at "http://www.cups.org/".
-->
-<h1 class="title">Array API</h1>
-
<div class='summary'><table summary='General Information'>
<thead>
<tr>
file is missing or damaged, see the license at "http://www.cups.org/".
-->
-<h1 class="title">CUPS API</h1>
-
<div class='summary'><table summary='General Information'>
<thead>
<tr>
file is missing or damaged, see the license at "http://www.cups.org/".
-->
-<h1 class="title">File and Directory APIs</h1>
-
<div class='summary'><table summary='General Information'>
<thead>
<tr>
file is missing or damaged, see the license at "http://www.cups.org/".
-->
-<h1 class="title">Filter and Backend Programming</h1>
-
<div class='summary'><table summary='General Information'>
<thead>
<tr>
file is missing or damaged, see the license at "http://www.cups.org/".
-->
-<h1 class="title">HTTP and IPP APIs</h1>
-
<div class='summary'><table summary='General Information'>
<thead>
<tr>
file is missing or damaged, see the license at "http://www.cups.org/".
-->
-<h1 class="title">Introduction to CUPS Programming</h1>
-
<div class='summary'><table summary='General Information'>
<thead>
<tr>
</tr>
<tr>
<th>See Also</th>
- <td>Programming: <a href='api-cups.html' target='_top'>CUPS API</a><br>
+ <td>Programming: <a href='raster-driver.html' target='_top'>Developing Raster Printer Drivers</a><br>
+ Programming: <a href='postscript-driver.html' target='_top'>Developing PostScript Printer Drivers</a><br>
+ Programming: <a href='api-filter.html' target='_top'>Filter and Backend Programming</a><br>
+ Programming: <a href='ppd-compiler.html' target='_top'>Introduction to the PPD Compiler</a><br>
Programming: <a href='api-array.html' target='_top'>Array API</a><br>
+ Programming: <a href='api-cups.html' target='_top'>CUPS API</a><br>
Programming: <a href='api-filedir.html' target='_top'>File and Directory APIs</a><br>
- Programming: <a href='api-filter.html' target='_top'>Filter and Backend Programming</a><br>
Programming: <a href='api-httpipp.html' target='_top'>HTTP and IPP APIs</a><br>
Programming: <a href='api-ppd.html' target='_top'>PPD API</a><br>
- Programming: <a href='api-raster.html' target='_top'>Raster API</a></td>
+ Programming: <a href='api-raster.html' target='_top'>Raster API</a><br>
+ References: <a href='ref-ppdcfile.html' target='_top'>PPD Compiler Driver Information File Reference</a><br>
+ Specifications: <a href='spec-ppd.html' target='_top'>CUPS PPD Extensions</a></td>
</tr>
</tbody>
</table></div>
file is missing or damaged, see the license at "http://www.cups.org/".
-->
-<h1 class="title">PPD API</h1>
-
<div class='summary'><table summary='General Information'>
<thead>
<tr>
http->auth_ref = NULL;
}
- if (httpGetSubField2(http, HTTP_FIELD_WWW_AUTHENTICATE, "authkey",
+ if (!getenv("GATEWAY_INTERFACE") &&
+ httpGetSubField2(http, HTTP_FIELD_WWW_AUTHENTICATE, "authkey",
auth_key, sizeof(auth_key)))
{
status = AuthorizationCreate(NULL, kAuthorizationEmptyEnvironment,
else
{
int j, k; /* Looping vars */
- ppd_attr_t *attr; /* Current attribute */
ppd_group_t *group; /* Option group */
ppd_option_t *option; /* Option */
ppd_coption_t *coption; /* Custom option */
ppdLocalize(ppd);
+ if (argc > 3)
+ {
+ text = ppdLocalizeIPPReason(ppd, argv[3], NULL, buffer, sizeof(buffer));
+ printf("ppdLocalizeIPPReason(%s)=%s\n", argv[3],
+ text ? text : "(null)");
+ return (text == NULL);
+ }
+
for (i = ppd->num_groups, group = ppd->groups;
i > 0;
i --, group ++)
images/cups.png \
images/cups.rgb \
images/cups-block-diagram.gif \
+ images/cups-command-chain.png \
images/cups-icon.png \
+ images/cups-postscript-chain.png \
+ images/cups-raster-chain.png \
images/left.gif \
images/raster.png \
images/right.gif \
help/policies.html \
help/postscript-driver.html \
help/ppd-compiler.html \
+ help/raster-driver.html \
help/ref-access_log.html \
help/ref-classes-conf.html \
help/ref-client-conf.html \
margin-left: 36pt;
}
+P.example {
+ font-style: italic;
+ margin-left: 36pt;
+}
+
PRE.example {
background: #eeeeee;
border: dotted thin #999999;
padding: 10pt;
}
+A IMG {
+ border: none;
+}
+
+A:link:hover IMG {
+ background: #f0f0f0;
+ border-radius: 10px;
+ -moz-border-radius: 10px;
+}
+
A:link, A:visited {
font-weight: normal;
text-decoration: none;
font-size: 50%;
}
+TR.data, TD.data, TR.data TD {
+ margin-top: 10pt;
+ padding: 5pt;
+ border-bottom: solid 1pt #999999;
+}
+
+TR.data TH {
+ border-bottom: solid 1pt #999999;
+ padding-top: 10pt;
+ padding-left: 5pt;
+ text-align: left;
+}
+
DIV.table TABLE {
border: solid thin #999999;
border-collapse: collapse;
}
TH.label {
- padding-top: 5pt;
text-align: right;
vertical-align: top;
}
+TH.sublabel {
+ text-align: right;
+ font-weight: normal;
+}
+
HR {
border: solid thin;
}
SPAN.info {
- background: #000000;
- border: thin solid #000000;
- color: #ffffff;
+ background: black;
+ border: thin solid black;
+ color: white;
font-size: 80%;
font-style: italic;
font-weight: bold;
border-bottom: solid 2pt #000000;
}
+DIV.indent, TABLE.indent {
+ margin-top: 2em;
+ margin-left: auto;
+ margin-right: auto;
+ width: 90%;
+}
+
+TABLE.indent {
+ border-collapse: collapse;
+}
+
+TABLE.indent TD, TABLE.indent TH {
+ padding: 0;
+}
+
+TABLE.list {
+ border-collapse: collapse;
+ margin-left: auto;
+ margin-right: auto;
+ width: 90%;
+}
+
+TABLE.list TH {
+ background: white;
+ border-bottom: solid thin #cccccc;
+ color: #444444;
+ padding-top: 10pt;
+ padding-left: 5pt;
+ text-align: left;
+ vertical-align: bottom;
+ white-space: nowrap;
+}
+
+TABLE.list TH A {
+ color: #4444cc;
+}
+
+TABLE.list TD {
+ border-bottom: solid thin #eeeeee;
+ padding-top: 5pt;
+ padding-left: 5pt;
+}
+
+TABLE.list TR:nth-child(even) {
+ background: #f8f8f8;
+}
+
+TABLE.list TR:nth-child(odd) {
+ background: #f4f4f4;
+}
+
DT {
margin-left: 36pt;
margin-top: 12pt;
font-family: monaco, courier, monospace;
}
-SPAN.message {
- font-style: italic;
- font-size: smaller;
-}
-
DIV.summary TABLE {
border: solid thin #999999;
border-collapse: collapse;
file is missing or damaged, see the license at "http://www.cups.org/".
-->
-<h1 class="title">Array API</h1>
-
<div class='summary'><table summary='General Information'>
<thead>
<tr>
margin-left: 36pt;
}
+P.example {
+ font-style: italic;
+ margin-left: 36pt;
+}
+
PRE.example {
background: #eeeeee;
border: dotted thin #999999;
padding: 10pt;
}
+A IMG {
+ border: none;
+}
+
+A:link:hover IMG {
+ background: #f0f0f0;
+ border-radius: 10px;
+ -moz-border-radius: 10px;
+}
+
A:link, A:visited {
font-weight: normal;
text-decoration: none;
font-size: 50%;
}
+TR.data, TD.data, TR.data TD {
+ margin-top: 10pt;
+ padding: 5pt;
+ border-bottom: solid 1pt #999999;
+}
+
+TR.data TH {
+ border-bottom: solid 1pt #999999;
+ padding-top: 10pt;
+ padding-left: 5pt;
+ text-align: left;
+}
+
DIV.table TABLE {
border: solid thin #999999;
border-collapse: collapse;
}
TH.label {
- padding-top: 5pt;
text-align: right;
vertical-align: top;
}
+TH.sublabel {
+ text-align: right;
+ font-weight: normal;
+}
+
HR {
border: solid thin;
}
SPAN.info {
- background: #000000;
- border: thin solid #000000;
- color: #ffffff;
+ background: black;
+ border: thin solid black;
+ color: white;
font-size: 80%;
font-style: italic;
font-weight: bold;
border-bottom: solid 2pt #000000;
}
+DIV.indent, TABLE.indent {
+ margin-top: 2em;
+ margin-left: auto;
+ margin-right: auto;
+ width: 90%;
+}
+
+TABLE.indent {
+ border-collapse: collapse;
+}
+
+TABLE.indent TD, TABLE.indent TH {
+ padding: 0;
+}
+
+TABLE.list {
+ border-collapse: collapse;
+ margin-left: auto;
+ margin-right: auto;
+ width: 90%;
+}
+
+TABLE.list TH {
+ background: white;
+ border-bottom: solid thin #cccccc;
+ color: #444444;
+ padding-top: 10pt;
+ padding-left: 5pt;
+ text-align: left;
+ vertical-align: bottom;
+ white-space: nowrap;
+}
+
+TABLE.list TH A {
+ color: #4444cc;
+}
+
+TABLE.list TD {
+ border-bottom: solid thin #eeeeee;
+ padding-top: 5pt;
+ padding-left: 5pt;
+}
+
+TABLE.list TR:nth-child(even) {
+ background: #f8f8f8;
+}
+
+TABLE.list TR:nth-child(odd) {
+ background: #f4f4f4;
+}
+
DT {
margin-left: 36pt;
margin-top: 12pt;
font-family: monaco, courier, monospace;
}
-SPAN.message {
- font-style: italic;
- font-size: smaller;
-}
-
DIV.summary TABLE {
border: solid thin #999999;
border-collapse: collapse;
file is missing or damaged, see the license at "http://www.cups.org/".
-->
-<h1 class="title">CUPS API</h1>
-
<div class='summary'><table summary='General Information'>
<thead>
<tr>
margin-left: 36pt;
}
+P.example {
+ font-style: italic;
+ margin-left: 36pt;
+}
+
PRE.example {
background: #eeeeee;
border: dotted thin #999999;
padding: 10pt;
}
+A IMG {
+ border: none;
+}
+
+A:link:hover IMG {
+ background: #f0f0f0;
+ border-radius: 10px;
+ -moz-border-radius: 10px;
+}
+
A:link, A:visited {
font-weight: normal;
text-decoration: none;
font-size: 50%;
}
+TR.data, TD.data, TR.data TD {
+ margin-top: 10pt;
+ padding: 5pt;
+ border-bottom: solid 1pt #999999;
+}
+
+TR.data TH {
+ border-bottom: solid 1pt #999999;
+ padding-top: 10pt;
+ padding-left: 5pt;
+ text-align: left;
+}
+
DIV.table TABLE {
border: solid thin #999999;
border-collapse: collapse;
}
TH.label {
- padding-top: 5pt;
text-align: right;
vertical-align: top;
}
+TH.sublabel {
+ text-align: right;
+ font-weight: normal;
+}
+
HR {
border: solid thin;
}
SPAN.info {
- background: #000000;
- border: thin solid #000000;
- color: #ffffff;
+ background: black;
+ border: thin solid black;
+ color: white;
font-size: 80%;
font-style: italic;
font-weight: bold;
border-bottom: solid 2pt #000000;
}
+DIV.indent, TABLE.indent {
+ margin-top: 2em;
+ margin-left: auto;
+ margin-right: auto;
+ width: 90%;
+}
+
+TABLE.indent {
+ border-collapse: collapse;
+}
+
+TABLE.indent TD, TABLE.indent TH {
+ padding: 0;
+}
+
+TABLE.list {
+ border-collapse: collapse;
+ margin-left: auto;
+ margin-right: auto;
+ width: 90%;
+}
+
+TABLE.list TH {
+ background: white;
+ border-bottom: solid thin #cccccc;
+ color: #444444;
+ padding-top: 10pt;
+ padding-left: 5pt;
+ text-align: left;
+ vertical-align: bottom;
+ white-space: nowrap;
+}
+
+TABLE.list TH A {
+ color: #4444cc;
+}
+
+TABLE.list TD {
+ border-bottom: solid thin #eeeeee;
+ padding-top: 5pt;
+ padding-left: 5pt;
+}
+
+TABLE.list TR:nth-child(even) {
+ background: #f8f8f8;
+}
+
+TABLE.list TR:nth-child(odd) {
+ background: #f4f4f4;
+}
+
DT {
margin-left: 36pt;
margin-top: 12pt;
font-family: monaco, courier, monospace;
}
-SPAN.message {
- font-style: italic;
- font-size: smaller;
-}
-
DIV.summary TABLE {
border: solid thin #999999;
border-collapse: collapse;
file is missing or damaged, see the license at "http://www.cups.org/".
-->
-<h1 class="title">File and Directory APIs</h1>
-
<div class='summary'><table summary='General Information'>
<thead>
<tr>
margin-left: 36pt;
}
+P.example {
+ font-style: italic;
+ margin-left: 36pt;
+}
+
PRE.example {
background: #eeeeee;
border: dotted thin #999999;
padding: 10pt;
}
+A IMG {
+ border: none;
+}
+
+A:link:hover IMG {
+ background: #f0f0f0;
+ border-radius: 10px;
+ -moz-border-radius: 10px;
+}
+
A:link, A:visited {
font-weight: normal;
text-decoration: none;
font-size: 50%;
}
+TR.data, TD.data, TR.data TD {
+ margin-top: 10pt;
+ padding: 5pt;
+ border-bottom: solid 1pt #999999;
+}
+
+TR.data TH {
+ border-bottom: solid 1pt #999999;
+ padding-top: 10pt;
+ padding-left: 5pt;
+ text-align: left;
+}
+
DIV.table TABLE {
border: solid thin #999999;
border-collapse: collapse;
}
TH.label {
- padding-top: 5pt;
text-align: right;
vertical-align: top;
}
+TH.sublabel {
+ text-align: right;
+ font-weight: normal;
+}
+
HR {
border: solid thin;
}
SPAN.info {
- background: #000000;
- border: thin solid #000000;
- color: #ffffff;
+ background: black;
+ border: thin solid black;
+ color: white;
font-size: 80%;
font-style: italic;
font-weight: bold;
border-bottom: solid 2pt #000000;
}
+DIV.indent, TABLE.indent {
+ margin-top: 2em;
+ margin-left: auto;
+ margin-right: auto;
+ width: 90%;
+}
+
+TABLE.indent {
+ border-collapse: collapse;
+}
+
+TABLE.indent TD, TABLE.indent TH {
+ padding: 0;
+}
+
+TABLE.list {
+ border-collapse: collapse;
+ margin-left: auto;
+ margin-right: auto;
+ width: 90%;
+}
+
+TABLE.list TH {
+ background: white;
+ border-bottom: solid thin #cccccc;
+ color: #444444;
+ padding-top: 10pt;
+ padding-left: 5pt;
+ text-align: left;
+ vertical-align: bottom;
+ white-space: nowrap;
+}
+
+TABLE.list TH A {
+ color: #4444cc;
+}
+
+TABLE.list TD {
+ border-bottom: solid thin #eeeeee;
+ padding-top: 5pt;
+ padding-left: 5pt;
+}
+
+TABLE.list TR:nth-child(even) {
+ background: #f8f8f8;
+}
+
+TABLE.list TR:nth-child(odd) {
+ background: #f4f4f4;
+}
+
DT {
margin-left: 36pt;
margin-top: 12pt;
font-family: monaco, courier, monospace;
}
-SPAN.message {
- font-style: italic;
- font-size: smaller;
-}
-
DIV.summary TABLE {
border: solid thin #999999;
border-collapse: collapse;
file is missing or damaged, see the license at "http://www.cups.org/".
-->
-<h1 class="title">Filter and Backend Programming</h1>
-
<div class='summary'><table summary='General Information'>
<thead>
<tr>
margin-left: 36pt;
}
+P.example {
+ font-style: italic;
+ margin-left: 36pt;
+}
+
PRE.example {
background: #eeeeee;
border: dotted thin #999999;
padding: 10pt;
}
+A IMG {
+ border: none;
+}
+
+A:link:hover IMG {
+ background: #f0f0f0;
+ border-radius: 10px;
+ -moz-border-radius: 10px;
+}
+
A:link, A:visited {
font-weight: normal;
text-decoration: none;
font-size: 50%;
}
+TR.data, TD.data, TR.data TD {
+ margin-top: 10pt;
+ padding: 5pt;
+ border-bottom: solid 1pt #999999;
+}
+
+TR.data TH {
+ border-bottom: solid 1pt #999999;
+ padding-top: 10pt;
+ padding-left: 5pt;
+ text-align: left;
+}
+
DIV.table TABLE {
border: solid thin #999999;
border-collapse: collapse;
}
TH.label {
- padding-top: 5pt;
text-align: right;
vertical-align: top;
}
+TH.sublabel {
+ text-align: right;
+ font-weight: normal;
+}
+
HR {
border: solid thin;
}
SPAN.info {
- background: #000000;
- border: thin solid #000000;
- color: #ffffff;
+ background: black;
+ border: thin solid black;
+ color: white;
font-size: 80%;
font-style: italic;
font-weight: bold;
border-bottom: solid 2pt #000000;
}
+DIV.indent, TABLE.indent {
+ margin-top: 2em;
+ margin-left: auto;
+ margin-right: auto;
+ width: 90%;
+}
+
+TABLE.indent {
+ border-collapse: collapse;
+}
+
+TABLE.indent TD, TABLE.indent TH {
+ padding: 0;
+}
+
+TABLE.list {
+ border-collapse: collapse;
+ margin-left: auto;
+ margin-right: auto;
+ width: 90%;
+}
+
+TABLE.list TH {
+ background: white;
+ border-bottom: solid thin #cccccc;
+ color: #444444;
+ padding-top: 10pt;
+ padding-left: 5pt;
+ text-align: left;
+ vertical-align: bottom;
+ white-space: nowrap;
+}
+
+TABLE.list TH A {
+ color: #4444cc;
+}
+
+TABLE.list TD {
+ border-bottom: solid thin #eeeeee;
+ padding-top: 5pt;
+ padding-left: 5pt;
+}
+
+TABLE.list TR:nth-child(even) {
+ background: #f8f8f8;
+}
+
+TABLE.list TR:nth-child(odd) {
+ background: #f4f4f4;
+}
+
DT {
margin-left: 36pt;
margin-top: 12pt;
font-family: monaco, courier, monospace;
}
-SPAN.message {
- font-style: italic;
- font-size: smaller;
-}
-
DIV.summary TABLE {
border: solid thin #999999;
border-collapse: collapse;
file is missing or damaged, see the license at "http://www.cups.org/".
-->
-<h1 class="title">HTTP and IPP APIs</h1>
-
<div class='summary'><table summary='General Information'>
<thead>
<tr>
margin-left: 36pt;
}
+P.example {
+ font-style: italic;
+ margin-left: 36pt;
+}
+
PRE.example {
background: #eeeeee;
border: dotted thin #999999;
padding: 10pt;
}
+A IMG {
+ border: none;
+}
+
+A:link:hover IMG {
+ background: #f0f0f0;
+ border-radius: 10px;
+ -moz-border-radius: 10px;
+}
+
A:link, A:visited {
font-weight: normal;
text-decoration: none;
font-size: 50%;
}
+TR.data, TD.data, TR.data TD {
+ margin-top: 10pt;
+ padding: 5pt;
+ border-bottom: solid 1pt #999999;
+}
+
+TR.data TH {
+ border-bottom: solid 1pt #999999;
+ padding-top: 10pt;
+ padding-left: 5pt;
+ text-align: left;
+}
+
DIV.table TABLE {
border: solid thin #999999;
border-collapse: collapse;
}
TH.label {
- padding-top: 5pt;
text-align: right;
vertical-align: top;
}
+TH.sublabel {
+ text-align: right;
+ font-weight: normal;
+}
+
HR {
border: solid thin;
}
SPAN.info {
- background: #000000;
- border: thin solid #000000;
- color: #ffffff;
+ background: black;
+ border: thin solid black;
+ color: white;
font-size: 80%;
font-style: italic;
font-weight: bold;
border-bottom: solid 2pt #000000;
}
+DIV.indent, TABLE.indent {
+ margin-top: 2em;
+ margin-left: auto;
+ margin-right: auto;
+ width: 90%;
+}
+
+TABLE.indent {
+ border-collapse: collapse;
+}
+
+TABLE.indent TD, TABLE.indent TH {
+ padding: 0;
+}
+
+TABLE.list {
+ border-collapse: collapse;
+ margin-left: auto;
+ margin-right: auto;
+ width: 90%;
+}
+
+TABLE.list TH {
+ background: white;
+ border-bottom: solid thin #cccccc;
+ color: #444444;
+ padding-top: 10pt;
+ padding-left: 5pt;
+ text-align: left;
+ vertical-align: bottom;
+ white-space: nowrap;
+}
+
+TABLE.list TH A {
+ color: #4444cc;
+}
+
+TABLE.list TD {
+ border-bottom: solid thin #eeeeee;
+ padding-top: 5pt;
+ padding-left: 5pt;
+}
+
+TABLE.list TR:nth-child(even) {
+ background: #f8f8f8;
+}
+
+TABLE.list TR:nth-child(odd) {
+ background: #f4f4f4;
+}
+
DT {
margin-left: 36pt;
margin-top: 12pt;
font-family: monaco, courier, monospace;
}
-SPAN.message {
- font-style: italic;
- font-size: smaller;
-}
-
DIV.summary TABLE {
border: solid thin #999999;
border-collapse: collapse;
file is missing or damaged, see the license at "http://www.cups.org/".
-->
-<h1 class="title">Introduction to CUPS Programming</h1>
-
<div class='summary'><table summary='General Information'>
<thead>
<tr>
</tr>
<tr>
<th>See Also</th>
- <td>Programming: <a href='api-cups.html' target='_top'>CUPS API</a><br>
+ <td>Programming: <a href='raster-driver.html' target='_top'>Developing Raster Printer Drivers</a><br>
+ Programming: <a href='postscript-driver.html' target='_top'>Developing PostScript Printer Drivers</a><br>
+ Programming: <a href='api-filter.html' target='_top'>Filter and Backend Programming</a><br>
+ Programming: <a href='ppd-compiler.html' target='_top'>Introduction to the PPD Compiler</a><br>
Programming: <a href='api-array.html' target='_top'>Array API</a><br>
+ Programming: <a href='api-cups.html' target='_top'>CUPS API</a><br>
Programming: <a href='api-filedir.html' target='_top'>File and Directory APIs</a><br>
- Programming: <a href='api-filter.html' target='_top'>Filter and Backend Programming</a><br>
Programming: <a href='api-httpipp.html' target='_top'>HTTP and IPP APIs</a><br>
Programming: <a href='api-ppd.html' target='_top'>PPD API</a><br>
- Programming: <a href='api-raster.html' target='_top'>Raster API</a></td>
+ Programming: <a href='api-raster.html' target='_top'>Raster API</a><br>
+ References: <a href='ref-ppdcfile.html' target='_top'>PPD Compiler Driver Information File Reference</a><br>
+ Specifications: <a href='spec-ppd.html' target='_top'>CUPS PPD Extensions</a></td>
</tr>
</tbody>
</table></div>
margin-left: 36pt;
}
+P.example {
+ font-style: italic;
+ margin-left: 36pt;
+}
+
PRE.example {
background: #eeeeee;
border: dotted thin #999999;
padding: 10pt;
}
+A IMG {
+ border: none;
+}
+
+A:link:hover IMG {
+ background: #f0f0f0;
+ border-radius: 10px;
+ -moz-border-radius: 10px;
+}
+
A:link, A:visited {
font-weight: normal;
text-decoration: none;
font-size: 50%;
}
+TR.data, TD.data, TR.data TD {
+ margin-top: 10pt;
+ padding: 5pt;
+ border-bottom: solid 1pt #999999;
+}
+
+TR.data TH {
+ border-bottom: solid 1pt #999999;
+ padding-top: 10pt;
+ padding-left: 5pt;
+ text-align: left;
+}
+
DIV.table TABLE {
border: solid thin #999999;
border-collapse: collapse;
}
TH.label {
- padding-top: 5pt;
text-align: right;
vertical-align: top;
}
+TH.sublabel {
+ text-align: right;
+ font-weight: normal;
+}
+
HR {
border: solid thin;
}
SPAN.info {
- background: #000000;
- border: thin solid #000000;
- color: #ffffff;
+ background: black;
+ border: thin solid black;
+ color: white;
font-size: 80%;
font-style: italic;
font-weight: bold;
border-bottom: solid 2pt #000000;
}
+DIV.indent, TABLE.indent {
+ margin-top: 2em;
+ margin-left: auto;
+ margin-right: auto;
+ width: 90%;
+}
+
+TABLE.indent {
+ border-collapse: collapse;
+}
+
+TABLE.indent TD, TABLE.indent TH {
+ padding: 0;
+}
+
+TABLE.list {
+ border-collapse: collapse;
+ margin-left: auto;
+ margin-right: auto;
+ width: 90%;
+}
+
+TABLE.list TH {
+ background: white;
+ border-bottom: solid thin #cccccc;
+ color: #444444;
+ padding-top: 10pt;
+ padding-left: 5pt;
+ text-align: left;
+ vertical-align: bottom;
+ white-space: nowrap;
+}
+
+TABLE.list TH A {
+ color: #4444cc;
+}
+
+TABLE.list TD {
+ border-bottom: solid thin #eeeeee;
+ padding-top: 5pt;
+ padding-left: 5pt;
+}
+
+TABLE.list TR:nth-child(even) {
+ background: #f8f8f8;
+}
+
+TABLE.list TR:nth-child(odd) {
+ background: #f4f4f4;
+}
+
DT {
margin-left: 36pt;
margin-top: 12pt;
font-family: monaco, courier, monospace;
}
-SPAN.message {
- font-style: italic;
- font-size: smaller;
-}
-
DIV.summary TABLE {
border: solid thin #999999;
border-collapse: collapse;
file is missing or damaged, see the license at "http://www.cups.org/".
-->
-<h1 class="title">PPD API</h1>
-
<div class='summary'><table summary='General Information'>
<thead>
<tr>
margin-left: 36pt;
}
+P.example {
+ font-style: italic;
+ margin-left: 36pt;
+}
+
PRE.example {
background: #eeeeee;
border: dotted thin #999999;
padding: 10pt;
}
+A IMG {
+ border: none;
+}
+
+A:link:hover IMG {
+ background: #f0f0f0;
+ border-radius: 10px;
+ -moz-border-radius: 10px;
+}
+
A:link, A:visited {
font-weight: normal;
text-decoration: none;
font-size: 50%;
}
+TR.data, TD.data, TR.data TD {
+ margin-top: 10pt;
+ padding: 5pt;
+ border-bottom: solid 1pt #999999;
+}
+
+TR.data TH {
+ border-bottom: solid 1pt #999999;
+ padding-top: 10pt;
+ padding-left: 5pt;
+ text-align: left;
+}
+
DIV.table TABLE {
border: solid thin #999999;
border-collapse: collapse;
}
TH.label {
- padding-top: 5pt;
text-align: right;
vertical-align: top;
}
+TH.sublabel {
+ text-align: right;
+ font-weight: normal;
+}
+
HR {
border: solid thin;
}
SPAN.info {
- background: #000000;
- border: thin solid #000000;
- color: #ffffff;
+ background: black;
+ border: thin solid black;
+ color: white;
font-size: 80%;
font-style: italic;
font-weight: bold;
border-bottom: solid 2pt #000000;
}
+DIV.indent, TABLE.indent {
+ margin-top: 2em;
+ margin-left: auto;
+ margin-right: auto;
+ width: 90%;
+}
+
+TABLE.indent {
+ border-collapse: collapse;
+}
+
+TABLE.indent TD, TABLE.indent TH {
+ padding: 0;
+}
+
+TABLE.list {
+ border-collapse: collapse;
+ margin-left: auto;
+ margin-right: auto;
+ width: 90%;
+}
+
+TABLE.list TH {
+ background: white;
+ border-bottom: solid thin #cccccc;
+ color: #444444;
+ padding-top: 10pt;
+ padding-left: 5pt;
+ text-align: left;
+ vertical-align: bottom;
+ white-space: nowrap;
+}
+
+TABLE.list TH A {
+ color: #4444cc;
+}
+
+TABLE.list TD {
+ border-bottom: solid thin #eeeeee;
+ padding-top: 5pt;
+ padding-left: 5pt;
+}
+
+TABLE.list TR:nth-child(even) {
+ background: #f8f8f8;
+}
+
+TABLE.list TR:nth-child(odd) {
+ background: #f4f4f4;
+}
+
DT {
margin-left: 36pt;
margin-top: 12pt;
font-family: monaco, courier, monospace;
}
-SPAN.message {
- font-style: italic;
- font-size: smaller;
-}
-
DIV.summary TABLE {
border: solid thin #999999;
border-collapse: collapse;
file is missing or damaged, see the license at "http://www.cups.org/".
-->
-<h1 class="title">Raster API</h1>
-
<div class='summary'><table summary='General Information'>
<thead>
<tr>
<a href='ref-ppdcfile.html#Filter'>Filter</a> application/vnd.cups-postscript 0 -
</pre>
+<h3>Custom Command Filters</h3>
+
+<p>The <tt>application/vnd.cups-command</tt> file type is used for CUPS command files. Use the following <tt>Filter</tt> directive to handle CUPS command files:</p>
+
+<pre class='example'>
+<a href='ref-ppdcfile.html#Filter'>Filter</a> application/vnd.cups-command 100 /path/to/command/filter
+</pre>
+
+<p>To use the standard PostScript command filter, specify <var>commandtops</var> as the path to the command filter.</p>
+
+<h3>Custom PDF Filters</h3>
+
+<p>The <tt>application/pdf</tt> file type is used for unfiltered PDF files while the <tt>application/vnd.cups-pdf</tt> file type is used for filtered PDF files. Use the following <tt>Filter</tt> directive to handle filtered PDF files:</p>
+
+<pre class='example'>
+<a href='ref-ppdcfile.html#Filter'>Filter</a> application/vnd.cups-pdf 100 /path/to/pdf/filter
+</pre>
+
+<p>For unfiltered PDF files, use:</p>
+
+<pre class='example'>
+<a href='ref-ppdcfile.html#Filter'>Filter</a> application/pdf 100 /path/to/pdf/filter
+</pre>
+
+<p>Custom PDF filters that accept filtered data do not need to perform number-up processing and other types of page imposition, while those that accept unfiltered data MUST do the number-up processing themselves.</p>
+
+<h3>Custom PostScript Filters</h3>
+
+<p>The <tt>application/vnd.cups-postscript</tt> file type is used for filtered PostScript files. Use the following <tt>Filter</tt> directive to handle PostScript files:</p>
+
+<pre class='example'>
+<a href='ref-ppdcfile.html#Filter'>Filter</a> application/vnd.cups-postscript 100 /path/to/postscript/filter
+</pre>
+
<h2 class='title'><a name='COLOR'>Implementing Color Management</a></h2>
--- /dev/null
+<HTML>
+<!-- SECTION: Programming -->
+<HEAD>
+ <TITLE>Developing Raster Printer Drivers</TITLE>
+</HEAD>
+<BODY>
+
+<p>This document describes how to develop printer drivers for raster printers. Topics include: <a href='#BASICS'>printer driver basics</a>, <a href='#CREATE'>creating new PPD files</a>, <a href='#FILTERS'>using filters</a>, <a href='#COLOR'>implementing color management</a>, <a href='#MACOSX'>adding Mac OS X features</a>, and <a href='#DEPLOY'>deploying your driver</a>.</p>
+
+<div class='summary'><table summary='General Information'>
+<tbody>
+<tr>
+ <th>See Also</th>
+ <td>Programming: <a href='postscript-driver.html'>Developing PostScript Printer Drivers</a><br>
+ Programming: <a href='api-filter.html'>Filter and Backend Programming</a><br>
+ Programming: <a href='ppd-compiler.html'>Introduction to the PPD Compiler</a><br>
+ Programming: <a href='api-raster.html'>Raster API</a><br>
+ References: <a href='ref-ppdcfile.html'>PPD Compiler Driver Information File Reference</a><br>
+ Specifications: <a href='spec-ppd.html'>CUPS PPD Extensions</a></td>
+</tr>
+</tbody>
+</table></div>
+
+
+<h2 class='title'><a name='BASICS'>Printer Driver Basics</a></h2>
+
+<p>A CUPS raster printer driver consists of a PostScript Printer Description (PPD) file that describes the features and capabilities of the device, one or more <em>filter</em> programs that prepare print data for the device, and zero or more support files for color management, online help, and so forth. The PPD file includes references to all of the filters and support files used by the driver.</p>
+
+<p>Every time a user prints something the scheduler program, <a href='man-cupsd.html'>cupsd(8)</a>, determines the format of the print job and the programs required to convert that job into something the printer understands. CUPS includes filter programs for many common formats, for example to convert Portable Document Format (PDF) files into CUPS raster data. <a href='#FIGURE_1'>Figure 1</a> shows the data flow of a typical print job.</p>
+
+<div class='figure'><table summary='Raster Filter Chain'>
+<caption>Figure 1: <a name='FIGURE_1'>Raster Filter Chain</a></caption>
+<tr><td><img src='/images/cups-raster-chain.png' width='700' height='150' alt='Raster Filter Chain'></td></tr>
+</table></div>
+
+<p>The raster filter converts CUPS raster data into a format the printer understands, for example HP-PCL. CUPS includes several sample raster filters supporting standard page description languages (PDLs). <a href='#TABLE_1'>Table 1</a> shows the raster filters that are bundled with CUPS and the languages they support.</p>
+
+<div class='table'><table summary='Standard CUPS Raster Filters'>
+<caption>Table 1: <a name='TABLE_1'>Standard CUPS Raster Filters</a></caption>
+<thead>
+<tr><th>Filter</th><th>PDLs</th><th>ppdc DriverType</th><th>ppdc #include file</th></tr>
+</thead>
+<tbody>
+<tr><td>rastertoepson</td><td>ESC/P, ESC/P2</td><td>epson</td><td>epson.h</td></tr>
+<tr><td>rastertoescpx</td><td>ESC/P, ESC/P2, EPSON Remote Mode</td><td>escp</td><td>escp.h</td></tr>
+<tr><td>rastertohp</td><td>HP-PCL3, HP-PCL5</td><td>hp</td><td>hp.h</td></tr>
+<tr><td>rastertolabel</td><td>CPCL, Dymo, EPL1, EPL2, Intellitech PCL, ZPL</td><td>label</td><td>label.h</td></tr>
+<tr><td>rastertopclx</td><td>HP-RTL, HP-PCL3, HP-PCL3GUI, HP-PCL5, HP-PCL5c, HP-PCL5e</td><td>pcl</td><td>pcl.h</td></tr>
+</tbody>
+</table></div>
+
+<p>The optional port monitor handles interface-specific protocol or encoding issues. For example, some raster printers use the 1284.4 communications protocol.</p>
+
+<p>The backend handles communications with the printer, sending print data from the last filter to the printer and relaying back-channel data from the printer to the upstream filters. CUPS includes backend programs for common direct-connect interfaces and network protocols, and you can provide your own backend to support custom interfaces and protocols.</p>
+
+<p>The scheduler also supports a special "command" file format for sending maintenance commands and status queries to a printer or printer driver. Command print jobs typically use a single command filter program defined in the PPD file to generate the appropriate printer commands and handle any responses from the printer. <a href='#FIGURE_2'>Figure 2</a> shows the data flow of a typical command job.</p>
+
+<div class='figure'><table summary='Command Filter Chain'>
+<caption>Figure 2: <a name='FIGURE_2'>Command Filter Chain</a></caption>
+<tr><td><img src='/images/cups-command-chain.png' width='575' height='150' alt='Command Filter Chain'></td></tr>
+</table></div>
+
+<p>Raster printer drivers must provide their own command filter.</p>
+
+
+<h2 class='title'><a name='CREATING'>Creating New PPD Files</a></h2>
+
+<p>We recommend using the CUPS PPD compiler, <a href='man-ppdc.html'>ppdc(1)</a>, to create new PPD files since it manages many of the tedious (and error-prone!) details of paper sizes and localization for you. It also allows you to easily support multiple devices from a single source file. For more information see the "<a href='ppd-compiler.html'>Introduction to the PPD Compiler</a>" document. <a href='#LISTING_1'>Listing 1</a> shows a driver information file for several similar black-and-white HP-PCL5 laser printers.</p>
+
+<p class='example'>Listing 1: <a name='LISTING_1'>"examples/laserjet-basic.drv"</a></p>
+
+<pre class='example'>
+<I>// Include standard font and media definitions</I>
+<a href='ref-ppdcfile.html#_include'>#include</a> <font.defs>
+<a href='ref-ppdcfile.html#_include'>#include</a> <media.defs>
+
+<I>// Include HP-PCL driver definitions</I>
+<a href='ref-ppdcfile.html#_include'>#include</a> <pcl.h>
+
+<I>// Specify that this driver uses the HP-PCL driver...</I>
+<a href='ref-ppdcfile.html#DriverType'>DriverType</a> pcl
+
+<I>// Specify the driver options via the model number...</I>
+<a href='ref-ppdcfile.html#ModelNumber'>ModelNumber</a> ($PCL_PAPER_SIZE $PCL_PJL $PCL_PJL_RESOLUTION)
+
+<I>// List the fonts that are supported, in this case all standard fonts...</I>
+<a href='ref-ppdcfile.html#Font'>Font</a> *
+
+<I>// Manufacturer and driver version</I>
+<a href='ref-ppdcfile.html#Manufacturer'>Manufacturer</a> "HP"
+<a href='ref-ppdcfile.html#Version'>Version</a> 1.0
+
+<I>// Supported page sizes and their margins</I>
+<a href='ref-ppdcfile.html#HWMargins'>HWMargins</a> 18 12 18 12
+*<a href='ref-ppdcfile.html#MediaSize'>MediaSize</a> Letter
+<a href='ref-ppdcfile.html#MediaSize'>MediaSize</a> Legal
+<a href='ref-ppdcfile.html#MediaSize'>MediaSize</a> Executive
+<a href='ref-ppdcfile.html#MediaSize'>MediaSize</a> Monarch
+<a href='ref-ppdcfile.html#MediaSize'>MediaSize</a> Statement
+<a href='ref-ppdcfile.html#MediaSize'>MediaSize</a> FanFoldGermanLegal
+
+<a href='ref-ppdcfile.html#HWMargins'>HWMargins</a> 18 12.72 18 12.72
+<a href='ref-ppdcfile.html#MediaSize'>MediaSize</a> Env10
+
+<a href='ref-ppdcfile.html#HWMargins'>HWMargins</a> 9.72 12 9.72 12
+<a href='ref-ppdcfile.html#MediaSize'>MediaSize</a> A4
+<a href='ref-ppdcfile.html#MediaSize'>MediaSize</a> A5
+<a href='ref-ppdcfile.html#MediaSize'>MediaSize</a> B5
+<a href='ref-ppdcfile.html#MediaSize'>MediaSize</a> EnvC5
+<a href='ref-ppdcfile.html#MediaSize'>MediaSize</a> EnvDL
+<a href='ref-ppdcfile.html#MediaSize'>MediaSize</a> EnvISOB5
+<a href='ref-ppdcfile.html#MediaSize'>MediaSize</a> Postcard
+<a href='ref-ppdcfile.html#MediaSize'>MediaSize</a> DoublePostcard
+
+<I>// Only black-and-white output with mode 3 compression...</I>
+<a href='ref-ppdcfile.html#ColorModel'>ColorModel</a> Gray k chunky 3
+
+<I>// Supported resolutions</I>
+<a href='ref-ppdcfile.html#Resolution'>Resolution</a> - 1 0 0 0 "300dpi/300 DPI"
+*<a href='ref-ppdcfile.html#Resolution'>Resolution</a> - 8 0 0 0 "600dpi/600 DPI"
+
+<I>// Supported input slots</I>
+*<a href='ref-ppdcfile.html#InputSlot'>InputSlot</a> 7 "Auto/Automatic Selection"
+<a href='ref-ppdcfile.html#InputSlot'>InputSlot</a> 2 "Manual/Tray 1 - Manual Feed"
+<a href='ref-ppdcfile.html#InputSlot'>InputSlot</a> 4 "Upper/Tray 1"
+<a href='ref-ppdcfile.html#InputSlot'>InputSlot</a> 1 "Lower/Tray 2"
+<a href='ref-ppdcfile.html#InputSlot'>InputSlot</a> 5 "LargeCapacity/Tray 3"
+
+<I>// Tray 3 is an option...</I>
+<a href='ref-ppdcfile.html#Installable'>Installable</a> "OptionLargeCapacity/Tray 3 Installed"
+<a href='ref-ppdcfile.html#UIConstraints'>UIConstraints</a> "*OptionLargeCapacity False *InputSlot LargeCapacity"
+
+{
+ <I>// HP LaserJet 2100 Series</I>
+ <a href='ref-ppdcfile.html#Throughput'>Throughput</a> 10
+ <a href='ref-ppdcfile.html#ModelName'>ModelName</a> "LaserJet 2100 Series"
+ <a href='ref-ppdcfile.html#PCFileName'>PCFileName</a> "hpljt211.ppd"
+}
+
+{
+ <I>// LaserJet 2200 and 2300 series have duplexer option...</I>
+ <a href='ref-ppdcfile.html#Duplex'>Duplex</a> normal
+ <a href='ref-ppdcfile.html#Installable'>Installable</a> "OptionDuplex/Duplexer Installed"
+ <a href='ref-ppdcfile.html#UIConstraints'>UIConstraints</a> "*OptionDuplex False *Duplex"
+
+ {
+ <I>// HP LaserJet 2200 Series</I>
+ <a href='ref-ppdcfile.html#Throughput'>Throughput</a> 19
+ <a href='ref-ppdcfile.html#ModelName'>ModelName</a> "LaserJet 2200 Series"
+ <a href='ref-ppdcfile.html#PCFileName'>PCFileName</a> "hpljt221.ppd"
+ }
+
+ {
+ <I>// HP LaserJet 2300 Series</I>
+ <a href='ref-ppdcfile.html#Throughput'>Throughput</a> 25
+ <a href='ref-ppdcfile.html#ModelName'>ModelName</a> "LaserJet 2300 Series"
+ <a href='ref-ppdcfile.html#PCFileName'>PCFileName</a> "hpljt231.ppd"
+ }
+}
+</pre>
+
+
+<h2 class='title'><a name='FILTERS'>Using Filters</a></h2>
+
+<p>The standard CUPS raster filters can be specified using the
+<a href='ref-ppdcfile.html#DriverType'><tt>DriverType</tt></a> directive, for example:</p>
+
+<pre class='example'>
+<I>// Specify that this driver uses the HP-PCL driver...</I>
+<a href='ref-ppdcfile.html#DriverType'>DriverType</a> pcl
+</pre>
+
+<p><a href='#TABLE_1'>Table 1</a> shows the driver types for each of the standard CUPS raster filters. For drivers that do not use the standard raster filters, the "custom" type is used with <a href='ref-ppdcfile.html#Filter'><tt>Filter</tt></a> directives:</p>
+
+<pre class='example'>
+<a href='ref-ppdcfile.html#DriverType'>DriverType</a> custom
+<a href='ref-ppdcfile.html#Filter'>Filter</a> application/vnd.cups-raster 100 /path/to/raster/filter
+<a href='ref-ppdcfile.html#Filter'>Filter</a> application/vnd.cups-command 100 /path/to/command/filter
+</pre>
+
+
+<h2 class='title'><a name='COLOR'>Implementing Color Management</a></h2>
+
+<p>Talk about ICC color profiles and sRGB as two best options.</p>
+
+
+<h2 class='title'><a name='MACOSX'>Adding Mac OS X Features</a></h2>
+
+<p>Talk about help books, icons, and PDEs.</p>
+
+
+<h2 class='title'><a name='DEPLOY'>Deploying Your Driver</a></h2>
+
+<p>Talk about install locations, etc.</p>
+
+
+</body>
+</html>
<h3><span class='info'>Mac OS X 10.3</span><a name='APPrinterIconPath'>APPrinterIconPath</a></h3>
-<p class='summary'>*APPrinterIconPath: "/Library/Printers/vendor/filename"</p>
+<p class='summary'>*APPrinterIconPath: "/Library/Printers/vendor/filename.icns"</p>
<p>This attribute defines the location of a printer icon file to use when
-displaying the printer.</p>
+displaying the printer. The file must be in the Apple icon format.</p>
<p>Examples:</p>
<pre class='command'>
*% Apple icon file
*APPrinterIconPath: "/Library/Printers/vendor/Icons/filename.icns"
-
-*% TIFF icon file
-*APPrinterIconPath: "/Library/Printers/vendor/Icons/filename.tiff"
-
-*% PNG icon file
-*APPrinterIconPath: "/Library/Printers/vendor/Icons/filename.png"
-
-*% JPEG icon file
-*APPrinterIconPath: "/Library/Printers/vendor/Icons/filename.jpg"
</pre>
<h3><span class='info'>Mac OS X 10.4</span><a name='APPrinterLowInkTool'>APPrinterLowInkTool</a></h3>
file is missing or damaged, see the license at "http://www.cups.org/".
-->
-<h1 class="title">Raster API</h1>
-
<div class='summary'><table summary='General Information'>
<thead>
<tr>
.\" which should have been included with this file. If this file is
.\" file is missing or damaged, see the license at "http://www.cups.org/".
.\"
-.TH cups-config 1 "Common UNIX Printing System" "16 June 2008" "Apple Inc."
+.TH cups-config 1 "Common UNIX Printing System" "23 October 2008" "Apple Inc."
.SH NAME
cups-config \- get cups api, compiler, directory, and link information.
.SH SYNOPSIS
--api-version
.br
.B cups-config
+--build
+.br
+.B cups-config
--cflags
.br
.B cups-config
.br
Displays the current API version (major.minor).
.TP 5
+--build
+.br
+Displays a system-specific build number.
+.TP 5
--cflags
.br
Displays the necessary compiler options.
memcpy(data, a->data, count * sizeof(ppdcShared *));
for (int i = 0; i < count; i ++)
- data[i]->get();
+ data[i]->retain();
}
else
data = 0;
data = temp;
}
+ d->retain();
data[count++] = d;
}
ppdcCatalog::~ppdcCatalog()
{
- delete locale;
- delete filename;
- delete messages;
+ locale->release();
+ filename->release();
+ messages->release();
}
{
// Bump the use count of any strings we inherit...
if (d->manufacturer)
- d->manufacturer->get();
+ d->manufacturer->retain();
if (d->version)
- d->version->get();
+ d->version->retain();
if (d->default_font)
- d->default_font->get();
+ d->default_font->retain();
if (d->default_size)
- d->default_size->get();
+ d->default_size->retain();
if (d->custom_size_code)
- d->custom_size_code->get();
+ d->custom_size_code->retain();
// Copy all of the data from the driver template...
copyright = new ppdcArray(d->copyright);
ppdcDriver::~ppdcDriver()
{
- delete copyright;
+ copyright->release();
if (manufacturer)
manufacturer->release();
if (custom_size_code)
custom_size_code->release();
- delete attrs;
- delete constraints;
- delete filters;
- delete fonts;
- delete groups;
- delete profiles;
- delete sizes;
+ attrs->release();
+ constraints->release();
+ filters->release();
+ fonts->release();
+ groups->release();
+ profiles->release();
+ sizes->release();
}
if (f)
{
- f->name->get();
+ f->name->retain();
default_font = f->name;
}
else
if (m)
{
- m->name->get();
+ m->name->retain();
default_size = m->name;
}
else
lf);
if (delete_cat)
- delete catalog;
+ catalog->release();
return (0);
}
ppdcOption *o; // Current option
- g->name->get();
- g->text->get();
+ g->name->retain();
+ g->text->retain();
name = g->name;
text = g->text;
{
name->release();
text->release();
- delete options;
+ options->release();
}
ppdcMessage::~ppdcMessage()
{
- delete id;
- delete string;
+ id->release();
+ string->release();
}
ppdcOption::ppdcOption(ppdcOption *o) // I - Template option
{
- o->name->get();
- o->text->get();
+ o->name->retain();
+ o->text->retain();
if (o->defchoice)
- o->defchoice->get();
+ o->defchoice->retain();
type = o->type;
name = o->name;
text->release();
if (defchoice)
defchoice->release();
- delete choices;
+ choices->release();
}
defchoice->release();
if (c->name)
- c->name->get();
+ c->name->retain();
defchoice = c->name;
}
//
// ppdcShared::ppdcShared() - Create shared data.
// ppdcShared::~ppdcShared() - Destroy shared data.
-// ppdcShared::get() - Increment the use count for this data.
// ppdcShared::release() - Decrement the use count and delete as needed.
+// ppdcShared::retain() - Increment the use count for this data.
//
//
//
-// 'ppdcShared::get()' - Increment the use count for this data.
+// 'ppdcShared::release()' - Decrement the use count and delete as needed.
//
void
-ppdcShared::get(void)
+ppdcShared::release(void)
{
- use ++;
+ use --;
+ if (!use)
+ delete this;
}
//
-// 'ppdcShared::release()' - Decrement the use count and delete as needed.
+// 'ppdcShared::retain()' - Increment the use count for this data.
//
void
-ppdcShared::release(void)
+ppdcShared::retain()
{
- use --;
- if (!use)
- delete this;
+ use ++;
}
ppdcSource::~ppdcSource()
{
- delete filename;
- delete base_fonts;
- delete drivers;
- delete po_files;
- delete sizes;
- delete vars;
+ filename->release();
+ base_fonts->release();
+ drivers->release();
+ po_files->release();
+ sizes->release();
+ vars->release();
}
cat = new ppdcCatalog(locale, pofilename);
// Reset the filename to the name supplied by the user...
- delete cat->filename;
+ cat->filename->release();
cat->filename = new ppdcString(poname);
// Return the catalog...
"\"%s\"...\n"), argv[i]);
if (catalog)
- delete catalog;
+ catalog->release();
catalog = new ppdcCatalog(argv[i]);
usage();
// Delete the printer driver information...
- delete src;
+ src->release();
// Message catalog...
if (catalog)
- delete catalog;
+ catalog->release();
// Return with no errors.
return (0);
ppdcShared();
virtual ~ppdcShared();
- void get(void);
- void release(void);
+ void retain();
+ void release();
};
class ppdcArray //// Shared Array
puts("</body>");
puts("</html>");
// Delete the printer driver information...
- delete composite;
- delete src;
+ composite->release();
+ src->release();
}
// If no drivers have been loaded, display the program usage message.
src->write_file(srcfile);
// Delete the printer driver information...
- delete src;
+ src->release();
// Return with no errors.
return (0);
}
// Delete the printer driver information...
- delete src;
+ src->release();
}
// Write the message catalog...
else
catalog->save_messages(outfile);
- delete catalog;
+ catalog->release();
// If no drivers have been loaded, display the program usage message.
if (!src)
ColorDevice No
Throughput 1
- HWMargins 18 18 18 18
- *MediaSize Letter
- MediaSize Legal
- MediaSize A4
- MediaSize FanFoldUS
-
HWMargins 0 0 0 0
VariablePaperSize Yes
MinSize 36 36
PCFileName "epson24.ppd"
ModelNumber $EPSON_24PIN
+ HWMargins 18 18 18 18
+ *MediaSize Letter
+ MediaSize Legal
+ MediaSize A4
+ MediaSize FanFoldUS
+
Resolution k 1 8 0 0 60dpi
*Resolution k 1 8 0 0 120x60dpi
Resolution k 1 24 0 0 180dpi
Resolution k 1 24 0 0 360x180dpi
- Resolution k 1 48 0 0 360x180dpi
+ Resolution k 1 48 0 0 360dpi
}
// Epson 9-Pin Series
ModelNumber $EPSON_9PIN
ColorDevice No
+ HWMargins 18 18 18 18
+ *MediaSize Letter
+ MediaSize Legal
+ MediaSize A4
+ MediaSize FanFoldUS
+
Resolution k 1 8 0 0 60x720dpi
*Resolution k 1 8 0 0 120x72dpi
Resolution k 1 8 0 0 240x72dpi
m = (ppdcMessage *)catalog->messages->next())
printf("%s: %s\n", m->id->value, m->string->value);
- delete catalog;
+ catalog->release();
// Return with no errors.
return (0);
return;
}
- if (authinfo->count == 1)
- strlcpy(username, authinfo->items[0].value, sizeof(username));
-
- cupsdLogMessage(CUPSD_LOG_DEBUG,
- "cupsdAuthorize: Authorized as %s using AuthRef",
- username);
+ if (authinfo->count == 0 || !authinfo->items[0].value ||
+ authinfo->items[0].valueLength < 2)
+ {
+ AuthorizationFreeItemSet(authinfo);
+ cupsdLogMessage(CUPSD_LOG_ERROR,
+ "AuthorizationCopyInfo returned empty rights!");
+ return;
+ }
+ strlcpy(username, authinfo->items[0].value, sizeof(username));
AuthorizationFreeItemSet(authinfo);
+ cupsdLogMessage(CUPSD_LOG_DEBUG,
+ "cupsdAuthorize: Authorized as \"%s\" using AuthRef",
+ username);
con->type = CUPSD_AUTH_BASIC;
}
#endif /* HAVE_AUTHORIZATION_H */
d->write_ppd_file(out, NULL, locales, src, PPDC_LFONLY);
cupsFileClose(out);
- delete locales;
+ locales->release();
}
else
{
}
}
- delete src;
+ src->release();
return (!d);
}
if (p1->matches != p0->matches)
return (p1->matches - p0->matches);
else
- return (cupsdCompareNames(p1->record.make_and_model,
- p0->record.make_and_model));
+ return (cupsdCompareNames(p0->record.make_and_model,
+ p1->record.make_and_model));
}
fprintf(stderr,
"ERROR: [cups-driverd] Bad driver information file \"%s\"!\n",
filename);
- delete src;
+ src->release();
return (0);
}
mtime, size, d->model_number, type);
}
- delete src;
+ src->release();
return (1);
}
need_restart_job = 1;
- supported = ippFindAttribute(printer->attrs, "port-monitor-supported",
+ supported = ippFindAttribute(printer->ppd_attrs, "port-monitor-supported",
IPP_TAG_NAME);
if (supported)
{
printer->name);
unlink(filename);
- snprintf(filename, sizeof(filename), "%s/%s.ipp", ServerRoot,
- printer->name);
+ snprintf(filename, sizeof(filename), "%s/%s.ipp", CacheDir, printer->name);
unlink(filename);
#ifdef __APPLE__
continue;
if (!strncmp(attr->name, "job-", 4) &&
- strcmp(attr->name, "job-uuid") &&
+ strcmp(attr->name, "job-billing") &&
strcmp(attr->name, "job-impressions") &&
strcmp(attr->name, "job-originating-host-name") &&
+ strcmp(attr->name, "job-uuid") &&
!(printer->type & CUPS_PRINTER_REMOTE))
continue;
*/
launchd_checkin();
+ launchd_checkout();
}
#endif /* HAVE_LAUNCHD */
*/
launchd_checkin();
+ launchd_checkout();
}
#endif /* HAVE_LAUNCHD */
}
</SCRIPT>
-<H2 CLASS="title">Server Configuration File</H2>
+<DIV CLASS="indent">
+
+<H2 CLASS="title">Edit Configuration File</H2>
<FORM NAME="cups" METHOD="POST" ACTION="/admin/">
onClick="reset_config();"></P>
</FORM>
+
+</DIV>