Comparar commits

..

1 Commits

Autor SHA1 Mensagem Data
msweet 6cdc660c05 Import cups.org releases
git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/tags/release-1.4.7@4306 a1ca3aef-8c08-0410-bb20-df032aa958be
2013-05-10 18:56:23 +00:00
172 arquivos alterados com 4120 adições e 1996 exclusões
+96 -1
Ver Arquivo
@@ -1,6 +1,101 @@
CHANGES.txt - 2010-11-11
CHANGES.txt - 2011-06-20
------------------------
CHANGES IN CUPS V1.4.7
- Documentation changes (STR #3710, STR #3720, STR #3745, STR #3750,
STR #3757, STR #3758, STR #3782, STR #3826, STR #3829, STR #3837)
- Web interface fixes (STR #3412, STR #3345, STR #3455, STR #3707,
STR #3755, STR #3769, STR #3783)
- Configure script fixes (STR #3659, STR #3691)
- Compilation fixes (STR #3718, STR #3771, STR #3774)
- The imageto* filters could crash with bad GIF files (STR #3867)
- The scheduler might leave old job data files in the spool directory
(STR #3795)
- CUPS did not work with locales using the ASCII character set
(STR #3832)
- httpAddrString() did not return a URI-style IPv6 numeric address
(STR #3814)
- Fixed an issue when reading compressed CUPS raster streams (STR #3812)
- Fixed an issue with PostScript printer auto-configuration (STR #3443)
- Fixed some compatibility issues with the libusb-based USB backend
(STR #3799)
- The network backends no longer try to collect SNMP supply and status
information for raw queues (STR #3809)
- The DBUS notifier did not report job state changes (STR #3805)
- The scheduler did not always report that the "normal" print-quality
value was supported (STR #3803)
- The gziptoany filter did not report the correct error if it was unable
to write the uncompressed document to the next filter or backend in
the chain (STR #3797)
- The Epson and Oki 9-pin drivers had a bad resolution option
(STR #3798)
- The scheduler did not always register the correct default ICC profile
on Mac OS X.
- The scheduler did not use the job owner when authorizing access for
the CUPS-Get-Document operation, preventing non-admins from accessing
their own jobs.
- CUPS did not work with some printers that incorrectly implemented the
HTTP/1.1 standard (STR #3778, STR #3791)
- The scheduler did not retry fax jobs properly.
- The scheduler now recognizes an empty cupsCommands PPD keyword as
meaning that CUPS commands are not supported for a printer (STR #3773)
- Fixed a crash bug in the scheduler when the application/octet-stream
MIME type was not defined (STR #3690)
- Polled printers were advertised more slowly than necessary (STR #3574)
- cupsResolveConflicts() did not handle resolving multiple UIConstraints
issues (STR #3705)
- The SetEnv and PassEnv directives had no effect (STR #3664)
- The web interface no longer tries to use multi-part delivery when
adding printers (STR #3455)
- The libusb-based USB backend printed slowly to the LaserJet 1300 and
other printers (STR #3405)
- "lp" and "lpr" failed to print with Kerberos enabled (STR #3768)
- The cupsctl program now displays an error if you try to directly set
the Port or Listen directives (STR #3749)
- PPD files with "*JobPatchFile: bla" no longer fail to load in relaxed
conformance mode (STR #3747)
- The scheduler generated a bad notify-text string for printer state
change notifications (STR #3739)
- The scheduler incorrectly updated printers.conf when it really needed
to update classes.conf or remote.cache (STR #3726)
- Hardwired remote printers with options did not work (STR #3717)
- Accessing the CUPS web interface using a CNAME-based hostname would
sometimes fail due to redirection to the actual hostname (STR #3701)
- Subscription events had a misspelled attribute (STR #3693)
- "make check" failed if LC_MESSAGES was set (STR #3765)
- Fixed the configure script to always look for the pkg-config script
(STR #3761)
- The scheduler now only looks up interface hostnames if HostNameLookups
are enabled (STR #3737)
- Fixed a compilation problem on DragonFly BSD (STR #3738)
- The default PageLogFormat value had the username and job ID swapped
from CUPS 1.3.x (STR #3727)
- The scheduler could crash if a browsed printer times out while a job
is printing (STR #3754)
- The scheduler incorrectly mapped custom page sizes to standard sizes
(STR #3764)
- cupsfilter and pstops did not map IPP attributes to PPD options due to
a change in cupsMarkOptions (STR #3756)
- The scheduler did not always show the most recent status message from
the print filters (STR #3731)
- The PostScript filter did not apply the mirror and number-up options
properly, leading to offset and clipped output (STR #3732)
- The network backends always reported "low toner" or "out of toner"
states, even for inkjet printers (STR #3733)
CHANGES IN CUPS V1.4.6
- Fixed a "make check" issue on Solaris (STR #3729)
- Regression: The pstops filter did not support landscape printing of
PostScript files (STR #3722)
- The scheduler killed retried (fax) jobs after restarting them
(STR #3697)
- The cupsAdminSetServerSettings() function disabled sharing when
debug logging was enabled (STR #3712)
CHANGES IN CUPS V1.4.5
- Documentation fixes (STR #3542, STR #3650)
+1 -1
Ver Arquivo
@@ -1,4 +1,4 @@
INSTALL - CUPS v1.4.5 - 2010-11-11
INSTALL - CUPS v1.4.7 - 2011-01-06
----------------------------------
This file describes how to compile and install CUPS from source code. For more
+2 -2
Ver Arquivo
@@ -1,4 +1,4 @@
README - CUPS v1.4.4 - 2010-11-11
README - CUPS v1.4.7 - 2011-01-06
---------------------------------
Looking for compile instructions? Read the file "INSTALL.txt"
@@ -150,7 +150,7 @@ PRINTING FILES
LEGAL STUFF
CUPS is Copyright 2007-2010 by Apple Inc. CUPS and the CUPS logo are
CUPS is Copyright 2007-2011 by Apple Inc. CUPS and the CUPS logo are
trademarks of Apple Inc.
The MD5 Digest code is Copyright 1999 Aladdin Enterprises.
+112 -11
Ver Arquivo
@@ -1,9 +1,9 @@
/*
* "$Id$"
*
* SNMP supplies functions for the Common UNIX Printing System (CUPS).
* SNMP supplies functions for CUPS.
*
* Copyright 2008-2009 by Apple Inc.
* Copyright 2008-2011 by Apple Inc.
*
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
@@ -36,6 +36,17 @@
#define CUPS_MAX_SUPPLIES 32 /* Maximum number of supplies for a printer */
#define CUPS_SUPPLY_TIMEOUT 2.0 /* Timeout for SNMP lookups */
#define CUPS_DEVELOPER_LOW 1
#define CUPS_DEVELOPER_EMPTY 2
#define CUPS_MARKER_SUPPLY_LOW 4
#define CUPS_MARKER_SUPPLY_EMPTY 8
#define CUPS_MARKER_WASTE_ALMOST_FULL 16
#define CUPS_MARKER_WASTE_FULL 32
#define CUPS_OPC_NEAR_EOL 64
#define CUPS_OPC_LIFE_OVER 128
#define CUPS_TONER_LOW 256
#define CUPS_TONER_EMPTY 512
/*
* Local structures...
@@ -70,6 +81,8 @@ static int num_supplies = 0;
/* Number of supplies found */
static backend_supplies_t supplies[CUPS_MAX_SUPPLIES];
/* Supply information */
static int supply_state = -1;
/* Supply state info */
static const int hrDeviceDescr[] =
{ CUPS_OID_hrDeviceDescr, 1, -1 };
@@ -140,8 +153,8 @@ static const backend_state_t const printer_states[] =
{
{ CUPS_TC_lowPaper, "media-low-report" },
{ CUPS_TC_noPaper | CUPS_TC_inputTrayEmpty, "media-empty-warning" },
{ CUPS_TC_lowToner, "toner-low-report" },
{ CUPS_TC_noToner, "toner-empty-warning" },
/* { CUPS_TC_lowToner, "toner-low-report" }, */ /* now use prtMarkerSupplies */
/* { CUPS_TC_noToner, "toner-empty-warning" }, */ /* now use prtMarkerSupplies */
{ CUPS_TC_doorOpen, "door-open-report" },
{ CUPS_TC_jammed, "media-jam-warning" },
/* { CUPS_TC_offline, "offline-report" }, */ /* unreliable */
@@ -153,6 +166,20 @@ static const backend_state_t const printer_states[] =
{ CUPS_TC_outputFull, "output-area-full-warning" }
};
static const backend_state_t const supply_states[] =
{
{ CUPS_DEVELOPER_LOW, "developer-low-report" },
{ CUPS_DEVELOPER_EMPTY, "developer-empty-warning" },
{ CUPS_MARKER_SUPPLY_LOW, "marker-supply-low-report" },
{ CUPS_MARKER_SUPPLY_EMPTY, "marker-supply-empty-warning" },
{ CUPS_MARKER_WASTE_ALMOST_FULL, "marker-waste-almost-full-report" },
{ CUPS_MARKER_WASTE_FULL, "marker-waste-full-warning" },
{ CUPS_OPC_NEAR_EOL, "opc-near-eol-report" },
{ CUPS_OPC_LIFE_OVER, "opc-life-over-warning" },
{ CUPS_TONER_LOW, "toner-low-report" },
{ CUPS_TONER_EMPTY, "toner-empty-warning" }
};
/*
* Local functions...
@@ -191,13 +218,14 @@ backendSNMPSupplies(
if (num_supplies > 0)
{
int i, /* Looping var */
percent, /* Percent full */
new_state, /* New state value */
change_state; /* State change */
change_state, /* State change */
new_supply_state = 0; /* Supply state */
char value[CUPS_MAX_SUPPLIES * 4],
/* marker-levels value string */
*ptr; /* Pointer into value string */
cups_snmp_t packet; /* SNMP response packet */
/*
* Generate the marker-levels value string...
@@ -205,17 +233,85 @@ backendSNMPSupplies(
for (i = 0, ptr = value; i < num_supplies; i ++, ptr += strlen(ptr))
{
percent = 100 * supplies[i].level / supplies[i].max_capacity;
if (percent <= 10)
{
switch (supplies[i].type)
{
case CUPS_TC_toner :
case CUPS_TC_tonerCartridge :
if (percent <= 1)
new_supply_state |= CUPS_TONER_EMPTY;
else
new_supply_state |= CUPS_TONER_LOW;
break;
case CUPS_TC_wasteToner :
case CUPS_TC_wasteInk :
if (percent <= 1)
new_supply_state |= CUPS_MARKER_WASTE_FULL;
else
new_supply_state |= CUPS_MARKER_WASTE_ALMOST_FULL;
break;
case CUPS_TC_ink :
case CUPS_TC_inkCartridge :
case CUPS_TC_inkRibbon :
case CUPS_TC_solidWax :
case CUPS_TC_ribbonWax :
if (percent <= 1)
new_supply_state |= CUPS_MARKER_SUPPLY_EMPTY;
else
new_supply_state |= CUPS_MARKER_SUPPLY_LOW;
break;
case CUPS_TC_developer :
if (percent <= 1)
new_supply_state |= CUPS_DEVELOPER_EMPTY;
else
new_supply_state |= CUPS_DEVELOPER_LOW;
break;
case CUPS_TC_coronaWire :
case CUPS_TC_fuser :
case CUPS_TC_opc :
case CUPS_TC_transferUnit :
if (percent <= 1)
new_supply_state |= CUPS_OPC_LIFE_OVER;
else
new_supply_state |= CUPS_OPC_NEAR_EOL;
break;
}
}
if (i)
*ptr++ = ',';
if (supplies[i].max_capacity > 0)
sprintf(ptr, "%d", 100 * supplies[i].level / supplies[i].max_capacity);
sprintf(ptr, "%d", percent);
else
strcpy(ptr, "-1");
}
fprintf(stderr, "ATTR: marker-levels=%s\n", value);
if (supply_state < 0)
change_state = 0xffff;
else
change_state = supply_state ^ new_supply_state;
fprintf(stderr, "DEBUG: new_supply_state=%x, change_state=%x\n",
new_supply_state, change_state);
for (i = 0;
i < (int)(sizeof(supply_states) / sizeof(supply_states[0]));
i ++)
if (change_state & supply_states[i].bit)
{
fprintf(stderr, "STATE: %c%s\n",
(new_supply_state & supply_states[i].bit) ? '+' : '-',
supply_states[i].keyword);
}
supply_state = new_supply_state;
/*
* Get the current printer status bits...
*/
@@ -242,13 +338,18 @@ backendSNMPSupplies(
else
change_state = current_state ^ new_state;
fprintf(stderr, "DEBUG: new_state=%x, change_state=%x\n", new_state,
change_state);
for (i = 0;
i < (int)(sizeof(printer_states) / sizeof(printer_states[0]));
i ++)
if (change_state & printer_states[i].bit)
{
fprintf(stderr, "STATE: %c%s\n",
(new_state & printer_states[i].bit) ? '+' : '-',
(new_state & printer_states[i].bit) ? '+' : '-',
printer_states[i].keyword);
}
current_state = new_state;
@@ -373,9 +474,9 @@ backend_init_supplies(
* See if we should be getting supply levels via SNMP...
*/
if ((ppd = ppdOpenFile(getenv("PPD"))) != NULL &&
(ppdattr = ppdFindAttr(ppd, "cupsSNMPSupplies", NULL)) != NULL &&
ppdattr->value && strcasecmp(ppdattr->value, "true"))
if ((ppd = ppdOpenFile(getenv("PPD"))) == NULL ||
((ppdattr = ppdFindAttr(ppd, "cupsSNMPSupplies", NULL)) != NULL &&
ppdattr->value && strcasecmp(ppdattr->value, "true")))
{
ppdClose(ppd);
return;
+4 -2
Ver Arquivo
@@ -72,9 +72,11 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
sep; /* Option separator */
int print_fd; /* Print file */
int copies; /* Number of copies to print */
time_t start_time, /* Time of first connect */
current_time, /* Current time */
time_t start_time; /* Time of first connect */
#ifdef __APPLE__
time_t current_time, /* Current time */
wait_time; /* Time to wait before shutting down socket */
#endif /* __APPLE__ */
int recoverable; /* Recoverable error shown? */
int contimeout; /* Connection timeout */
int waiteof; /* Wait for end-of-file? */
+6 -4
Ver Arquivo
@@ -3,7 +3,7 @@
*
* Libusb interface code for CUPS.
*
* Copyright 2007-2010 by Apple Inc.
* Copyright 2007-2011 by Apple Inc.
*
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
@@ -100,7 +100,7 @@ print_device(const char *uri, /* I - Device URI */
usb_printer_t *printer; /* Printer */
ssize_t bytes, /* Bytes read/written */
tbytes; /* Total bytes written */
char buffer[8192]; /* Print data buffer */
char buffer[512]; /* Print data buffer */
struct sigaction action; /* Actions for POSIX signals */
struct pollfd pfds[2]; /* Poll descriptors */
@@ -411,7 +411,7 @@ get_device_id(usb_printer_t *printer, /* I - Printer */
if (usb_control_msg(printer->handle,
USB_TYPE_CLASS | USB_ENDPOINT_IN | USB_RECIP_INTERFACE,
0, printer->conf, printer->iface,
0, printer->conf, (printer->iface << 8) | printer->altset,
buffer, bufsize, 5000) < 0)
{
*buffer = '\0';
@@ -675,6 +675,7 @@ open_device(usb_printer_t *printer, /* I - Printer */
goto error;
}
#if 0 /* STR #3801: Claiming interface 0 causes problems with some printers */
if (number != 0)
while (usb_claim_interface(printer->handle, 0) < 0)
{
@@ -685,6 +686,7 @@ open_device(usb_printer_t *printer, /* I - Printer */
goto error;
}
#endif /* 0 */
/*
* Set alternate setting...
@@ -748,7 +750,7 @@ side_cb(usb_printer_t *printer, /* I - Printer */
{
ssize_t bytes, /* Bytes read/written */
tbytes; /* Total bytes written */
char buffer[8192]; /* Print data buffer */
char buffer[512]; /* Print data buffer */
struct pollfd pfd; /* Poll descriptor */
cups_sc_command_t command; /* Request command */
cups_sc_status_t status; /* Request/response status */
+31 -6
Ver Arquivo
@@ -1,9 +1,9 @@
/*
* "$Id$"
*
* Administration CGI for the Common UNIX Printing System (CUPS).
* Administration CGI for CUPS.
*
* Copyright 2007-2010 by Apple Inc.
* Copyright 2007-2011 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
@@ -145,7 +145,30 @@ main(int argc, /* I - Number of command-line arguments */
fprintf(stderr, "DEBUG: op=\"%s\"...\n", op);
if (!strcmp(op, "set-allowed-users"))
if (!*op)
{
const char *printer = getenv("PRINTER_NAME"),
/* Printer or class name */
*server_port = getenv("SERVER_PORT");
/* Port number string */
int port = atoi(server_port ? server_port : "0");
/* Port number */
char uri[1024]; /* URL */
if (printer)
httpAssembleURIf(HTTP_URI_CODING_ALL, uri, sizeof(uri),
getenv("HTTPS") ? "https" : "http", NULL,
getenv("SERVER_NAME"), port, "/%s/%s",
cgiGetVariable("IS_CLASS") ? "classes" : "printers",
printer);
else
httpAssembleURI(HTTP_URI_CODING_ALL, uri, sizeof(uri),
getenv("HTTPS") ? "https" : "http", NULL,
getenv("SERVER_NAME"), port, "/admin");
printf("Location: %s\n\n", uri);
}
else if (!strcmp(op, "set-allowed-users"))
do_set_allowed_users(http);
else if (!strcmp(op, "set-as-default"))
do_set_default(http);
@@ -1003,7 +1026,7 @@ do_am_printer(http_t *http, /* I - HTTP connection */
fputs("DEBUG: Getting list of devices...\n", stderr);
current_device = 0;
if (cupsGetDevices(http, 30, CUPS_INCLUDE_ALL, CUPS_EXCLUDE_NONE,
if (cupsGetDevices(http, 5, CUPS_INCLUDE_ALL, CUPS_EXCLUDE_NONE,
(cups_device_cb_t)choose_device_cb,
(void *)title) == IPP_OK)
{
@@ -1040,7 +1063,8 @@ do_am_printer(http_t *http, /* I - HTTP connection */
}
}
}
else if (strchr(var, '/') == NULL)
else if (!strchr(var, '/') ||
(!strncmp(var, "lpd://", 6) && !strchr(var + 6, '/')))
{
if ((attr = ippFindAttribute(oldinfo, "device-uri", IPP_TAG_URI)) != NULL)
{
@@ -2583,7 +2607,8 @@ do_list_printers(http_t *http) /* I - HTTP connection */
if (isalnum(*ptr & 255) || *ptr == '_' || *ptr == '-' ||
*ptr == '.')
*option_ptr++ = *ptr;
else if ((*ptr == ' ' || *ptr == '/') && option_ptr[-1] != '_')
else if ((*ptr == ' ' || *ptr == '/') && option_ptr > option &&
option_ptr[-1] != '_')
*option_ptr++ = '_';
else if (*ptr == '?' || *ptr == '(')
break;
+17 -3
Ver Arquivo
@@ -1,9 +1,9 @@
/*
* "$Id$"
*
* Class status CGI for the Common UNIX Printing System (CUPS).
* Class status CGI for CUPS.
*
* Copyright 2007-2008 by Apple Inc.
* Copyright 2007-2011 by Apple Inc.
* Copyright 1997-2006 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
@@ -147,7 +147,21 @@ main(int argc, /* I - Number of command-line arguments */
}
else if (pclass)
{
if (!strcmp(op, "start-class"))
if (!*op)
{
const char *server_port = getenv("SERVER_PORT");
/* Port number string */
int port = atoi(server_port ? server_port : "0");
/* Port number */
char uri[1024]; /* URL */
httpAssembleURIf(HTTP_URI_CODING_ALL, uri, sizeof(uri),
getenv("HTTPS") ? "https" : "http", NULL,
getenv("SERVER_NAME"), port, "/classes/%s", pclass);
printf("Location: %s\n\n", uri);
}
else if (!strcmp(op, "start-class"))
do_class_op(http, pclass, IPP_RESUME_PRINTER, cgiText(_("Resume Class")));
else if (!strcmp(op, "stop-class"))
do_class_op(http, pclass, IPP_PAUSE_PRINTER, cgiText(_("Pause Class")));
+8 -26
Ver Arquivo
@@ -1,9 +1,9 @@
/*
* "$Id$"
*
* HTML support functions for the Common UNIX Printing System (CUPS).
* HTML support functions for CUPS.
*
* Copyright 2007-2009 by Apple Inc.
* Copyright 2007-2011 by Apple Inc.
* Copyright 1997-2006 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
@@ -208,31 +208,13 @@ cgiStartMultipart(void)
int /* O - 1 if multi-part supported, 0 otherwise */
cgiSupportsMultipart(void)
{
const char *user_agent; /* User-Agent string */
static int supports_multipart = -1;/* Cached value */
/*
* Too many bug reports for browsers that don't support it, and too much pain
* to whitelist known-good browsers, so for now we just punt on multi-part
* support... :(
*/
if (supports_multipart < 0)
{
/*
* CUPS STR #3049: Apparently some browsers don't support multi-part
* documents, which makes them useless for many web sites. Rather than
* abandoning those users, we'll offer a degraded single-part mode...
*
* Currently we know that anything based on Gecko, MSIE, and Safari all
* work. We'll add more as they are reported/tested.
*/
if ((user_agent = getenv("HTTP_USER_AGENT")) != NULL &&
(strstr(user_agent, " Gecko/") != NULL ||
strstr(user_agent, " MSIE ") != NULL ||
strstr(user_agent, " Safari/") != NULL))
supports_multipart = 1;
else
supports_multipart = 0;
}
return (supports_multipart);
return (0);
}
+17 -3
Ver Arquivo
@@ -1,9 +1,9 @@
/*
* "$Id$"
*
* Printer status CGI for the Common UNIX Printing System (CUPS).
* Printer status CGI for CUPS.
*
* Copyright 2007-2008 by Apple Inc.
* Copyright 2007-2011 by Apple Inc.
* Copyright 1997-2006 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
@@ -148,7 +148,21 @@ main(int argc, /* I - Number of command-line arguments */
}
else if (printer)
{
if (!strcmp(op, "start-printer"))
if (!*op)
{
const char *server_port = getenv("SERVER_PORT");
/* Port number string */
int port = atoi(server_port ? server_port : "0");
/* Port number */
char uri[1024]; /* URL */
httpAssembleURIf(HTTP_URI_CODING_ALL, uri, sizeof(uri),
getenv("HTTPS") ? "https" : "http", NULL,
getenv("SERVER_NAME"), port, "/printers/%s", printer);
printf("Location: %s\n\n", uri);
}
else if (!strcmp(op, "start-printer"))
do_printer_op(http, printer, IPP_RESUME_PRINTER,
cgiText(_("Resume Printer")));
else if (!strcmp(op, "stop-printer"))
+24 -23
Ver Arquivo
@@ -1,9 +1,9 @@
dnl
dnl "$Id: cups-common.m4 9259 2010-08-13 04:11:46Z mike $"
dnl "$Id: cups-common.m4 9482 2011-01-14 18:57:44Z mike $"
dnl
dnl Common configuration stuff for CUPS.
dnl
dnl Copyright 2007-2010 by Apple Inc.
dnl Copyright 2007-2011 by Apple Inc.
dnl Copyright 1997-2007 by Easy Software Products, all rights reserved.
dnl
dnl These coded instructions, statements, and computer programs are the
@@ -20,7 +20,7 @@ dnl Set the name of the config header file...
AC_CONFIG_HEADER(config.h)
dnl Version number information...
CUPS_VERSION="1.4.5"
CUPS_VERSION="1.4.7"
CUPS_REVISION=""
#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'`"
@@ -88,6 +88,9 @@ fi
AC_SUBST(INSTALLSTATIC)
dnl Check for pkg-config, which is used for some other tests later on...
AC_PATH_PROG(PKGCONFIG, pkg-config)
dnl Check for libraries...
AC_SEARCH_LIBS(crypt, crypt)
AC_SEARCH_LIBS(getspent, sec gen)
@@ -207,7 +210,7 @@ else
fi
if test $check_libusb = yes; then
AC_CHECK_LIB(usb, usb_init,[
AC_CHECK_LIB(usb, usb_get_string_simple,[
AC_CHECK_HEADER(usb.h,
AC_DEFINE(HAVE_USB_H)
LIBUSB="-lusb")])
@@ -268,24 +271,22 @@ AC_ARG_WITH(dbusdir, [ --with-dbusdir set DBUS configuration directory
DBUS_NOTIFIER=""
DBUS_NOTIFIERLIBS=""
if test "x$enable_dbus" != xno; then
AC_PATH_PROG(PKGCONFIG, pkg-config)
if test "x$PKGCONFIG" != x; then
AC_MSG_CHECKING(for DBUS)
if $PKGCONFIG --exists dbus-1; then
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_DBUS)
CFLAGS="$CFLAGS `$PKGCONFIG --cflags dbus-1` -DDBUS_API_SUBJECT_TO_CHANGE"
CUPSDLIBS="$CUPSDLIBS `$PKGCONFIG --libs dbus-1`"
DBUS_NOTIFIER="dbus"
DBUS_NOTIFIERLIBS="`$PKGCONFIG --libs dbus-1`"
AC_CHECK_LIB(dbus-1,
dbus_message_iter_init_append,
AC_DEFINE(HAVE_DBUS_MESSAGE_ITER_INIT_APPEND),,
`$PKGCONFIG --libs dbus-1`)
else
AC_MSG_RESULT(no)
fi
if test "x$enable_dbus" != xno -a "x$PKGCONFIG" != x; then
AC_MSG_CHECKING(for DBUS)
if $PKGCONFIG --exists dbus-1; then
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_DBUS)
CFLAGS="$CFLAGS `$PKGCONFIG --cflags dbus-1` -DDBUS_API_SUBJECT_TO_CHANGE"
CUPSDLIBS="$CUPSDLIBS `$PKGCONFIG --libs dbus-1`"
DBUS_NOTIFIER="dbus"
DBUS_NOTIFIERLIBS="`$PKGCONFIG --libs dbus-1`"
SAVELIBS="$LIBS"
LIBS="$LIBS $DBUS_NOTIFIERLIBS"
AC_CHECK_FUNC(dbus_message_iter_init_append,
AC_DEFINE(HAVE_DBUS_MESSAGE_ITER_INIT_APPEND))
LIBS="$SAVELIBS"
else
AC_MSG_RESULT(no)
fi
fi
@@ -370,5 +371,5 @@ AC_SUBST(FONTS)
AC_SUBST(LEGACY_BACKENDS)
dnl
dnl End of "$Id: cups-common.m4 9259 2010-08-13 04:11:46Z mike $".
dnl End of "$Id: cups-common.m4 9482 2011-01-14 18:57:44Z mike $".
dnl
+15 -8
Ver Arquivo
@@ -1,5 +1,5 @@
dnl
dnl "$Id: cups-compiler.m4 8655 2009-05-17 00:13:47Z mike $"
dnl "$Id: cups-compiler.m4 9822 2011-06-10 22:59:36Z mike $"
dnl
dnl Compiler stuff for the Common UNIX Printing System (CUPS).
dnl
@@ -146,15 +146,22 @@ if test -n "$GCC"; then
AC_MSG_RESULT(no))
CFLAGS="$OLDCFLAGS"
# The -pie option is available with some versions of GCC and adds
# The -fPIE option is available with some versions of GCC and adds
# randomization of addresses, which avoids another class of exploits
# that depend on a fixed address for common functions.
AC_MSG_CHECKING(if GCC supports -pie)
AC_MSG_CHECKING(if GCC supports -fPIE)
OLDCFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -pie -fPIE"
CFLAGS="$CFLAGS -fPIE"
AC_TRY_COMPILE(,,
PIEFLAGS="-pie -fPIE"
AC_MSG_RESULT(yes),
[case "$CC" in
*clang)
PIEFLAGS="-fPIE -Wl,-pie"
;;
*)
PIEFLAGS="-fPIE -pie"
;;
esac
AC_MSG_RESULT(yes)],
AC_MSG_RESULT(no))
CFLAGS="$OLDCFLAGS"
@@ -175,7 +182,7 @@ if test -n "$GCC"; then
# checking, basically wrapping all string functions
# with buffer-limited ones. Not strictly needed for
# CUPS since we already use buffer-limited calls, but
# this will catch any additions that are broken.
# this will catch any additions that are broken.
CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2"
if test x$enable_pie = xyes; then
@@ -563,5 +570,5 @@ case $uname in
esac
dnl
dnl End of "$Id: cups-compiler.m4 8655 2009-05-17 00:13:47Z mike $".
dnl End of "$Id: cups-compiler.m4 9822 2011-06-10 22:59:36Z mike $".
dnl
+10 -6
Ver Arquivo
@@ -1,9 +1,9 @@
dnl
dnl "$Id: cups-ssl.m4 9203 2010-07-14 23:58:04Z mike $"
dnl "$Id: cups-ssl.m4 9470 2011-01-11 07:05:58Z mike $"
dnl
dnl OpenSSL/GNUTLS stuff for CUPS.
dnl
dnl Copyright 2007-2010 by Apple Inc.
dnl Copyright 2007-2011 by Apple Inc.
dnl Copyright 1997-2007 by Easy Software Products, all rights reserved.
dnl
dnl These coded instructions, statements, and computer programs are the
@@ -30,7 +30,7 @@ have_ssl=0
if test x$enable_ssl != xno; then
dnl Look for CDSA...
if test $have_ssl = 0 -a "x${enable_cdsassl}" != "xno"; then
if test $have_ssl = 0 -a "x$enable_cdsassl" != "xno"; then
if test $uname = Darwin; then
AC_CHECK_HEADER(Security/SecureTransport.h, [
have_ssl=1
@@ -38,6 +38,8 @@ if test x$enable_ssl != xno; then
AC_DEFINE(HAVE_CDSASSL)
dnl Check for the various security headers...
AC_CHECK_HEADER(Security/SecItem.h,
AC_DEFINE(HAVE_SECITEM_H))
AC_CHECK_HEADER(Security/SecItemPriv.h,
AC_DEFINE(HAVE_SECITEMPRIV_H))
AC_CHECK_HEADER(Security/SecPolicy.h,
@@ -70,7 +72,7 @@ if test x$enable_ssl != xno; then
fi
dnl Then look for GNU TLS...
if test $have_ssl = 0 -a "x${enable_gnutls}" != "xno" -a "x$PKGCONFIG" != x; then
if test $have_ssl = 0 -a "x$enable_gnutls" != "xno" -a "x$PKGCONFIG" != x; then
AC_PATH_PROG(LIBGNUTLSCONFIG,libgnutls-config)
AC_PATH_PROG(LIBGCRYPTCONFIG,libgcrypt-config)
if $PKGCONFIG --exists gnutls; then
@@ -107,7 +109,7 @@ if test x$enable_ssl != xno; then
fi
dnl Check for the OpenSSL library last...
if test $have_ssl = 0 -a "x${enable_openssl}" != "xno"; then
if test $have_ssl = 0 -a "x$enable_openssl" != "xno"; then
AC_CHECK_HEADER(openssl/ssl.h,
dnl Save the current libraries so the crypto stuff isn't always
dnl included...
@@ -144,6 +146,8 @@ fi
if test $have_ssl = 1; then
AC_MSG_RESULT([ Using SSLLIBS="$SSLLIBS"])
AC_MSG_RESULT([ Using SSLFLAGS="$SSLFLAGS"])
elif test x$enable_cdsa = xyes -o x$enable_gnutls = xyes -o x$enable_openssl = xyes; then
AC_MSG_ERROR([Unable to enable SSL support.])
fi
AC_SUBST(SSLFLAGS)
@@ -154,5 +158,5 @@ AC_SUBST(EXPORT_SSLLIBS)
dnl
dnl End of "$Id: cups-ssl.m4 9203 2010-07-14 23:58:04Z mike $".
dnl End of "$Id: cups-ssl.m4 9470 2011-01-11 07:05:58Z mike $".
dnl
+2 -1
Ver Arquivo
@@ -3,7 +3,7 @@
*
* Configuration file for CUPS.
*
* Copyright 2007-2010 by Apple Inc.
* Copyright 2007-2011 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
@@ -289,6 +289,7 @@
*/
#undef HAVE_AUTHORIZATION_H
#undef HAVE_SECITEM_H
#undef HAVE_SECITEMPRIV_H
#undef HAVE_SECPOLICY_H
#undef HAVE_SECPOLICYPRIV_H
+53 -26
Ver Arquivo
@@ -4,7 +4,7 @@
* Administration utility API definitions for the Common UNIX Printing
* System (CUPS).
*
* Copyright 2007-2010 by Apple Inc.
* Copyright 2007-2011 by Apple Inc.
* Copyright 2001-2007 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
@@ -17,16 +17,14 @@
*
* Contents:
*
* cupsAdminCreateWindowsPPD() - Create the Windows PPD file for a printer.
* cupsAdminExportSamba() - Export a printer to Samba.
* cupsAdminGetServerSettings() - Get settings from the server.
* _cupsAdminGetServerSettings() - Get settings from the server (private).
* cupsAdminSetServerSettings() - Set settings on the server.
* _cupsAdminSetServerSettings() - Set settings on the server (private).
* do_samba_command() - Do a SAMBA command.
* get_cupsd_conf() - Get the current cupsd.conf file.
* invalidate_cupsd_cache() - Invalidate the cached cupsd.conf settings.
* write_option() - Write a CUPS option to a PPD file.
* cupsAdminCreateWindowsPPD() - Create the Windows PPD file for a printer.
* cupsAdminExportSamba() - Export a printer to Samba.
* cupsAdminGetServerSettings() - Get settings from the server.
* cupsAdminSetServerSettings() - Set settings on the server.
* do_samba_command() - Do a SAMBA command.
* get_cupsd_conf() - Get the current cupsd.conf file.
* invalidate_cupsd_cache() - Invalidate the cached cupsd.conf settings.
* write_option() - Write a CUPS option to a PPD file.
*/
/*
@@ -50,12 +48,6 @@
* Local functions...
*/
extern int _cupsAdminGetServerSettings(http_t *http,
int *num_settings,
cups_option_t **settings);
extern int _cupsAdminSetServerSettings(http_t *http,
int num_settings,
cups_option_t *settings);
static int do_samba_command(const char *command,
const char *address,
const char *subcommand,
@@ -1024,7 +1016,7 @@ cupsAdminGetServerSettings(
&& *value != '/'
#endif /* AF_LOCAL */
#ifdef AF_INET6
&& strcmp(value, "::1")
&& strcmp(value, "[::1]")
#endif /* AF_INET6 */
)
remote_access = 1;
@@ -1284,12 +1276,18 @@ cupsAdminSetServerSettings(
else
old_debug_logging = 0;
DEBUG_printf(("1cupsAdminSetServerSettings: old debug_logging=%d",
old_debug_logging));
if ((val = cupsGetOption(CUPS_SERVER_REMOTE_ADMIN, cupsd_num_settings,
cupsd_settings)) != NULL)
old_remote_admin = atoi(val);
else
old_remote_admin = 0;
DEBUG_printf(("1cupsAdminSetServerSettings: old remote_admin=%d",
old_remote_admin));
if ((val = cupsGetOption(CUPS_SERVER_REMOTE_ANY, cupsd_num_settings,
cupsd_settings)) != NULL)
remote_any = atoi(val);
@@ -1305,18 +1303,27 @@ cupsAdminSetServerSettings(
else
old_remote_printers = 1;
DEBUG_printf(("1cupsAdminSetServerSettings: old remote_printers=%d",
old_remote_printers));
if ((val = cupsGetOption(CUPS_SERVER_SHARE_PRINTERS, cupsd_num_settings,
cupsd_settings)) != NULL)
old_share_printers = atoi(val);
else
old_share_printers = 0;
DEBUG_printf(("1cupsAdminSetServerSettings: old share_printers=%d",
old_share_printers));
if ((val = cupsGetOption(CUPS_SERVER_USER_CANCEL_ANY, cupsd_num_settings,
cupsd_settings)) != NULL)
old_user_cancel_any = atoi(val);
else
old_user_cancel_any = 0;
DEBUG_printf(("1cupsAdminSetServerSettings: old user_cancel_any=%d",
old_user_cancel_any));
cupsFreeOptions(cupsd_num_settings, cupsd_settings);
/*
@@ -1340,16 +1347,22 @@ cupsAdminSetServerSettings(
else
debug_logging = -1;
DEBUG_printf(("1cupsAdminSetServerSettings: debug_logging=%d",
debug_logging));
if ((val = cupsGetOption(CUPS_SERVER_REMOTE_ANY, num_settings,
settings)) != NULL)
remote_any = atoi(val);
DEBUG_printf(("1cupsAdminSetServerSettings: remote_any=%d",
remote_any));
if ((val = cupsGetOption(CUPS_SERVER_REMOTE_ADMIN, num_settings,
settings)) != NULL)
{
remote_admin = atoi(val);
if (remote_admin == old_remote_admin && remote_any < 0)
if (remote_admin == old_remote_admin)
{
/*
* No change to this setting...
@@ -1361,6 +1374,9 @@ cupsAdminSetServerSettings(
else
remote_admin = -1;
DEBUG_printf(("1cupsAdminSetServerSettings: remote_admin=%d",
remote_admin));
if ((val = cupsGetOption(CUPS_SERVER_REMOTE_PRINTERS, num_settings,
settings)) != NULL)
{
@@ -1378,12 +1394,15 @@ cupsAdminSetServerSettings(
else
remote_printers = -1;
DEBUG_printf(("1cupsAdminSetServerSettings: remote_printers=%d",
remote_printers));
if ((val = cupsGetOption(CUPS_SERVER_SHARE_PRINTERS, num_settings,
settings)) != NULL)
{
share_printers = atoi(val);
if (share_printers == old_share_printers && remote_any < 0)
if (share_printers == old_share_printers)
{
/*
* No change to this setting...
@@ -1395,6 +1414,9 @@ cupsAdminSetServerSettings(
else
share_printers = -1;
DEBUG_printf(("1cupsAdminSetServerSettings: share_printers=%d",
share_printers));
if ((val = cupsGetOption(CUPS_SERVER_USER_CANCEL_ANY, num_settings,
settings)) != NULL)
{
@@ -1412,6 +1434,9 @@ cupsAdminSetServerSettings(
else
user_cancel_any = -1;
DEBUG_printf(("1cupsAdminSetServerSettings: user_cancel_any=%d",
user_cancel_any));
/*
* Create a temporary file for the new cupsd.conf file...
*/
@@ -1463,7 +1488,7 @@ cupsAdminSetServerSettings(
while (cupsFileGetConf(cupsd, line, sizeof(line), &value, &linenum))
{
if ((!strcasecmp(line, "Port") || !strcasecmp(line, "Listen")) &&
(remote_admin >= 0 || remote_any >= 0 || share_printers >= 0))
(remote_admin >= 0 || remote_any > 0 || share_printers >= 0))
{
if (!wrote_port_listen)
{
@@ -1678,7 +1703,7 @@ cupsAdminSetServerSettings(
remote_any > 0 ? "all" : "@LOCAL");
}
else if (in_root_location &&
(remote_admin >= 0 || remote_any >= 0 || share_printers >= 0))
(remote_admin >= 0 || remote_any > 0 || share_printers >= 0))
{
wrote_root_location = 1;
@@ -1780,7 +1805,7 @@ cupsAdminSetServerSettings(
in_cancel_job = 0;
}
else if ((((in_admin_location || in_conf_location || in_root_location) &&
(remote_admin >= 0 || remote_any >= 0)) ||
(remote_admin >= 0 || remote_any > 0)) ||
(in_root_location && share_printers >= 0)) &&
(!strcasecmp(line, "Allow") || !strcasecmp(line, "Deny") ||
!strcasecmp(line, "Order")))
@@ -1826,7 +1851,7 @@ cupsAdminSetServerSettings(
/*
* Record the non-policy, non-location directives that we find
* in the server settings, since we cache this info and record it
* in _cupsAdminGetServerSettings()...
* in cupsAdminGetServerSettings()...
*/
cupsd_num_settings = cupsAddOption(line, value, cupsd_num_settings,
@@ -1885,7 +1910,7 @@ cupsAdminSetServerSettings(
}
if (!wrote_port_listen &&
(remote_admin >= 0 || remote_any >= 0 || share_printers >= 0))
(remote_admin >= 0 || remote_any > 0 || share_printers >= 0))
{
if (remote_admin > 0 || remote_any > 0 || share_printers > 0)
{
@@ -1906,7 +1931,7 @@ cupsAdminSetServerSettings(
}
if (!wrote_root_location &&
(remote_admin >= 0 || remote_any >= 0 || share_printers >= 0))
(remote_admin >= 0 || remote_any > 0 || share_printers >= 0))
{
if (remote_admin > 0 && share_printers > 0)
cupsFilePuts(temp,
@@ -2012,6 +2037,8 @@ cupsAdminSetServerSettings(
for (i = num_settings, setting = settings; i > 0; i --, setting ++)
if (setting->name[0] != '_' &&
strcasecmp(setting->name, "Listen") &&
strcasecmp(setting->name, "Port") &&
!cupsGetOption(setting->name, cupsd_num_settings, cupsd_settings))
{
/*
+3 -3
Ver Arquivo
@@ -1,9 +1,9 @@
<!--
"$Id: api-array.shtml 7616 2008-05-28 00:34:13Z mike $"
"$Id: api-array.shtml 9728 2011-04-28 21:21:24Z mike $"
Array API introduction for the Common UNIX Printing System (CUPS).
Array API introduction for CUPS.
Copyright 2007-2008 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
+4 -4
Ver Arquivo
@@ -1,9 +1,9 @@
<!--
"$Id: api-cups.shtml 9061 2010-03-30 22:07:33Z mike $"
"$Id: api-cups.shtml 9728 2011-04-28 21:21:24Z mike $"
CUPS API introduction for the Common UNIX Printing System (CUPS).
API introduction for CUPS.
Copyright 2007-2010 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
@@ -50,7 +50,7 @@ specific destination for printing:</p>
int num_dests = <a href='#cupsGetDests'>cupsGetDests</a>(&amp;dests);
<a href='#cups_dest_t'>cups_dest_t</a> *dest = <a href='#cupsGetDest'>cupsGetDest</a>("name", NULL, num_dests, dests);
/* do something wiith dest */
/* do something with dest */
<a href='#cupsFreeDests'>cupsFreeDests</a>(num_dests, dests);
</pre>
+3 -3
Ver Arquivo
@@ -1,9 +1,9 @@
<!--
"$Id: api-filedir.shtml 7279 2008-01-31 01:50:44Z mike $"
"$Id: api-filedir.shtml 9728 2011-04-28 21:21:24Z mike $"
File and directory API introduction for the Common UNIX Printing System (CUPS).
File and directory API introduction for CUPS.
Copyright 2007-2008 by Apple Inc.
Copyright 2007-2011 by Apple Inc.
Copyright 1997-2005 by Easy Software Products, all rights reserved.
These coded instructions, statements, and computer programs are the
+2 -2
Ver Arquivo
@@ -1,5 +1,5 @@
<!--
"$Id: api-filter.shtml 9120 2010-04-23 18:56:34Z mike $"
"$Id: api-filter.shtml 9728 2011-04-28 21:21:24Z mike $"
Filter and backend programming introduction for the Common UNIX Printing
System (CUPS).
@@ -58,7 +58,7 @@ more detail.</p>
<h3><a name="SECURITY">Security Considerations</a></h3>
<p>It is always important to use security programming practices. Filters and
most backends are run as a non-priviledged user, so the major security
most backends are run as a non-privileged user, so the major security
consideration is resource utilization - filters should not depend on unlimited
amounts of CPU, memory, or disk space, and should protect against conditions
that could lead to excess usage of any resource like infinite loops and
+3 -3
Ver Arquivo
@@ -1,9 +1,9 @@
<!--
"$Id: api-httpipp.shtml 7684 2008-06-23 16:47:38Z mike $"
"$Id: api-httpipp.shtml 9728 2011-04-28 21:21:24Z mike $"
HTTP and IPP API introduction for the Common UNIX Printing System (CUPS).
HTTP and IPP API introduction for CUPS.
Copyright 2007-2008 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
+2 -3
Ver Arquivo
@@ -1,10 +1,9 @@
<!--
"$Id: api-cups.header 7279 2008-01-31 01:50:44Z mike $"
Introduction to CUPS programming content for the Common UNIX Printing System
(CUPS).
Introduction to CUPS programming content for CUPS.
Copyright 2008 by Apple Inc.
Copyright 2008-2011 by Apple Inc.
These coded instructions, statements, and computer programs are the
property of Apple Inc. and are protected by Federal copyright
+3 -3
Ver Arquivo
@@ -1,9 +1,9 @@
<!--
"$Id: api-ppd.shtml 7616 2008-05-28 00:34:13Z mike $"
"$Id: api-ppd.shtml 9728 2011-04-28 21:21:24Z mike $"
PPD API introduction for the Common UNIX Printing System (CUPS).
PPD API introduction for CUPS.
Copyright 2007-2008 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
+8 -8
Ver Arquivo
@@ -1,9 +1,9 @@
/*
* "$Id$"
*
* Option marking routines for the Common UNIX Printing System (CUPS).
* Option marking routines for CUPS.
*
* Copyright 2007-2009 by Apple Inc.
* Copyright 2007-2011 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
@@ -483,13 +483,13 @@ cupsResolveConflicts(
}
}
}
}
if (!changed)
{
DEBUG_puts("1ppdResolveConflicts: Unable to automatically resolve "
"constraint!");
goto error;
}
if (!changed)
{
DEBUG_puts("1ppdResolveConflicts: Unable to automatically resolve "
"constraint!");
goto error;
}
cupsArrayClear(pass);
+2 -2
Ver Arquivo
@@ -61,10 +61,10 @@ extern "C" {
* Constants...
*/
# define CUPS_VERSION 1.0405
# define CUPS_VERSION 1.0407
# define CUPS_VERSION_MAJOR 1
# define CUPS_VERSION_MINOR 4
# define CUPS_VERSION_PATCH 5
# define CUPS_VERSION_PATCH 7
# define CUPS_BC_FD 3 /* Back-channel file descriptor for select/poll */
# define CUPS_DATE_ANY (time_t)-1
+10 -5
Ver Arquivo
@@ -1,9 +1,9 @@
/*
* "$Id$"
*
* PPD custom option routines for the Common UNIX Printing System (CUPS).
* PPD custom option routines for CUPS.
*
* Copyright 2007 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
@@ -70,14 +70,19 @@ ppd_cparam_t * /* O - Custom parameter or NULL */
ppdFindCustomParam(ppd_coption_t *opt, /* I - Custom option */
const char *name) /* I - Parameter name */
{
ppd_cparam_t key; /* Custom parameter search key */
ppd_cparam_t *param; /* Current custom parameter */
if (!opt)
return (NULL);
strlcpy(key.name, name, sizeof(key.name));
return ((ppd_cparam_t *)cupsArrayFind(opt->params, &key));
for (param = (ppd_cparam_t *)cupsArrayFirst(opt->params);
param;
param = (ppd_cparam_t *)cupsArrayNext(opt->params))
if (!strcasecmp(param->name, name))
break;
return (param);
}
+2 -1
Ver Arquivo
@@ -195,8 +195,9 @@ globals_destructor(void *value) /* I - Data to free */
free(buffer);
}
cupsArrayDelete(cg->pwg_size_lut);
cupsArrayDelete(cg->leg_size_lut);
cupsArrayDelete(cg->ppd_size_lut);
cupsArrayDelete(cg->pwg_size_lut);
free(value);
}
+34 -22
Ver Arquivo
@@ -1,9 +1,9 @@
/*
* "$Id$"
*
* HTTP address routines for the Common UNIX Printing System (CUPS).
* HTTP address routines 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
@@ -358,8 +358,11 @@ httpAddrString(const http_addr_t *addr, /* I - Address to convert */
#ifdef AF_INET6
else if (addr->addr.sa_family == AF_INET6)
{
char *sptr, /* Pointer into string */
temps[64]; /* Temporary string for address */
# ifdef HAVE_GETNAMEINFO
if (getnameinfo(&addr->addr, httpAddrLength(addr), s, slen,
if (getnameinfo(&addr->addr, httpAddrLength(addr), temps, sizeof(temps),
NULL, 0, NI_NUMERICHOST))
{
/*
@@ -371,29 +374,36 @@ httpAddrString(const http_addr_t *addr, /* I - Address to convert */
return (NULL);
}
else if ((sptr = strchr(temps, '%')) != NULL)
{
/*
* Convert "%zone" to "+zone" to match URI form...
*/
*sptr = '+';
}
# else
char *sptr; /* Pointer into string */
int i; /* Looping var */
unsigned temp; /* Current value */
const char *prefix; /* Prefix for address */
prefix = "";
for (sptr = s, i = 0; i < 4 && addr->ipv6.sin6_addr.s6_addr32[i]; i ++)
for (sptr = temps, i = 0; i < 4 && addr->ipv6.sin6_addr.s6_addr32[i]; i ++)
{
temp = ntohl(addr->ipv6.sin6_addr.s6_addr32[i]);
snprintf(sptr, slen, "%s%x", prefix, (temp >> 16) & 0xffff);
snprintf(sptr, sizeof(temps) - (sptr - temps), "%s%x", prefix,
(temp >> 16) & 0xffff);
prefix = ":";
slen -= strlen(sptr);
sptr += strlen(sptr);
temp &= 0xffff;
if (temp || i == 3 || addr->ipv6.sin6_addr.s6_addr32[i + 1])
{
snprintf(sptr, slen, "%s%x", prefix, temp);
slen -= strlen(sptr);
snprintf(sptr, sizeof(temps) - (sptr - temps), "%s%x", prefix, temp);
sptr += strlen(sptr);
}
}
@@ -405,24 +415,24 @@ httpAddrString(const http_addr_t *addr, /* I - Address to convert */
if (i < 4)
{
snprintf(sptr, slen, "%s:", prefix);
snprintf(sptr, sizeof(temps) - (sptr - temps), "%s:", prefix);
prefix = ":";
slen -= strlen(sptr);
sptr += strlen(sptr);
for (; i < 4; i ++)
{
temp = ntohl(addr->ipv6.sin6_addr.s6_addr32[i]);
if ((temp & 0xffff0000) || addr->ipv6.sin6_addr.s6_addr32[i - 1])
if ((temp & 0xffff0000) ||
(i > 0 && addr->ipv6.sin6_addr.s6_addr32[i - 1]))
{
snprintf(sptr, slen, "%s%x", prefix, (temp >> 16) & 0xffff);
slen -= strlen(sptr);
snprintf(sptr, sizeof(temps) - (sptr - temps), "%s%x", prefix,
(temp >> 16) & 0xffff);
sptr += strlen(sptr);
}
snprintf(sptr, slen, "%s%x", prefix, temp & 0xffff);
slen -= strlen(sptr);
snprintf(sptr, sizeof(temps) - (sptr - temps), "%s%x", prefix,
temp & 0xffff);
sptr += strlen(sptr);
}
}
@@ -432,9 +442,7 @@ httpAddrString(const http_addr_t *addr, /* I - Address to convert */
* Empty address...
*/
strlcpy(s, "::", slen);
sptr = s + 2;
slen -= 2;
strlcpy(temps, "::", sizeof(temps));
}
else
{
@@ -442,12 +450,16 @@ httpAddrString(const http_addr_t *addr, /* I - Address to convert */
* Empty at end...
*/
strlcpy(sptr, "::", slen);
sptr += 2;
slen -= 2;
strlcpy(sptr, "::", sizeof(temps) - (sptr - temps));
}
}
# endif /* HAVE_GETNAMEINFO */
/*
* Add "[v1." and "]" around IPv6 address to convert to URI form.
*/
snprintf(s, slen, "[v1.%s]", temps);
}
#endif /* AF_INET6 */
else
+3 -3
Ver Arquivo
@@ -1,9 +1,9 @@
/*
* "$Id$"
*
* HTTP address list routines for the Common UNIX Printing System (CUPS).
* HTTP address list routines for CUPS.
*
* Copyright 2007-2009 by Apple Inc.
* Copyright 2007-2011 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
@@ -271,7 +271,7 @@ httpAddrGetList(const char *hostname, /* I - Hostname, IP address, or NULL for p
struct addrinfo hints, /* Address lookup hints */
*results, /* Address lookup results */
*current; /* Current result */
char ipv6[1024], /* IPv6 address */
char ipv6[64], /* IPv6 address */
*ipv6zone; /* Pointer to zone separator */
int ipv6len; /* Length of IPv6 address */
int error; /* getaddrinfo() error */
+3 -2
Ver Arquivo
@@ -1,9 +1,9 @@
/*
* "$Id$"
*
* Private HTTP definitions for the Common UNIX Printing System (CUPS).
* Private HTTP definitions for CUPS.
*
* Copyright 2007-2008 by Apple Inc.
* Copyright 2007-2011 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
@@ -269,6 +269,7 @@ extern char *_httpEncodeURI(char *dst, const char *src,
size_t dstsize);
extern const char *_httpResolveURI(const char *uri, char *resolved_uri,
size_t resolved_size, int log);
extern int _httpUpdate(http_t *http, http_status_t *status);
extern int _httpWait(http_t *http, int msec, int usessl);
#endif /* !_CUPS_HTTP_PRIVATE_H_ */
+164 -131
Ver Arquivo
@@ -3,7 +3,7 @@
*
* HTTP routines for CUPS.
*
* Copyright 2007-2010 by Apple Inc.
* Copyright 2007-2011 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* This file contains Kerberos support code, copyright 2006 by
@@ -67,6 +67,7 @@
* httpSetField() - Set the value of an HTTP header.
* httpSetLength() - Set the content-length and content-encoding.
* httpTrace() - Send an TRACE request to the server.
* _httpUpdate() - Update the current HTTP status for incoming data.
* httpUpdate() - Update the current HTTP state for incoming data.
* _httpWait() - Wait for data available on a connection (no flush).
* httpWait() - Wait for data available on a connection.
@@ -2011,6 +2012,164 @@ httpTrace(http_t *http, /* I - Connection to server */
}
/*
* '_httpUpdate()' - Update the current HTTP status for incoming data.
*
* Note: Unlike httpUpdate(), this function does not flush pending write data
* and only retrieves a single status line from the HTTP connection.
*/
int /* O - 1 to continue, 0 to stop */
_httpUpdate(http_t *http, /* I - Connection to server */
http_status_t *status) /* O - Current HTTP status */
{
char line[32768], /* Line from connection... */
*value; /* Pointer to value on line */
http_field_t field; /* Field index */
int major, minor; /* HTTP version numbers */
DEBUG_printf(("_httpUpdate(http=%p, status=%p), state=%s", http, status,
http_states[http->state]));
/*
* Grab a single line from the connection...
*/
if (!httpGets(line, sizeof(line), http))
{
*status = HTTP_ERROR;
return (0);
}
DEBUG_printf(("2_httpUpdate: Got \"%s\"", line));
if (line[0] == '\0')
{
/*
* Blank line means the start of the data section (if any). Return
* the result code, too...
*
* If we get status 100 (HTTP_CONTINUE), then we *don't* change states.
* Instead, we just return HTTP_CONTINUE to the caller and keep on
* tryin'...
*/
if (http->status == HTTP_CONTINUE)
{
*status = http->status;
return (0);
}
if (http->status < HTTP_BAD_REQUEST)
http->digest_tries = 0;
#ifdef HAVE_SSL
if (http->status == HTTP_SWITCHING_PROTOCOLS && !http->tls)
{
if (http_setup_ssl(http) != 0)
{
# ifdef WIN32
closesocket(http->fd);
# else
close(http->fd);
# endif /* WIN32 */
*status = http->status = HTTP_ERROR;
return (0);
}
*status = HTTP_CONTINUE;
return (0);
}
#endif /* HAVE_SSL */
httpGetLength2(http);
switch (http->state)
{
case HTTP_GET :
case HTTP_POST :
case HTTP_POST_RECV :
case HTTP_PUT :
http->state ++;
case HTTP_POST_SEND :
case HTTP_HEAD :
break;
default :
http->state = HTTP_WAITING;
break;
}
*status = http->status;
return (0);
}
else if (!strncmp(line, "HTTP/", 5))
{
/*
* Got the beginning of a response...
*/
int intstatus; /* Status value as an integer */
if (sscanf(line, "HTTP/%d.%d%d", &major, &minor, &intstatus) != 3)
{
*status = http->status = HTTP_ERROR;
return (0);
}
http->version = (http_version_t)(major * 100 + minor);
*status = http->status = (http_status_t)intstatus;
}
else if ((value = strchr(line, ':')) != NULL)
{
/*
* Got a value...
*/
*value++ = '\0';
while (_cups_isspace(*value))
value ++;
/*
* Be tolerants of servers that send unknown attribute fields...
*/
if (!strcasecmp(line, "expect"))
{
/*
* "Expect: 100-continue" or similar...
*/
http->expect = (http_status_t)atoi(value);
}
else if (!strcasecmp(line, "cookie"))
{
/*
* "Cookie: name=value[; name=value ...]" - replaces previous cookies...
*/
httpSetCookie(http, value);
}
else if ((field = http_field(line)) != HTTP_FIELD_UNKNOWN)
httpSetField(http, field, value);
#ifdef DEBUG
else
DEBUG_printf(("1_httpUpdate: unknown field %s seen!", line));
#endif /* DEBUG */
}
else
{
DEBUG_printf(("1_httpUpdate: Bad response line \"%s\"!", line));
*status = http->status = HTTP_ERROR;
return (0);
}
return (1);
}
/*
* 'httpUpdate()' - Update the current HTTP state for incoming data.
*/
@@ -2018,11 +2177,7 @@ httpTrace(http_t *http, /* I - Connection to server */
http_status_t /* O - HTTP status */
httpUpdate(http_t *http) /* I - Connection to server */
{
char line[32768], /* Line from connection... */
*value; /* Pointer to value on line */
http_field_t field; /* Field index */
int major, minor, /* HTTP version numbers */
status; /* Request status */
http_status_t status; /* Request status */
DEBUG_printf(("httpUpdate(http=%p), state=%s", http,
@@ -2051,122 +2206,7 @@ httpUpdate(http_t *http) /* I - Connection to server */
* Grab all of the lines we can from the connection...
*/
while (httpGets(line, sizeof(line), http) != NULL)
{
DEBUG_printf(("2httpUpdate: Got \"%s\"", line));
if (line[0] == '\0')
{
/*
* Blank line means the start of the data section (if any). Return
* the result code, too...
*
* If we get status 100 (HTTP_CONTINUE), then we *don't* change states.
* Instead, we just return HTTP_CONTINUE to the caller and keep on
* tryin'...
*/
if (http->status == HTTP_CONTINUE)
return (http->status);
if (http->status < HTTP_BAD_REQUEST)
http->digest_tries = 0;
#ifdef HAVE_SSL
if (http->status == HTTP_SWITCHING_PROTOCOLS && !http->tls)
{
if (http_setup_ssl(http) != 0)
{
# ifdef WIN32
closesocket(http->fd);
# else
close(http->fd);
# endif /* WIN32 */
return (HTTP_ERROR);
}
return (HTTP_CONTINUE);
}
#endif /* HAVE_SSL */
httpGetLength2(http);
switch (http->state)
{
case HTTP_GET :
case HTTP_POST :
case HTTP_POST_RECV :
case HTTP_PUT :
http->state ++;
case HTTP_POST_SEND :
case HTTP_HEAD :
break;
default :
http->state = HTTP_WAITING;
break;
}
return (http->status);
}
else if (!strncmp(line, "HTTP/", 5))
{
/*
* Got the beginning of a response...
*/
if (sscanf(line, "HTTP/%d.%d%d", &major, &minor, &status) != 3)
return (HTTP_ERROR);
http->version = (http_version_t)(major * 100 + minor);
http->status = (http_status_t)status;
}
else if ((value = strchr(line, ':')) != NULL)
{
/*
* Got a value...
*/
*value++ = '\0';
while (_cups_isspace(*value))
value ++;
/*
* Be tolerants of servers that send unknown attribute fields...
*/
if (!strcasecmp(line, "expect"))
{
/*
* "Expect: 100-continue" or similar...
*/
http->expect = (http_status_t)atoi(value);
}
else if (!strcasecmp(line, "cookie"))
{
/*
* "Cookie: name=value[; name=value ...]" - replaces previous cookies...
*/
httpSetCookie(http, value);
}
else if ((field = http_field(line)) == HTTP_FIELD_UNKNOWN)
{
DEBUG_printf(("1httpUpdate: unknown field %s seen!", line));
continue;
}
else
httpSetField(http, field, value);
}
else
{
DEBUG_printf(("1httpUpdate: Bad response line \"%s\"!", line));
http->status = HTTP_ERROR;
return (HTTP_ERROR);
}
}
while (_httpUpdate(http, &status));
/*
* See if there was an error...
@@ -2187,10 +2227,10 @@ httpUpdate(http_t *http) /* I - Connection to server */
}
/*
* If we haven't already returned, then there is nothing new...
* Return the current status...
*/
return (HTTP_CONTINUE);
return (status);
}
@@ -2454,13 +2494,6 @@ httpWrite2(http_t *http, /* I - Connection to server */
http->data_encoding = HTTP_ENCODE_LENGTH;
http->data_remaining = 0;
}
if (http->state == HTTP_POST_RECV)
http->state ++;
else if (http->state == HTTP_PUT_RECV)
http->state = HTTP_STATUS;
else
http->state = HTTP_WAITING;
}
return (bytes);
+3 -4
Ver Arquivo
@@ -1,10 +1,9 @@
/*
* "$Id$"
*
* Hyper-Text Transport Protocol definitions for the Common UNIX Printing
* System (CUPS).
* Hyper-Text Transport Protocol definitions for CUPS.
*
* Copyright 2007-2009 by Apple Inc.
* Copyright 2007-2011 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
@@ -88,7 +87,7 @@ extern "C" {
#if defined(AF_INET6) && !defined(s6_addr32)
# if defined(__sun)
# define s6_addr32 _S6_un._S6_u32
# elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__APPLE__)
# elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__APPLE__)|| defined(__DragonFly__)
# define s6_addr32 __u6_addr.__u6_addr32
# elif defined(__osf__)
# define s6_addr32 s6_un.sa6_laddr
+128 -73
Ver Arquivo
@@ -81,10 +81,15 @@ cupsMarkOptions(
s[255]; /* Temporary string */
const char *val, /* Pointer into value */
*media, /* media option */
*output_bin, /* output-bin option */
*output_mode, /* output-mode option */
*page_size, /* PageSize option */
*ppd_keyword; /* PPD keyword */
*ppd_keyword, /* PPD keyword */
*print_quality, /* print-quality option */
*sides; /* sides option */
cups_option_t *optptr; /* Current option */
ppd_attr_t *attr; /* PPD attribute */
_pwg_t *pwg; /* PWG mapping data */
/*
@@ -97,29 +102,39 @@ cupsMarkOptions(
ppd_debug_marked(ppd, "Before...");
/*
* Do special handling for media and PageSize...
* Do special handling for finishings, media, output-bin, output-mode,
* print-color-mode, print-quality, and PageSize...
*/
media = cupsGetOption("media", num_options, options);
page_size = cupsGetOption("PageSize", num_options, options);
media = cupsGetOption("media", num_options, options);
output_bin = cupsGetOption("output-bin", num_options, options);
output_mode = cupsGetOption("output-mode", num_options, options);
page_size = cupsGetOption("PageSize", num_options, options);
print_quality = cupsGetOption("print-quality", num_options, options);
sides = cupsGetOption("sides", num_options, options);
if (media)
if ((media || output_bin || output_mode || print_quality || sides) &&
!ppd->pwg)
{
/*
* Load PWG mapping data as needed...
*/
if (!ppd->pwg)
ppd->pwg = _pwgCreateWithPPD(ppd);
ppd->pwg = _pwgCreateWithPPD(ppd);
}
pwg = (_pwg_t *)ppd->pwg;
if (media)
{
/*
* Loop through the option string, separating it at commas and
* marking each individual option as long as the corresponding
* PPD option (PageSize, InputSlot, etc.) is not also set.
* Loop through the option string, separating it at commas and marking each
* individual option as long as the corresponding PPD option (PageSize,
* InputSlot, etc.) is not also set.
*
* For PageSize, we also check for an empty option value since
* some versions of MacOS X use it to specify auto-selection
* of the media based solely on the size.
* For PageSize, we also check for an empty option value since some versions
* of MacOS X use it to specify auto-selection of the media based solely on
* the size.
*/
for (val = media; *val;)
@@ -143,21 +158,114 @@ cupsMarkOptions(
{
if (!strncasecmp(s, "Custom.", 7) || ppdPageSize(ppd, s))
ppd_mark_option(ppd, "PageSize", s);
else if ((ppd_keyword = _pwgGetPageSize((_pwg_t *)ppd->pwg, NULL, s,
NULL)) != NULL)
else if ((ppd_keyword = _pwgGetPageSize(pwg, NULL, s, NULL)) != NULL)
ppd_mark_option(ppd, "PageSize", ppd_keyword);
}
if (!cupsGetOption("InputSlot", num_options, options) &&
(ppd_keyword = _pwgGetInputSlot((_pwg_t *)ppd->pwg, NULL, s)) != NULL)
ppd_mark_option(ppd, "InputSlot", ppd_keyword);
if (pwg && pwg->source_option &&
!cupsGetOption(pwg->source_option, num_options, options) &&
(ppd_keyword = _pwgGetInputSlot(pwg, NULL, s)) != NULL)
ppd_mark_option(ppd, pwg->source_option, ppd_keyword);
if (!cupsGetOption("MediaType", num_options, options) &&
(ppd_keyword = _pwgGetMediaType((_pwg_t *)ppd->pwg, NULL, s)) != NULL)
(ppd_keyword = _pwgGetMediaType(pwg, NULL, s)) != NULL)
ppd_mark_option(ppd, "MediaType", ppd_keyword);
}
}
if (pwg)
{
if (!cupsGetOption("com.apple.print.DocumentTicket.PMSpoolFormat",
num_options, options) &&
!cupsGetOption("APPrinterPreset", num_options, options) &&
(output_mode || print_quality))
{
/*
* Map output-mode and print-quality to a preset...
*/
_pwg_output_mode_t pwg_om; /* output-mode index */
_pwg_print_quality_t pwg_pq; /* print-quality index */
cups_option_t *preset;/* Current preset option */
if (output_mode && !strcmp(output_mode, "monochrome"))
pwg_om = _PWG_OUTPUT_MODE_MONOCHROME;
else
pwg_om = _PWG_OUTPUT_MODE_COLOR;
if (print_quality)
{
pwg_pq = atoi(print_quality) - IPP_QUALITY_DRAFT;
if (pwg_pq < _PWG_PRINT_QUALITY_DRAFT)
pwg_pq = _PWG_PRINT_QUALITY_DRAFT;
else if (pwg_pq > _PWG_PRINT_QUALITY_HIGH)
pwg_pq = _PWG_PRINT_QUALITY_HIGH;
}
else
pwg_pq = _PWG_PRINT_QUALITY_NORMAL;
if (pwg->num_presets[pwg_om][pwg_pq] == 0)
{
/*
* Try to find a preset that works so that we maximize the chances of us
* getting a good print using IPP attributes.
*/
if (pwg->num_presets[pwg_om][_PWG_PRINT_QUALITY_NORMAL] > 0)
pwg_pq = _PWG_PRINT_QUALITY_NORMAL;
else if (pwg->num_presets[_PWG_OUTPUT_MODE_COLOR][pwg_pq] > 0)
pwg_om = _PWG_OUTPUT_MODE_COLOR;
else
{
pwg_pq = _PWG_PRINT_QUALITY_NORMAL;
pwg_om = _PWG_OUTPUT_MODE_COLOR;
}
}
if (pwg->num_presets[pwg_om][pwg_pq] > 0)
{
/*
* Copy the preset options as long as the corresponding names are not
* already defined in the IPP request...
*/
for (i = pwg->num_presets[pwg_om][pwg_pq],
preset = pwg->presets[pwg_om][pwg_pq];
i > 0;
i --, preset ++)
{
if (!cupsGetOption(preset->name, num_options, options))
ppd_mark_option(ppd, preset->name, preset->value);
}
}
}
if (output_bin && !cupsGetOption("OutputBin", num_options, options) &&
(ppd_keyword = _pwgGetOutputBin(pwg, output_bin)) != NULL)
{
/*
* Map output-bin to OutputBin...
*/
ppd_mark_option(ppd, "OutputBin", ppd_keyword);
}
if (sides && pwg->sides_option &&
!cupsGetOption(pwg->sides_option, num_options, options))
{
/*
* Map sides to duplex option...
*/
if (!strcmp(sides, "one-sided"))
ppd_mark_option(ppd, pwg->sides_option, pwg->sides_1sided);
else if (!strcmp(sides, "two-sided-long-edge"))
ppd_mark_option(ppd, pwg->sides_option, pwg->sides_2sided_long);
else if (!strcmp(sides, "two-sided-short-edge"))
ppd_mark_option(ppd, pwg->sides_option, pwg->sides_2sided_short);
}
}
/*
* Mark other options...
*/
@@ -166,6 +274,7 @@ cupsMarkOptions(
if (!strcasecmp(optptr->name, "media") ||
!strcasecmp(optptr->name, "output-bin") ||
!strcasecmp(optptr->name, "output-mode") ||
!strcasecmp(optptr->name, "print-quality") ||
!strcasecmp(optptr->name, "sides"))
continue;
else if (!strcasecmp(optptr->name, "resolution") ||
@@ -231,60 +340,6 @@ cupsMarkOptions(
ppd_mark_choices(ppd, attr->value);
}
}
else if (!strcasecmp(optptr->name, "print-quality"))
{
ppd_option_t *output_mode = ppdFindOption(ppd, "OutputMode");
/* OutputMode option */
if (!strcmp(optptr->value, "3"))
{
/*
* Draft quality...
*/
if (ppdFindChoice(output_mode, "Draft"))
ppd_mark_option(ppd, "OutputMode", "Draft");
else if (ppdFindChoice(output_mode, "Fast"))
ppd_mark_option(ppd, "OutputMode", "Fast");
if ((attr = ppdFindAttr(ppd, "APPrinterPreset",
"DraftGray_with_Paper_Auto-Detect")) != NULL)
ppd_mark_choices(ppd, attr->value);
}
else if (!strcmp(optptr->value, "4"))
{
/*
* Normal quality...
*/
if (ppdFindChoice(output_mode, "Normal"))
ppd_mark_option(ppd, "OutputMode", "Normal");
else if (ppdFindChoice(output_mode, "Good"))
ppd_mark_option(ppd, "OutputMode", "Good");
if ((attr = ppdFindAttr(ppd, "APPrinterPreset",
"Color_with_Paper_Auto-Detect")) != NULL)
ppd_mark_choices(ppd, attr->value);
else if ((attr = ppdFindAttr(ppd, "APPrinterPreset",
"Gray_with_Paper_Auto-Detect")) != NULL)
ppd_mark_choices(ppd, attr->value);
}
else if (!strcmp(optptr->value, "5"))
{
/*
* High/best/photo quality...
*/
if (ppdFindChoice(output_mode, "Best"))
ppd_mark_option(ppd, "OutputMode", "Best");
else if (ppdFindChoice(output_mode, "High"))
ppd_mark_option(ppd, "OutputMode", "High");
if ((attr = ppdFindAttr(ppd, "APPrinterPreset",
"Photo_on_Photo_Paper")) != NULL)
ppd_mark_choices(ppd, attr->value);
}
}
else if (!strcasecmp(optptr->name, "APPrinterPreset"))
{
/*
+2 -16
Ver Arquivo
@@ -3,7 +3,7 @@
*
* PPD file routines for CUPS.
*
* Copyright 2007-2010 by Apple Inc.
* Copyright 2007-2011 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
@@ -41,7 +41,6 @@
* ppd_compare_attrs() - Compare two attributes.
* ppd_compare_choices() - Compare two choices...
* ppd_compare_coptions() - Compare two custom options.
* ppd_compare_cparams() - Compare two custom parameters.
* ppd_compare_options() - Compare two options.
* ppd_decode() - Decode a string value...
* ppd_free_group() - Free a single UI group.
@@ -112,7 +111,6 @@ static int ppd_compare_attrs(ppd_attr_t *a, ppd_attr_t *b);
static int ppd_compare_choices(ppd_choice_t *a, ppd_choice_t *b);
static int ppd_compare_coptions(ppd_coption_t *a,
ppd_coption_t *b);
static int ppd_compare_cparams(ppd_cparam_t *a, ppd_cparam_t *b);
static int ppd_compare_options(ppd_option_t *a, ppd_option_t *b);
static int ppd_decode(char *string);
static void ppd_free_group(ppd_group_t *group);
@@ -2312,18 +2310,6 @@ ppd_compare_coptions(ppd_coption_t *a, /* I - First option */
}
/*
* 'ppd_compare_cparams()' - Compare two custom parameters.
*/
static int /* O - Result of comparison */
ppd_compare_cparams(ppd_cparam_t *a, /* I - First parameter */
ppd_cparam_t *b) /* I - Second parameter */
{
return (strcasecmp(a->name, b->name));
}
/*
* 'ppd_compare_options()' - Compare two options.
*/
@@ -2479,7 +2465,7 @@ ppd_get_coption(ppd_file_t *ppd, /* I - PPD file */
strlcpy(copt->keyword, name, sizeof(copt->keyword));
copt->params = cupsArrayNew((cups_array_func_t)ppd_compare_cparams, NULL);
copt->params = cupsArrayNew((cups_array_func_t)NULL, NULL);
cupsArrayAdd(ppd->coptions, copt);
+54 -49
Ver Arquivo
@@ -3,7 +3,7 @@
*
* PWG PPD mapping API implementation for CUPS.
*
* Copyright 2010 by Apple Inc.
* Copyright 2010-2011 by Apple Inc.
*
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
@@ -156,7 +156,7 @@ _pwgCreateWithPPD(ppd_file_t *ppd) /* I - PPD file */
if (!strcasecmp(ppd_size->name, "Custom"))
continue;
/*
* Convert the PPD size name to the corresponding PWG keyword name.
*/
@@ -225,12 +225,12 @@ _pwgCreateWithPPD(ppd_file_t *ppd) /* I - PPD file */
old_size->right == 0 && old_size->top == 0;
old_known_pwg = strncmp(old_size->map.pwg, "oe_", 3) &&
strncmp(old_size->map.pwg, "om_", 3);
similar = old_borderless == new_borderless &&
_PWG_EQUIVALENT(old_size->width, new_width) &&
_PWG_EQUIVALENT(old_size->length, new_length);
if (similar &&
if (similar &&
(new_known_pwg || (!old_known_pwg && new_imageable > old_imageable)))
{
/*
@@ -254,7 +254,7 @@ _pwgCreateWithPPD(ppd_file_t *ppd) /* I - PPD file */
new_size = pwg_size ++;
pwg->num_sizes ++;
}
}
if (new_size)
{
@@ -513,7 +513,7 @@ _pwgCreateWithPPD(ppd_file_t *ppd) /* I - PPD file */
if (pwg_print_quality != _PWG_PRINT_QUALITY_HIGH && paper_coating &&
strcmp(paper_coating, "none") &&
strcmp(paper_coating, "autodetect"))
strcmp(paper_coating, "autodetect"))
continue;
/*
@@ -896,7 +896,7 @@ const char * /* O - PPD PageSize or NULL */
_pwgGetPageSize(_pwg_t *pwg, /* I - PWG mapping data */
ipp_t *job, /* I - Job attributes or NULL */
const char *keyword, /* I - Keyword string or NULL */
int *exact) /* I - 1 if exact match, 0 otherwise */
int *exact) /* O - 1 if exact match, 0 otherwise */
{
int i; /* Looping var */
_pwg_size_t *size, /* Current size */
@@ -967,14 +967,15 @@ _pwgGetPageSize(_pwg_t *pwg, /* I - PWG mapping data */
DEBUG_printf(("2_pwgGetPageSize: size[%d]=[\"%s\" \"%s\"]",
(int)(size - pwg->sizes), size->map.pwg, size->map.ppd));
if (!strcasecmp(ppd_name, size->map.ppd))
if (!strcasecmp(ppd_name, size->map.ppd) ||
!strcasecmp(ppd_name, size->map.pwg))
{
if (exact)
*exact = 1;
DEBUG_printf(("1_pwgGetPageSize: Returning \"%s\"", ppd_name));
return (ppd_name);
return (size->map.ppd);
}
}
}
@@ -1016,55 +1017,59 @@ _pwgGetPageSize(_pwg_t *pwg, /* I - PWG mapping data */
closest = NULL;
dclosest = 999999999;
for (i = pwg->num_sizes, size = pwg->sizes; i > 0; i --, size ++)
if (!ppd_name || strncasecmp(ppd_name, "Custom.", 7) ||
strncasecmp(ppd_name, "custom_", 7))
{
/*
* Adobe uses a size matching algorithm with an epsilon of 5 points, which
* is just about 176/2540ths...
*/
dwidth = size->width - jobsize.width;
dlength = size->length - jobsize.length;
if (dwidth <= -176 || dwidth >= 176 || dlength <= -176 || dlength >= 176)
continue;
if (margins_set)
for (i = pwg->num_sizes, size = pwg->sizes; i > 0; i --, size ++)
{
/*
* Use a tighter epsilon of 1 point (35/2540ths) for margins...
* Adobe uses a size matching algorithm with an epsilon of 5 points, which
* is just about 176/2540ths...
*/
dleft = size->left - jobsize.left;
dright = size->right - jobsize.right;
dtop = size->top - jobsize.top;
dbottom = size->bottom - jobsize.bottom;
if (dleft <= -35 || dleft >= 35 || dright <= -35 || dright >= 35 ||
dtop <= -35 || dtop >= 35 || dbottom <= -35 || dbottom >= 35)
{
dleft = dleft < 0 ? -dleft : dleft;
dright = dright < 0 ? -dright : dright;
dbottom = dbottom < 0 ? -dbottom : dbottom;
dtop = dtop < 0 ? -dtop : dtop;
dmin = dleft + dright + dbottom + dtop;
if (dmin < dclosest)
{
dclosest = dmin;
closest = size;
}
dwidth = size->width - jobsize.width;
dlength = size->length - jobsize.length;
if (dwidth <= -176 || dwidth >= 176 || dlength <= -176 || dlength >= 176)
continue;
if (margins_set)
{
/*
* Use a tighter epsilon of 1 point (35/2540ths) for margins...
*/
dleft = size->left - jobsize.left;
dright = size->right - jobsize.right;
dtop = size->top - jobsize.top;
dbottom = size->bottom - jobsize.bottom;
if (dleft <= -35 || dleft >= 35 || dright <= -35 || dright >= 35 ||
dtop <= -35 || dtop >= 35 || dbottom <= -35 || dbottom >= 35)
{
dleft = dleft < 0 ? -dleft : dleft;
dright = dright < 0 ? -dright : dright;
dbottom = dbottom < 0 ? -dbottom : dbottom;
dtop = dtop < 0 ? -dtop : dtop;
dmin = dleft + dright + dbottom + dtop;
if (dmin < dclosest)
{
dclosest = dmin;
closest = size;
}
continue;
}
}
if (exact)
*exact = 1;
DEBUG_printf(("1_pwgGetPageSize: Returning \"%s\"", size->map.ppd));
return (size->map.ppd);
}
if (exact)
*exact = 1;
DEBUG_printf(("1_pwgGetPageSize: Returning \"%s\"", size->map.ppd));
return (size->map.ppd);
}
if (closest)
+46 -18
Ver Arquivo
@@ -1,9 +1,9 @@
/*
* "$Id$"
*
* IPP utilities for the Common UNIX Printing System (CUPS).
* IPP utilities for CUPS.
*
* Copyright 2007-2010 by Apple Inc.
* Copyright 2007-2011 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
@@ -153,7 +153,11 @@ cupsDoIORequest(http_t *http, /* I - Connection to server or @code CUPS_HTTP
if (!http)
if ((http = _cupsConnect()) == NULL)
{
ippDelete(request);
return (NULL);
}
/*
* See if we have a file to send...
@@ -245,7 +249,9 @@ cupsDoIORequest(http_t *http, /* I - Connection to server or @code CUPS_HTTP
{
if (httpCheck(http))
{
if ((status = httpUpdate(http)) != HTTP_CONTINUE)
_httpUpdate(http, &status);
if (status >= HTTP_MULTIPLE_CHOICES)
break;
}
@@ -385,9 +391,11 @@ cupsGetResponse(http_t *http, /* I - Connection to server or @code CUPS_HTTP
DEBUG_printf(("2cupsGetResponse: Update loop, http->status=%d...",
http->status));
status = http->status;
while (status == HTTP_CONTINUE)
do
{
status = httpUpdate(http);
}
while (http->state == HTTP_POST_RECV);
DEBUG_printf(("2cupsGetResponse: status=%d", status));
@@ -614,10 +622,25 @@ cupsSendRequest(http_t *http, /* I - Connection to server or @code CUPS_HTTP
*/
httpClearFields(http);
httpSetLength(http, length);
httpSetField(http, HTTP_FIELD_CONTENT_TYPE, "application/ipp");
httpSetField(http, HTTP_FIELD_AUTHORIZATION, http->authstring);
httpSetExpect(http, expect);
httpSetField(http, HTTP_FIELD_CONTENT_TYPE, "application/ipp");
httpSetLength(http, length);
#ifdef HAVE_GSSAPI
if (http->authstring && !strncmp(http->authstring, "Negotiate", 9))
{
/*
* Do not use cached Kerberos credentials since they will look like a
* "replay" attack...
*/
httpSetField(http, HTTP_FIELD_WWW_AUTHENTICATE, "Negotiate");
cupsDoAuthentication(http, "POST", resource);
httpSetField(http, HTTP_FIELD_WWW_AUTHENTICATE, "");
}
#endif /* HAVE_GSSAPI */
httpSetField(http, HTTP_FIELD_AUTHORIZATION, http->authstring);
DEBUG_printf(("2cupsSendRequest: authstring=\"%s\"", http->authstring));
@@ -655,7 +678,8 @@ cupsSendRequest(http_t *http, /* I - Connection to server or @code CUPS_HTTP
{
got_status = 1;
if ((status = httpUpdate(http)) != HTTP_CONTINUE)
_httpUpdate(http, &status);
if (status >= HTTP_MULTIPLE_CHOICES)
break;
}
@@ -663,15 +687,18 @@ cupsSendRequest(http_t *http, /* I - Connection to server or @code CUPS_HTTP
* Wait up to 1 second to get the 100-continue response as needed...
*/
if (!got_status && expect == HTTP_CONTINUE)
if (!got_status)
{
DEBUG_puts("2cupsSendRequest: Waiting for 100-continue...");
if (expect == HTTP_CONTINUE)
{
DEBUG_puts("2cupsSendRequest: Waiting for 100-continue...");
if (httpWait(http, 1000))
status = httpUpdate(http);
if (httpWait(http, 1000))
_httpUpdate(http, &status);
}
else if (httpCheck(http))
_httpUpdate(http, &status);
}
else if (httpCheck(http))
status = httpUpdate(http);
DEBUG_printf(("2cupsSendRequest: status=%d", status));
@@ -679,7 +706,7 @@ cupsSendRequest(http_t *http, /* I - Connection to server or @code CUPS_HTTP
* Process the current HTTP status...
*/
if (status >= HTTP_BAD_REQUEST)
if (status >= HTTP_MULTIPLE_CHOICES)
httpFlush(http);
switch (status)
@@ -806,9 +833,10 @@ cupsWriteRequestData(
if (_httpWait(http, 0, 1))
{
http_status_t status; /* Status from httpUpdate */
http_status_t status; /* Status from _httpUpdate */
if ((status = httpUpdate(http)) >= HTTP_BAD_REQUEST)
_httpUpdate(http, &status);
if (status >= HTTP_MULTIPLE_CHOICES)
httpFlush(http);
return (status);
+33 -5
Ver Arquivo
@@ -1,9 +1,9 @@
/*
* "$Id$"
*
* PPD test program for the Common UNIX Printing System (CUPS).
* PPD test program for CUPS.
*
* Copyright 2007-2010 by Apple Inc.
* Copyright 2007-2011 by Apple Inc.
* Copyright 1997-2006 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
@@ -445,6 +445,21 @@ main(int argc, /* I - Number of command-line arguments */
else
puts("PASS");
fputs("cupsMarkOptions(media=oe_letter-fullbleed_8.5x11in): ", stdout);
num_options = cupsAddOption("media", "oe_letter-fullbleed_8.5x11in", 0,
&options);
cupsMarkOptions(ppd, num_options, options);
cupsFreeOptions(num_options, options);
size = ppdPageSize(ppd, NULL);
if (!size || strcmp(size->name, "Letter.Fullbleed"))
{
printf("FAIL (%s)\n", size ? size->name : "unknown");
status ++;
}
else
puts("PASS");
fputs("cupsMarkOptions(media=A4): ", stdout);
num_options = cupsAddOption("media", "A4", 0, &options);
cupsMarkOptions(ppd, num_options, options);
@@ -714,7 +729,7 @@ main(int argc, /* I - Number of command-line arguments */
}
else
puts("FAIL (No conflicts!)");
fputs("ppdInstallableConflict(): ", stdout);
if (ppdInstallableConflict(ppd, "Duplex", "DuplexNoTumble") &&
!ppdInstallableConflict(ppd, "Duplex", "None"))
@@ -830,10 +845,23 @@ main(int argc, /* I - Number of command-line arguments */
if (!strncmp(argv[1], "-d", 2))
{
filename = cupsGetPPD(argv[1] + 2);
const char *printer; /* Printer name */
if (argv[1][2])
printer = argv[1] + 2;
else if (argv[2])
printer = argv[2];
else
{
puts("Usage: ./testppd -d printer");
return (1);
}
filename = cupsGetPPD(printer);
if (!filename)
{
printf("%s: %s\n", argv[1], cupsLastErrorString());
printf("%s: %s\n", printer, cupsLastErrorString());
return (1);
}
}
+8 -7
Ver Arquivo
@@ -1,9 +1,9 @@
/*
* "$Id$"
*
* Transcoding support for the Common UNIX Printing System (CUPS).
* Transcoding support for CUPS.
*
* Copyright 2007-2009 by Apple Inc.
* Copyright 2007-2011 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
@@ -279,7 +279,7 @@ cupsCharsetToUTF8(
* Handle identity conversions...
*/
if (encoding == CUPS_UTF8 ||
if (encoding == CUPS_UTF8 || encoding <= CUPS_US_ASCII ||
encoding < 0 || encoding >= CUPS_ENCODING_VBCS_END)
{
strlcpy((char *)dest, src, maxout);
@@ -385,13 +385,14 @@ cupsUTF8ToCharset(
* Handle UTF-8 to ISO-8859-1 directly...
*/
if (encoding == CUPS_ISO8859_1)
if (encoding == CUPS_ISO8859_1 || encoding == CUPS_US_ASCII)
{
int ch; /* Character from string */
int ch, /* Character from string */
maxch; /* Maximum character for charset */
char *destptr, /* Pointer into ISO-8859-1 buffer */
*destend; /* End of ISO-8859-1 buffer */
maxch = encoding == CUPS_ISO8859_1 ? 256 : 128;
destptr = dest;
destend = dest + maxout - 1;
@@ -403,7 +404,7 @@ cupsUTF8ToCharset(
{
ch = ((ch & 0x1f) << 6) | (*src++ & 0x3f);
if (ch < 256)
if (ch < maxch)
*destptr++ = ch;
else
*destptr++ = '?';
+4 -2
Ver Arquivo
@@ -1,9 +1,9 @@
#
# "$Id$"
#
# Documentation makefile for the Common UNIX Printing System (CUPS).
# Documentation makefile for CUPS.
#
# Copyright 2007-2009 by Apple Inc.
# Copyright 2007-2011 by Apple Inc.
# Copyright 1997-2007 by Easy Software Products.
#
# These coded instructions, statements, and computer programs are the
@@ -40,6 +40,8 @@ HELPIMAGES = \
images/cups-postscript-chain.png \
images/cups-raster-chain.png \
images/raster.png \
images/raster-organization.png \
images/sample-image.png \
images/smiley.jpg
HELPFILES = \
help/accounting.html \
+2
Ver Arquivo
@@ -114,7 +114,9 @@ TD.unsel {
TD.sel A, TD.sel A:hover, TD.unsel A:link:hover, TD.unsel A:visited:hover,
TD.unsel A:active, TD.unsel A, TD.unsel A:visited {
color: #666666;
display: block;
font-weight: normal;
padding: 8px;
text-decoration: none;
}
+1 -1
Ver Arquivo
@@ -101,7 +101,7 @@ HEIGHT="128" ALT="CUPS"></A></TD>
<TR><TD>&nbsp;</TD></TR>
<TR><TD CLASS="trailer">CUPS und das CUPS Logo sind
eingetragene Warenzeichen der <A HREF="http://www.apple.com">Apple Inc.</A>
CUPS ist urheberrechtlich gesch&uuml;tzt 2007-2010 von Apple Inc, alle Rechte vorbehalten.</TD></TR>
CUPS ist urheberrechtlich gesch&uuml;tzt 2007-2011 von Apple Inc, alle Rechte vorbehalten.</TD></TR>
</TABLE>
</BODY>
</HTML>
+1 -1
Ver Arquivo
@@ -101,7 +101,7 @@ HEIGHT="128" ALT="CUPS"></A></TD>
<TR><TD>&nbsp;</TD></TR>
<TR><TD CLASS="trailer">CUPS y el logo de CUPS son
marcas registradas de <A HREF="http://www.apple.com">Apple Inc.</A> Los derechos
de copia de CUPS 2007-2010 son de Apple Inc. Todos los derechos reservados.</TD></TR>
de copia de CUPS 2007-2011 son de Apple Inc. Todos los derechos reservados.</TD></TR>
</TABLE>
</BODY>
</HTML>
+2 -2
Ver Arquivo
@@ -99,8 +99,8 @@ HEIGHT="128" ALT="CUPS"></A></TD>
</TD></TR>
<TR><TD>&nbsp;</TD></TR>
<TR><TD CLASS="trailer">CUPS eta CUPSen logotipoa <A HREF="http://www.apple.com">Apple Inc.</A>en marka erregistratuaj dira.
CUPSen copyright-a 2007-2010 Apple Inc. Eskubide guztiak gordeta.</TD></TR>
<TR><TD CLASS="trailer">CUPS eta CUPSen logotipoa <A HREF="http://www.apple.com">Apple Inc.</A> en marka erregistratuak dira.
CUPSen copyright-a 2007-2011 Apple Inc. Eskubide guztiak gordeta.</TD></TR>
</TABLE>
</BODY>
</HTML>
+3 -3
Ver Arquivo
@@ -18,15 +18,15 @@ support, there are several third-party solutions that can be found on
<P>CUPS supports page and size-based quotas for each printer.
The quotas are tracked individually for each user, but a single set of
limits applies to all users for a partiuclar printer. For example, you
limits applies to all users for a particular printer. For example, you
can limit every user to 5 pages per day on an expensive printer, but
you cannot limit every user except Johnny.</P>
<P>The <CODE>job-k-limit</CODE>, <CODE>job-page-limit</CODE>, and <CODE>job-quota-peiod</CODE>
<P>The <CODE>job-k-limit</CODE>, <CODE>job-page-limit</CODE>, and <CODE>job-quota-period</CODE>
options determine whether and how quotas are enforced for a printer.
The <CODE>job-quota-period</CODE> option determines the time interval for
quota tracking. The interval is expressed in seconds, so a day is
86,400, a week is 604,800 and a month is 2,592,000 seconds. The
86,400, a week is 604,800, and a month is 2,592,000 seconds. The
<CODE>job-k-limit</CODE> option specifies the job size limit in killobytes. The
<CODE>job-page-limit</CODE> option specifies the number of pages limit.</P>
+5 -5
Ver Arquivo
@@ -4,7 +4,7 @@
<head>
<title>Array API</title>
<meta name="keywords" content="Programming">
<meta name="creator" content="Mini-XML v2.6">
<meta name="creator" content="Mini-XML v2.7">
<style type="text/css"><!--
BODY {
font-family: lucida grande, geneva, helvetica, arial, sans-serif;
@@ -338,7 +338,7 @@ div.contents ul.subcontents li {
<body>
<div class='body'>
<!--
"$Id: api-array.html 8653 2009-05-16 23:53:28Z mike $"
"$Id: api-array.html 9728 2011-04-28 21:21:24Z mike $"
Array API header for the Common UNIX Printing System (CUPS).
@@ -407,11 +407,11 @@ div.contents ul.subcontents li {
<li><a href="#cups_array_t" title="CUPS array type">cups_array_t</a></li>
</ul></li>
<!--
"$Id: api-array.html 8653 2009-05-16 23:53:28Z mike $"
"$Id: api-array.html 9728 2011-04-28 21:21:24Z mike $"
Array API introduction for the Common UNIX Printing System (CUPS).
Array API introduction for CUPS.
Copyright 2007-2008 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
+3 -3
Ver Arquivo
@@ -4,7 +4,7 @@
<head>
<title>CGI API</title>
<meta name="keywords" content="Programming">
<meta name="creator" content="Mini-XML v2.6">
<meta name="creator" content="Mini-XML v2.7">
<style type="text/css"><!--
BODY {
font-family: lucida grande, geneva, helvetica, arial, sans-serif;
@@ -338,7 +338,7 @@ div.contents ul.subcontents li {
<body>
<div class='body'>
<!--
"$Id: api-cgi.html 9121 2010-04-23 18:57:00Z mike $"
"$Id: api-cgi.html 9728 2011-04-28 21:21:24Z mike $"
CGI API header for CUPS.
@@ -434,7 +434,7 @@ by the template file.">cgiGetAttributes</a></li>
<li><a href="#help_word_s" title="Help word structure...">help_word_s</a></li>
</ul></li>
<!--
"$Id: api-cgi.html 9121 2010-04-23 18:57:00Z mike $"
"$Id: api-cgi.html 9728 2011-04-28 21:21:24Z mike $"
CGI API introduction for CUPS.
+6 -6
Ver Arquivo
@@ -4,7 +4,7 @@
<head>
<title>CUPS API</title>
<meta name="keywords" content="Programming">
<meta name="creator" content="Mini-XML v2.6">
<meta name="creator" content="Mini-XML v2.7">
<style type="text/css"><!--
BODY {
font-family: lucida grande, geneva, helvetica, arial, sans-serif;
@@ -338,7 +338,7 @@ div.contents ul.subcontents li {
<body>
<div class='body'>
<!--
"$Id: api-cups.html 9121 2010-04-23 18:57:00Z mike $"
"$Id: api-cups.html 9728 2011-04-28 21:21:24Z mike $"
CUPS API header for the Common UNIX Printing System (CUPS).
@@ -475,11 +475,11 @@ specified server.">cupsPrintFiles2</a></li>
<li><a href="#cups_ptype_e" title="Printer type/capability bit constants">cups_ptype_e</a></li>
</ul></li>
<!--
"$Id: api-cups.html 9121 2010-04-23 18:57:00Z mike $"
"$Id: api-cups.html 9728 2011-04-28 21:21:24Z mike $"
CUPS API introduction for the Common UNIX Printing System (CUPS).
API introduction for CUPS.
Copyright 2007-2010 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
@@ -526,7 +526,7 @@ specific destination for printing:</p>
int num_dests = <a href='#cupsGetDests'>cupsGetDests</a>(&amp;dests);
<a href='#cups_dest_t'>cups_dest_t</a> *dest = <a href='#cupsGetDest'>cupsGetDest</a>("name", NULL, num_dests, dests);
/* do something wiith dest */
/* do something with dest */
<a href='#cupsFreeDests'>cupsFreeDests</a>(num_dests, dests);
</pre>
+3 -3
Ver Arquivo
@@ -4,7 +4,7 @@
<head>
<title>Printer Driver API</title>
<meta name="keywords" content="Programming">
<meta name="creator" content="Mini-XML v2.6">
<meta name="creator" content="Mini-XML v2.7">
<style type="text/css"><!--
BODY {
font-family: lucida grande, geneva, helvetica, arial, sans-serif;
@@ -338,7 +338,7 @@ div.contents ul.subcontents li {
<body>
<div class='body'>
<!--
"$Id: api-driver.html 8653 2009-05-16 23:53:28Z mike $"
"$Id: api-driver.html 9728 2011-04-28 21:21:24Z mike $"
Driver API header for CUPS.
@@ -427,7 +427,7 @@ media, and resolution.">cupsFindAttr</a></li>
<li><a href="#cups_srgb_lut[256]" title="sRGB gamma lookup table">cups_srgb_lut[256]</a></li>
</ul></li>
<!--
"$Id: api-driver.html 8653 2009-05-16 23:53:28Z mike $"
"$Id: api-driver.html 9728 2011-04-28 21:21:24Z mike $"
Driver API introduction for CUPS.
+5 -5
Ver Arquivo
@@ -4,7 +4,7 @@
<head>
<title>File and Directory APIs</title>
<meta name="keywords" content="Programming">
<meta name="creator" content="Mini-XML v2.6">
<meta name="creator" content="Mini-XML v2.7">
<style type="text/css"><!--
BODY {
font-family: lucida grande, geneva, helvetica, arial, sans-serif;
@@ -338,7 +338,7 @@ div.contents ul.subcontents li {
<body>
<div class='body'>
<!--
"$Id: api-filedir.html 8653 2009-05-16 23:53:28Z mike $"
"$Id: api-filedir.html 9728 2011-04-28 21:21:24Z mike $"
File and Directory API header for the Common UNIX Printing System (CUPS).
@@ -421,11 +421,11 @@ file.">cupsFileRewind</a></li>
<li><a href="#cups_dentry_s" title="Directory entry type">cups_dentry_s</a></li>
</ul></li>
<!--
"$Id: api-filedir.html 8653 2009-05-16 23:53:28Z mike $"
"$Id: api-filedir.html 9728 2011-04-28 21:21:24Z mike $"
File and directory API introduction for the Common UNIX Printing System (CUPS).
File and directory API introduction for CUPS.
Copyright 2007-2008 by Apple Inc.
Copyright 2007-2011 by Apple Inc.
Copyright 1997-2005 by Easy Software Products, all rights reserved.
These coded instructions, statements, and computer programs are the
+4 -4
Ver Arquivo
@@ -4,7 +4,7 @@
<head>
<title>Filter and Backend Programming</title>
<meta name="keywords" content="Programming">
<meta name="creator" content="Mini-XML v2.6">
<meta name="creator" content="Mini-XML v2.7">
<style type="text/css"><!--
BODY {
font-family: lucida grande, geneva, helvetica, arial, sans-serif;
@@ -338,7 +338,7 @@ div.contents ul.subcontents li {
<body>
<div class='body'>
<!--
"$Id: api-filter.html 9283 2010-08-31 18:07:49Z mike $"
"$Id: api-filter.html 9728 2011-04-28 21:21:24Z mike $"
Filter and backend programming header for the Common UNIX Printing System
(CUPS).
@@ -421,7 +421,7 @@ div.contents ul.subcontents li {
<li><a href="#cups_sc_status_e" title="Response status codes">cups_sc_status_e</a></li>
</ul></li>
<!--
"$Id: api-filter.html 9283 2010-08-31 18:07:49Z mike $"
"$Id: api-filter.html 9728 2011-04-28 21:21:24Z mike $"
Filter and backend programming introduction for the Common UNIX Printing
System (CUPS).
@@ -480,7 +480,7 @@ more detail.</p>
<h3><a name="SECURITY">Security Considerations</a></h3>
<p>It is always important to use security programming practices. Filters and
most backends are run as a non-priviledged user, so the major security
most backends are run as a non-privileged user, so the major security
consideration is resource utilization - filters should not depend on unlimited
amounts of CPU, memory, or disk space, and should protect against conditions
that could lead to excess usage of any resource like infinite loops and
+5 -5
Ver Arquivo
@@ -4,7 +4,7 @@
<head>
<title>HTTP and IPP APIs</title>
<meta name="keywords" content="Programming">
<meta name="creator" content="Mini-XML v2.6">
<meta name="creator" content="Mini-XML v2.7">
<style type="text/css"><!--
BODY {
font-family: lucida grande, geneva, helvetica, arial, sans-serif;
@@ -338,7 +338,7 @@ div.contents ul.subcontents li {
<body>
<div class='body'>
<!--
"$Id: api-httpipp.html 9283 2010-08-31 18:07:49Z mike $"
"$Id: api-httpipp.html 9728 2011-04-28 21:21:24Z mike $"
HTTP and IPP API header for the Common UNIX Printing System (CUPS).
@@ -588,11 +588,11 @@ are server-oriented...">http_state_e</a></li>
<li><a href="#ipp_tag_e" title="Format tags for attributes">ipp_tag_e</a></li>
</ul></li>
<!--
"$Id: api-httpipp.html 9283 2010-08-31 18:07:49Z mike $"
"$Id: api-httpipp.html 9728 2011-04-28 21:21:24Z mike $"
HTTP and IPP API introduction for the Common UNIX Printing System (CUPS).
HTTP and IPP API introduction for CUPS.
Copyright 2007-2008 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
+3 -3
Ver Arquivo
@@ -4,7 +4,7 @@
<head>
<title>MIME API</title>
<meta name="keywords" content="Programming">
<meta name="creator" content="Mini-XML v2.6">
<meta name="creator" content="Mini-XML v2.7">
<style type="text/css"><!--
BODY {
font-family: lucida grande, geneva, helvetica, arial, sans-serif;
@@ -338,7 +338,7 @@ div.contents ul.subcontents li {
<body>
<div class='body'>
<!--
"$Id: api-mime.html 8653 2009-05-16 23:53:28Z mike $"
"$Id: api-mime.html 9728 2011-04-28 21:21:24Z mike $"
MIME API header for CUPS.
@@ -404,7 +404,7 @@ div.contents ul.subcontents li {
<li><a href="#mime_type_t" title="MIME Type Data">mime_type_t</a></li>
</ul></li>
<!--
"$Id: api-mime.html 8653 2009-05-16 23:53:28Z mike $"
"$Id: api-mime.html 9728 2011-04-28 21:21:24Z mike $"
MIME API introduction for CUPS.
+5 -6
Ver Arquivo
@@ -4,7 +4,7 @@
<head>
<title>Introduction to CUPS Programming</title>
<meta name="keywords" content="Programming">
<meta name="creator" content="Mini-XML v2.6">
<meta name="creator" content="Mini-XML v2.7">
<style type="text/css"><!--
BODY {
font-family: lucida grande, geneva, helvetica, arial, sans-serif;
@@ -338,7 +338,7 @@ div.contents ul.subcontents li {
<body>
<div class='body'>
<!--
"$Id: api-overview.html 8653 2009-05-16 23:53:28Z mike $"
"$Id: api-overview.html 9728 2011-04-28 21:21:24Z mike $"
Introduction to CUPS programming header for the Common UNIX Printing System
(CUPS).
@@ -401,12 +401,11 @@ div.contents ul.subcontents li {
</ul></li>
<li><a href="#WHERETOGO">Where to Go Next</a></li>
<!--
"$Id: api-overview.html 8653 2009-05-16 23:53:28Z mike $"
"$Id: api-overview.html 9728 2011-04-28 21:21:24Z mike $"
Introduction to CUPS programming content for the Common UNIX Printing System
(CUPS).
Introduction to CUPS programming content for CUPS.
Copyright 2008 by Apple Inc.
Copyright 2008-2011 by Apple Inc.
These coded instructions, statements, and computer programs are the
property of Apple Inc. and are protected by Federal copyright
+5 -5
Ver Arquivo
@@ -4,7 +4,7 @@
<head>
<title>PPD API</title>
<meta name="keywords" content="Programming">
<meta name="creator" content="Mini-XML v2.6">
<meta name="creator" content="Mini-XML v2.7">
<style type="text/css"><!--
BODY {
font-family: lucida grande, geneva, helvetica, arial, sans-serif;
@@ -338,7 +338,7 @@ div.contents ul.subcontents li {
<body>
<div class='body'>
<!--
"$Id: api-ppd.html 9121 2010-04-23 18:57:00Z mike $"
"$Id: api-ppd.html 9728 2011-04-28 21:21:24Z mike $"
PPD API header for the Common UNIX Printing System (CUPS).
@@ -482,11 +482,11 @@ conflicts.">ppdMarkOption</a></li>
<li><a href="#ppd_ui_e" title="UI Types">ppd_ui_e</a></li>
</ul></li>
<!--
"$Id: api-ppd.html 9121 2010-04-23 18:57:00Z mike $"
"$Id: api-ppd.html 9728 2011-04-28 21:21:24Z mike $"
PPD API introduction for the Common UNIX Printing System (CUPS).
PPD API introduction for CUPS.
Copyright 2007-2008 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
+3 -3
Ver Arquivo
@@ -4,7 +4,7 @@
<head>
<title>PPD Compiler API</title>
<meta name="keywords" content="Programming">
<meta name="creator" content="Mini-XML v2.6">
<meta name="creator" content="Mini-XML v2.7">
<style type="text/css"><!--
BODY {
font-family: lucida grande, geneva, helvetica, arial, sans-serif;
@@ -338,7 +338,7 @@ div.contents ul.subcontents li {
<body>
<div class='body'>
<!--
"$Id: api-ppdc.html 8704 2009-06-10 15:51:21Z mike $"
"$Id: api-ppdc.html 9728 2011-04-28 21:21:24Z mike $"
PPD Compiler API header for CUPS.
@@ -411,7 +411,7 @@ div.contents ul.subcontents li {
<li><a href="#ppdcOptType" title="// Option type">ppdcOptType</a></li>
</ul></li>
<!--
"$Id: api-ppdc.html 8704 2009-06-10 15:51:21Z mike $"
"$Id: api-ppdc.html 9728 2011-04-28 21:21:24Z mike $"
PPD Compiler API introduction for CUPS.
+12 -10
Ver Arquivo
@@ -4,7 +4,7 @@
<head>
<title>Raster API</title>
<meta name="keywords" content="Programming">
<meta name="creator" content="Mini-XML v2.6">
<meta name="creator" content="Mini-XML v2.7">
<style type="text/css"><!--
BODY {
font-family: lucida grande, geneva, helvetica, arial, sans-serif;
@@ -338,7 +338,7 @@ div.contents ul.subcontents li {
<body>
<div class='body'>
<!--
"$Id: api-raster.html 9283 2010-08-31 18:07:49Z mike $"
"$Id: api-raster.html 9728 2011-04-28 21:21:24Z mike $"
Raster API header for the Common UNIX Printing System (CUPS).
@@ -386,7 +386,7 @@ div.contents ul.subcontents li {
<li><a href="#FUNCTIONS">Functions</a><ul class="code">
<li><a href="#cupsRasterClose" title="Close a raster stream.">cupsRasterClose</a></li>
<li><a href="#cupsRasterInterpretPPD" title="Interpret PPD commands to create a page header.">cupsRasterInterpretPPD</a></li>
<li><a href="#cupsRasterOpen" title="Open a raster stream.">cupsRasterOpen</a></li>
<li><a href="#cupsRasterOpen" title="Open a raster stream using a file descriptor.">cupsRasterOpen</a></li>
<li><a href="#cupsRasterReadHeader" title="Read a raster page header and store it in a
version 1 page header structure.">cupsRasterReadHeader</a></li>
<li><a href="#cupsRasterReadHeader2" title="Read a raster page header and store it in a
@@ -429,11 +429,11 @@ page header structure.">cupsRasterWriteHeader2</a></li>
<li><a href="#cups_orient_e" title="Orientation attribute values">cups_orient_e</a></li>
</ul></li>
<!--
"$Id: api-raster.html 9283 2010-08-31 18:07:49Z mike $"
"$Id: api-raster.html 9728 2011-04-28 21:21:24Z mike $"
Raster API introduction for the Common UNIX Printing System (CUPS).
Raster API introduction for CUPS.
Copyright 2007-2008 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
@@ -655,7 +655,7 @@ are supported.
</p>
<h3 class="function"><a name="cupsRasterOpen">cupsRasterOpen</a></h3>
<p class="description">Open a raster stream.</p>
<p class="description">Open a raster stream using a file descriptor.</p>
<p class="code">
<a href="#cups_raster_t">cups_raster_t</a> *cupsRasterOpen (<br>
&nbsp;&nbsp;&nbsp;&nbsp;int fd,<br>
@@ -666,7 +666,9 @@ are supported.
<dt>fd</dt>
<dd class="description">File descriptor</dd>
<dt>mode</dt>
<dd class="description">Mode - <code>CUPS_RASTER_READ</code>, <code>CUPS_RASTER_WRITE</code>, or <code>CUPS_RASTER_WRITE_COMPRESSED</code></dd>
<dd class="description">Mode - <code>CUPS_RASTER_READ</code>,
<code>CUPS_RASTER_WRITE</code>, or
<code>CUPS_RASTER_WRITE_COMPRESSED</code></dd>
</dl>
<h4 class="returnvalue">Return Value</h4>
<p class="description">New stream</p>
@@ -677,8 +679,8 @@ image processor (RIP) filters that generate raster data, &quot;fd&quot; will be
(stdout).<br>
<br>
When writing raster data, the <code>CUPS_RASTER_WRITE</code> or
<code>CUPS_RASTER_WRITE_COMPRESS</code> mode can be used - compressed output
is generally 25-50% smaller but adds a 100-300% execution time overhead.</p>
<code>CUPS_RASTER_WRITE_COMPRESS</code> mode can be used - compressed output is
generally 25-50% smaller but adds a 100-300% execution time overhead.</p>
<h3 class="function"><span class="info">&nbsp;DEPRECATED&nbsp;</span><a name="cupsRasterReadHeader">cupsRasterReadHeader</a></h3>
<p class="description">Read a raster page header and store it in a
version 1 page header structure.</p>
+2 -2
Ver Arquivo
@@ -53,7 +53,7 @@ systems and network.</P>
Kerberos on your system and setup a system as a KDC. Because this
configuration is highly system and site-specific, please consult
the following on-line resources provided by the creators of Kerberos
at the Massachussetts Institute of Technology (MIT):</P>
at the Massachusetts Institute of Technology (MIT):</P>
<UL>
@@ -113,7 +113,7 @@ converted to just "user" for purposes of user and group checks.</P>
<P>In order to support printing to a shared printer, CUPS has to ask the KDC
for a copy of your credentials (this is called delegation) that can be sent to
the remote server for authenticatation. Delegation only works when the system
the remote server for authentication. Delegation only works when the system
has a stable hostname which maps to the current address of the system, which
is why you need a static IP address or DHCP that updates the DNS entry for your
system.</P>
+2 -2
Ver Arquivo
@@ -93,9 +93,9 @@ page on the device.</P>
<PRE>
socket://<i>ip-address-or-hostname</i>
socket://<i>ip-address-or-hostname</i>?waiteof=false
socket://<i>ip-address-or-hostname</i>/?waiteof=false
socket://<i>ip-address-or-hostname</i>:<i>port-number</i>
socket://<i>ip-address-or-hostname</i>:<i>port-number</i>?waiteof=false
socket://<i>ip-address-or-hostname</i>:<i>port-number</i>/?waiteof=false
</PRE>
<P>The "waiteof" option controls whether the <tt>socket</tt> backend waits for the printer to complete the printing of the job. The default is to wait.</P>
+3 -3
Ver Arquivo
@@ -324,7 +324,7 @@ lpr -o sides=one-sided filename
<H3><A NAME="JOBSHEETS">Selecting the Banner Page(s)</A></H3>
<P>The <CODE>-o jobsheets=start,end</CODE> option sets the banner
<P>The <CODE>-o job-sheets=start,end</CODE> option sets the banner
page(s) to use for a job:</P>
<PRE CLASS="command">
@@ -416,7 +416,7 @@ assign a priority to your job from 1 (lowest) to 100 (highest),
which influences where the job appears in the print queue. Higher
priority jobs are printed before lower priority jobs, however
submitting a new job with a high priority will not interrupt an
</P>
already printing job.</P>
<H3><A NAME="OUTPUTORDER">Specifying the Output Order</A></H3>
@@ -548,7 +548,7 @@ for printers that print face up.
<H3><A NAME="MIRROR">Printing Mirrored Pages</A></H3>
<P>The <CODE>-o mirror</CODE> option flips each page along the
vertical access to produce a mirrored image:</P>
vertical axis to produce a mirrored image:</P>
<PRE CLASS="command">
lp -o mirror filename
+1 -1
Ver Arquivo
@@ -4,7 +4,7 @@
<head>
<title>Developing PostScript Printer Drivers</title>
<meta name="keywords" content="Programming">
<meta name="creator" content="Mini-XML v2.6">
<meta name="creator" content="Mini-XML v2.7">
<style type="text/css"><!--
BODY {
font-family: lucida grande, geneva, helvetica, arial, sans-serif;
+1 -1
Ver Arquivo
@@ -4,7 +4,7 @@
<head>
<title>Introduction to the PPD Compiler</title>
<meta name="keywords" content="Programming">
<meta name="creator" content="Mini-XML v2.6">
<meta name="creator" content="Mini-XML v2.7">
<style type="text/css"><!--
BODY {
font-family: lucida grande, geneva, helvetica, arial, sans-serif;
+1 -1
Ver Arquivo
@@ -4,7 +4,7 @@
<head>
<title>Developing Raster Printer Drivers</title>
<meta name="keywords" content="Programming">
<meta name="creator" content="Mini-XML v2.6">
<meta name="creator" content="Mini-XML v2.7">
<style type="text/css"><!--
BODY {
font-family: lucida grande, geneva, helvetica, arial, sans-serif;
+34 -34
Ver Arquivo
@@ -114,9 +114,9 @@ to the access log file. The following levels are defined:</P>
...
Allow from All
Allow from None
Allow from *.domain.com
Allow from .domain.com
Allow from host.domain.com
Allow from *.example.com
Allow from .example.com
Allow from host.example.com
Allow from nnn.*
Allow from nnn.nnn.*
Allow from nnn.nnn.nnn.*
@@ -134,7 +134,7 @@ to the access log file. The following levels are defined:</P>
<P>The <CODE>Allow</CODE> directive specifies a hostname, IP
address, or network that is allowed access to the server.
<CODE>Allow</CODE> directives are cummulative, so multiple
<CODE>Allow</CODE> directives are cumulative, so multiple
<CODE>Allow</CODE> directives can be used to allow access for
multiple hosts or networks.</P>
@@ -342,7 +342,7 @@ default setting is <CODE>No</CODE>.</P>
<PRE CLASS="command">
BrowseAddress 255.255.255.255:631
BrowseAddress 192.0.2.255:631
BrowseAddress host.domain.com:631
BrowseAddress host.example.com:631
BrowseAddress @LOCAL
BrowseAddress @IF(name)
</PRE>
@@ -380,7 +380,7 @@ BrowseAllow from none
BrowseAllow from 192.0.2
BrowseAllow from 192.0.2.0/24
BrowseAllow from 192.0.2.0/255.255.255.0
BrowseAllow from *.domain.com
BrowseAllow from *.example.com
BrowseAllow from @LOCAL
BrowseAllow from @IF(name)
</PRE>
@@ -418,7 +418,7 @@ BrowseDeny from none
BrowseDeny from 192.0.2
BrowseDeny from 192.0.2.0/24
BrowseDeny from 192.0.2.0/255.255.255.0
BrowseDeny from *.domain.com
BrowseDeny from *.example.com
BrowseDeny from @LOCAL
BrowseDeny from @IF(name)
</PRE>
@@ -616,7 +616,7 @@ allow/deny processing. The default order is
<PRE CLASS="command">
BrowsePoll 192.0.2.2:631
BrowsePoll host.domain.com:631
BrowsePoll host.example.com:631
</PRE>
<H3>Description</H3>
@@ -698,8 +698,8 @@ requests for several seconds while polling the network.</P>
BrowseRelay 193.0.2.1 192.0.2.255
BrowseRelay 193.0.2.0/255.255.255.0 192.0.2.255
BrowseRelay 193.0.2.0/24 192.0.2.255
BrowseRelay *.domain.com 192.0.2.255
BrowseRelay host.domain.com 192.0.2.255
BrowseRelay *.example.com 192.0.2.255
BrowseRelay host.example.com 192.0.2.255
</PRE>
<H3>Description</H3>
@@ -715,11 +715,12 @@ can also be used to relay printer information from polled servers
with the line:</P>
<PRE CLASS="command">
BrowseRelay 127.0.0.1 @LOCAL
BrowseRelay 127.0.0.1 192.0.2.255
</PRE>
<P>This effectively provides access to printers on a WAN for all
clients on the LAN(s).</P>
clients on the LAN. Use multiple <CODE>BrowseRelay</CODE> lines to
relay information to multiple subnets.</P>
<H2 CLASS="title"><A NAME="BrowseRemoteOptions">BrowseRemoteOptions</A></H2>
@@ -1009,6 +1010,7 @@ size.</P>
<PRE CLASS="command">
DefaultPolicy default
DefaultPolicy authenticated
DefaultPolicy foo
</PRE>
@@ -1016,7 +1018,9 @@ DefaultPolicy foo
<P>The <CODE>DefaultPolicy</CODE> directive specifies the default
policy to use for IPP operation. The default is
<CODE>default</CODE>.</P>
<CODE>default</CODE>. CUPS also includes a policy called
<CODE>authenticated</CODE> that requires a username and password for printing
and other job operations.</P>
<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.2/Mac OS X 10.5</SPAN><A NAME="DefaultShared">DefaultShared</A></H2>
@@ -1044,9 +1048,9 @@ printers are shared (published) by default. The default is
..
Deny from All
Deny from None
Deny from *.domain.com
Deny from .domain.com
Deny from host.domain.com
Deny from *.example.com
Deny from .example.com
Deny from host.example.com
Deny from nnn.*
Deny from nnn.nnn.*
Deny from nnn.nnn.nnn.*
@@ -1064,8 +1068,8 @@ printers are shared (published) by default. The default is
<P>The <CODE>Deny</CODE> directive specifies a hostname, IP
address, or network that is denied access to the server.
<CODE>Deny</CODE> directives are cummulative, so multiple
<CODE>Deny</CODE> directives can be used to allow access for
<CODE>Deny</CODE> directives are cumulative, so multiple
<CODE>Deny</CODE> directives can be used to deny access for
multiple hosts or networks.</P>
<P>Host and domain name matching require that you enable the <A
@@ -1733,11 +1737,11 @@ operations.</P>
</TR>
<TR>
<TD>Get-Printer-Attributes</TD>
<TD>Gets informaion about a printer or class</TD>
<TD>Gets information about a printer or class</TD>
</TR>
<TR>
<TD>Get-Subscription-Attributes</TD>
<TD>Gets informaion about a notification subscription</TD>
<TD>Gets information about a notification subscription</TD>
</TR>
<TR>
<TD>Get-Subscriptions</TD>
@@ -1773,7 +1777,7 @@ operations.</P>
</TR>
<TR>
<TD>Resume-Printer</TD>
<TD>Sets the printer-stae value for a printer to idle/processing</TD>
<TD>Sets the printer-state value for a printer to idle/processing</TD>
</TR>
<TR>
<TD>Send-Document</TD>
@@ -2330,8 +2334,8 @@ information to the system log instead of a plain file.</P>
<H3>Examples</H3>
<PRE CLASS="command">
PageLogFormat %p %j %u %T %P %C %{job-billing} %{job-originating-host-name} %{job-name} %{media} %{sides}
PageLogFormat PAGE %p %j %u %P %C %{job-billing} %{job-originating-host-name}
PageLogFormat %p %u %j %T %P %C %{job-billing} %{job-originating-host-name} %{job-name} %{media} %{sides}
PageLogFormat PAGE %p %u %j %P %C %{job-billing} %{job-originating-host-name}
</PRE>
<H3>Description</H3>
@@ -2364,7 +2368,7 @@ recognized:</P>
</UL>
<P>The default is "%p %j %u %T %P %C %{job-billing} %{job-originating-host-name} %{job-name} %{media} %{sides}".</P>
<P>The default is "%p %u %j %T %P %C %{job-billing} %{job-originating-host-name} %{job-name} %{media} %{sides}".</P>
<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.2/Mac OS X 10.5</SPAN><A NAME="PassEnv">PassEnv</A></H2>
@@ -2697,7 +2701,7 @@ is generated only once on startup or on a restart. The default is
<P>The <CODE>Satisfy</CODE> directive specifies whether all
conditions must be satisfied to allow access to the resource. If
set to <CODE>all</CODE>, then all authentication and access
control conditions must be satified to allow access.</P>
control conditions must be satisfied to allow access.</P>
<P>Setting <CODE>Satisfy</CODE> to <CODE>any</CODE> allows a user
to gain access if the authentication or access control
@@ -2734,18 +2738,14 @@ HREF="#ServerName"><CODE>ServerName</CODE></A>.</P>
<PRE CLASS="command">
ServerAlias althost
ServerAlias althost.foo.com
ServerAlias althost.bar.com
ServerAlias foo.example.com
ServerAlias bar.example.com
ServerAlias *
</PRE>
<H3>Description</H3>
<P>The <CODE>ServerAlias</CODE> directive specifies alternate names that the
server is known by. By default it contains a list of all aliases associated
with the <A HREF="#ServerName"><CODE>ServerName</CODE></A>. The special name
"*" can be used to allow any hostname when accessing CUPS via an external
network interfaces.</P>
<P>The <CODE>ServerAlias</CODE> directive specifies alternate names that the server is known by. By default it contains a list of all aliases associated with the <A HREF="#ServerName"><CODE>ServerName</CODE></A>. The special name "*" can be used to allow any hostname when accessing CUPS via an external network interfaces.</P>
<BLOCKQUOTE><B>Note</B>
@@ -2822,8 +2822,8 @@ encrypted connections.</P>
<H3>Examples</H3>
<PRE CLASS="command">
ServerName foo.domain.com
ServerName myserver.domain.com
ServerName foo.example.com
ServerName myserver.example.com
</PRE>
<H3>Description</H3>
+5 -5
Ver Arquivo
@@ -21,8 +21,8 @@ line.</P>
<H3>Examples</H3>
<PRE CLASS="command">
Cc bigbrother@domain.com
Cc John Doe &lt;jd@domain.com>
Cc bigbrother@example.com
Cc John Doe &lt;jd@example.com>
</PRE>
<H3>Description</H3>
@@ -37,8 +37,8 @@ default is to not send a copy to anyone but the subscriber.</P>
<H3>Examples</H3>
<PRE CLASS="command">
From printserver@domain.com
From Your Happy Printer &lt;printserver@domain.com>
From printserver@example.com
From Your Happy Printer &lt;printserver@example.com>
</PRE>
<H3>Description</H3>
@@ -73,7 +73,7 @@ default is <TT>/usr/sbin/sendmail</TT>.</P>
<H3>Examples</H3>
<PRE CLASS="command">
SMTPServer mail.domain.com
SMTPServer mail.example.com
SMTPServer 192.168.2.1
</PRE>
+4 -5
Ver Arquivo
@@ -31,7 +31,7 @@ mechanisms.</p>
<dd>Evaluates to the specified integer; the number can be preceded by
a leading sign (+/-) followed by a decimal number (1234), octal number
(01234), or hexidecimal number (0x1234) using the same rules as C and
(01234), or hexadecimal number (0x1234) using the same rules as C and
C++.</dd>
<dt>(NAME NAME ... number number ...)</dt>
@@ -71,7 +71,7 @@ mechanisms.</p>
</dl>
<p>Printer driver information can be grouped and shared using
curley braces ({ ... }); PPD files are written when a close
curly braces ({ ... }); PPD files are written when a close
brace or end-of-file is seen and a <a href="#PCFileName">PCFileName</a>
directive has been defined.</p>
@@ -1798,8 +1798,7 @@ SimpleColorProfile 720dpi/Glossy 100 90 120 1.5 -5 5 10
<h3>Description</h3>
<p>The <code>SimpleColorProfile</code> directive creates a
matrix-based <a href="#ColorProfile"><code>ColorProfile</code></a>
using values chosen with the <code>cupsprofile(1)</code> utility.
matrix-based <a href="#ColorProfile"><code>ColorProfile</code></a>.
The resolution and mediatype arguments specify the
<code>Resolution</code> and <code>MediaType</code> choices which use the
profile; the hyphen (<code>-</code>) is used to specify that any
@@ -1860,7 +1859,7 @@ Throughput 10
<h3>Description</h3>
<p>The <code>Througput</code> directive sets the <code>Troughput</code>
<p>The <code>Throughput</code> directive sets the <code>Throughput</code>
attribute for the current printer driver. The pages-per-minute
argument is a positive integer representing the peak number of
pages per minute that the printer is capable of producing. Use a
+1 -1
Ver Arquivo
@@ -136,7 +136,7 @@ MaxRunTime 300
<H3>Description</H3>
<P>The <CODE>MaxRunTime</CODE> directive specifies the maxium
<P>The <CODE>MaxRunTime</CODE> directive specifies the maximum
number of seconds that the SNMP backend will spend looking for
printer devices on the network.</P>
+2 -2
Ver Arquivo
@@ -12,7 +12,7 @@
potential security risks - the CUPS server does not accept remote
connections, and only accepts shared printer information from the
local subnet. When you share printers and/or enable remote
adminstration, you expose your system to potential unauthorized
administration, you expose your system to potential unauthorized
access. This help page provides an analysis of possible CUPS
security concerns and describes how to better secure your
server.</P>
@@ -20,7 +20,7 @@ server.</P>
<H2 CLASS="title"><A NAME="AUTHENTICATION">Authentication Issues</A></H2>
<P>When you enable remote administration, the server will use
Basic authentication for adminstration tasks. The current CUPS
Basic authentication for administration tasks. The current CUPS
server supports Basic, Digest, Kerberos, and local certificate
authentication:</P>
+3 -3
Ver Arquivo
@@ -8,11 +8,11 @@
</head>
<body>
<!--
"$Id: spec-banner.html 8653 2009-05-16 23:53:28Z mike $"
"$Id: spec-banner.html 9728 2011-04-28 21:21:24Z mike $"
Banner file format specification for the Common UNIX Printing System (CUPS).
Banner file format specification for CUPS.
Copyright 2008-2009 by Apple Inc.
Copyright 2008-2011 by Apple Inc.
These coded instructions, statements, and computer programs are the
property of Apple Inc. and are protected by Federal copyright
+9 -3
Ver Arquivo
@@ -8,11 +8,11 @@
</head>
<body>
<!--
"$Id: spec-browsing.html 8653 2009-05-16 23:53:28Z mike $"
"$Id: spec-browsing.html 9728 2011-04-28 21:21:24Z mike $"
CUPS Browse Protocol specification for the Common UNIX Printing System (CUPS).
CUPS Browse Protocol specification for CUPS.
Copyright 2008 by Apple Inc.
Copyright 2008-2011 by Apple Inc.
Copyright 1997-2005 by Easy Software Products.
These coded instructions, statements, and computer programs are the
@@ -22,6 +22,12 @@
file is missing or damaged, see the license at "http://www.cups.org/".
-->
<BLOCKQUOTE><B>Note:</B>
<P>The CUPS Browse Protocol is deprecated and will no longer be used in a future release of CUPS.</P>
</BLOCKQUOTE>
<H1 CLASS="title">CUPS Browse Protocol</H1>
<h2><a name='INTRO'>Introduction</a></h2>
+2 -26
Ver Arquivo
@@ -211,7 +211,7 @@ Detailed list of changes.
<P>Primary development occurs on the <var>trunk</var> branch,
with changes merged back to release branches as needed. Table 2
shows the URLs developers use for the various CUPS subprojects
shows the URLs developers use for the various CUPS sub-projects
and branches:</P>
<DIV CLASS="table"><TABLE SUMMARY="CUPS Subversion URLs">
@@ -232,30 +232,6 @@ and branches:</P>
<TD><A HREF="http://svn.easysw.com/public/cups/tags/">https://svn.easysw.com/public/cups/tags/</A></TD>
<TD>CUPS release tags (read-only)</TD>
</TR>
<TR>
<TD><A HREF="http://svn.easysw.com/public/cupsddk/trunk/">https://svn.easysw.com/public/cupsddk/trunk/</A></TD>
<TD>Primary CUPS DDK development branch</TD>
</TR>
<TR>
<TD><A HREF="http://svn.easysw.com/public/cupsddk/branches/">https://svn.easysw.com/public/cupsddk/branches/</A></TD>
<TD>CUPS DDK maintenance branches (merge-only)</TD>
</TR>
<TR>
<TD><A HREF="http://svn.easysw.com/public/cupsddk/tags/">https://svn.easysw.com/public/cupsddk/tags/</A></TD>
<TD>CUPS DDK release tags (read-only)</TD>
</TR>
<TR>
<TD><A HREF="http://svn.easysw.com/public/espgs/trunk/">https://svn.easysw.com/public/espgs/trunk/</A></TD>
<TD>Primary ESP Ghostscript development branch</TD>
</TR>
<TR>
<TD><A HREF="http://svn.easysw.com/public/espgs/branches/">https://svn.easysw.com/public/espgs/branches/</A></TD>
<TD>ESP Ghostscript maintenance branches (merge-only)</TD>
</TR>
<TR>
<TD><A HREF="http://svn.easysw.com/public/espgs/tags/">https://svn.easysw.com/public/espgs/tags/</A></TD>
<TD>ESP Ghostscript release tags (read-only)</TD>
</TR>
<TR>
<TD><A HREF="http://svn.easysw.com/public/windows/trunk/">https://svn.easysw.com/public/windows/trunk/</A></TD>
<TD>Primary CUPS Windows Driver development branch</TD>
@@ -283,7 +259,7 @@ created for developer snapshots.</P>
<H3>Files and Directories</H3>
<P>File and directory names may not exceed 16 characters in
length to ensure compability with older UNIX filesystems. In
length to ensure compatibility with older UNIX filesystems. In
addition, to avoid problems with case-insensitive filesystems,
you may not use names which differ only by case, for example
"ReadMe" and "README" are not allowed in the same directory.</P>
+3 -4
Ver Arquivo
@@ -8,12 +8,11 @@
</head>
<body>
<!--
"$Id: spec-command.html 8653 2009-05-16 23:53:28Z mike $"
"$Id: spec-command.html 9728 2011-04-28 21:21:24Z mike $"
CUPS command file format specification for the Common UNIX Printing
System (CUPS).
CUPS command file format specification for CUPS.
Copyright 2007-2009 by Apple Inc.
Copyright 2007-2011 by Apple Inc.
Copyright 1997-2006 by Easy Software Products.
These coded instructions, statements, and computer programs are the
+3 -3
Ver Arquivo
@@ -8,11 +8,11 @@
</head>
<body>
<!--
"$Id: spec-ipp.html 8816 2009-09-14 21:41:50Z mike $"
"$Id: spec-ipp.html 9728 2011-04-28 21:21:24Z mike $"
CUPS IPP specification for the Common UNIX Printing System (CUPS).
CUPS IPP specification for CUPS.
Copyright 2007-2009 by Apple Inc.
Copyright 2007-2011 by Apple Inc.
Copyright 1997-2007 by Easy Software Products.
These coded instructions, statements, and computer programs are the
+4 -4
Ver Arquivo
@@ -8,11 +8,11 @@
</head>
<body>
<!--
"$Id: spec-postscript.html 8653 2009-05-16 23:53:28Z mike $"
"$Id: spec-postscript.html 9728 2011-04-28 21:21:24Z mike $"
CUPS PostScript file specification for the Common UNIX Printing System (CUPS).
CUPS PostScript file specification for CUPS.
Copyright 2007-2008 by Apple Inc.
Copyright 2007-2011 by Apple Inc.
Copyright 2006 by Easy Software Products.
These coded instructions, statements, and computer programs are the
@@ -36,7 +36,7 @@ Adobe TechNote and this document will ensure that your PostScript
output will work reliably.</p>
<blockquote><b>Note:</b> While PostScript is currently the
defacto-standard print job file format/language for UNIX-based
de-facto standard print job file format/language for UNIX-based
applications, it is slowly being phased out in favor of Adobe's
Portable Document Format ("PDF") which offers many advantages
over PostScript. Mac OS X uses PDF as the primary print job file
+2 -2
Ver Arquivo
@@ -8,7 +8,7 @@
</head>
<body>
<!--
"$Id: spec-ppd.html 9170 2010-06-22 03:06:13Z mike $"
"$Id: spec-ppd.html 9406 2010-12-08 07:23:22Z mike $"
CUPS PPD extensions specification for CUPS.
@@ -438,7 +438,7 @@ choice followed by testing each option choice to resolve the conflict.</p>
<h3><span class='info'>CUPS 1.4/Mac OS X 10.6</span><a name='cupsUIResolver'>cupsUIResolver</a></h3>
<p class='summary'>*cupsUIResolution resolver: "*Keyword1 OptionKeyword1 *Keyword2 OptionKeyword2 ..."</p>
<p class='summary'>*cupsUIResolver resolver: "*Keyword1 OptionKeyword1 *Keyword2 OptionKeyword2 ..."</p>
<p>Specifies two or more options to mark/select to resolve a constraint. The
"resolver" string identifies a particular action to take for one or more
+114 -142
Ver Arquivo
@@ -9,37 +9,35 @@
<H1 CLASS="title">CUPS Raster Format</H1>
<P>CUPS raster files are device-dependent raster image files that
contain a PostScript page device dictionary and device-dependent
raster imagery for each page in the document. These files are
used to transfer raster data from the PostScript and image file
RIPs to device-dependent filters that convert the raster data to
a printable format.</P>
<P>CUPS Raster files are device-dependent raster image files that contain a PostScript page device dictionary and device-dependent raster imagery for each page in the document. These files are used to transfer raster data from the PostScript and image file RIPs to device-dependent filters that convert the raster data to a printable format.</P>
<P>CUPS 1.0 and 1.1 used a version 1 raster format. CUPS 1.2
introduced version 2 (compressed) and version 3 (uncompressed)
formats that are a superset of the version 1 format. Applications
using the CUPS Imaging API (the cupsRaster* functions) can read
all formats without code changes.</P>
<P>CUPS 1.0 and 1.1 used version 1 of the raster format. CUPS 1.2 and later use version 2 (compressed) and version 3 (uncompressed) that are a superset of the version 1 raster format. All three versions of CUPS Raster are streamable formats, and applications using the CUPS Imaging API (the cupsRaster* functions) can read all formats without code changes.</P>
<P>The registered MIME media type for CUPS raster files is
<CODE>application/vnd.cups-raster</CODE>.</P>
<P>The registered MIME media type for CUPS Raster files is <CODE>application/vnd.cups-raster</CODE>.</P>
<H2 CLASS="title"><A NAME="ORGANIZATION">Organization of a CUPS Raster File</A></H2>
<P><A HREF="FILEFORMAT">Figure 1, "Raster Organization"</A>, shows the general organization of all CUPS Raster files. Each file begins with a 32-bit synchronization word followed by zero or more pages. Each page consists of a header (the PostScript page device dictionary and raster-specific values) followed by the bitmap image for the page.</P>
<DIV CLASS="figure"><TABLE SUMMARY="Raster Organization">
<CAPTION><A NAME="FILEFORMAT">Figure 1: Raster Organization</A></CAPTION>
<TR><TD><IMG SRC="../images/raster-organization.png" WIDTH="446" HEIGHT="1056" ALT="Raster Organization"></TD></TR>
</TABLE></DIV>
<P>Each page bitmap is stored as described by the <CODE>cupsBitsPerColor</CODE>, <CODE>cupsBytesPerLine</CODE>, <CODE>cupsColorOrder</CODE>, <CODE>cupsColorSpace</CODE>, <CODE>cupsHeight</CODE>, and <CODE>cupsWidth</CODE> values in the page header. Pixels for the front side of a sheet are always stored left-to-right, top-to-bottom. When doing duplex printing, pixels for the back side of a sheet may be stored differently depending on the value of the <CODE>cupsBackSide</CODE> keyword ("Normal", "ManualTumble", "Rotated", or "Flipped") in the PPD file and the <CODE>Tumble</CODE> value ("true" or "false") in the page header. <A HREF="#PAGEBITMAPS">Figure 2, "Page Bitmaps"</A>, shows the pixel order for each combination.</P>
<DIV CLASS="figure"><TABLE SUMMARY="Page Bitmaps">
<CAPTION><A NAME="PAGEBITMAPS">Figure 2: Page Bitmaps</A></CAPTION>
<TR><TD><IMG SRC="../images/raster.png" WIDTH="624" HEIGHT="448" ALT="Page Bitmaps"></TD></TR>
</TABLE></DIV>
<H2 CLASS="title"><A NAME="V1">Version 1 Raster File Format</A></H2>
<P>A version 1 raster file begins with a 32-bit synchronization
word: 0x52615374 ("RaSt") for big-endian architectures and
0x74536152 ("tSaR") for little-endian architectures. The writer
of the raster file will use the native word order, and the reader
is responsible for detecting a reversed word order file and
swapping bytes as needed. The CUPS Imaging API raster functions
perform this function automatically.</P>
<P>A version 1 raster file begins with a 32-bit synchronization word: 0x52615374 ("RaSt") for big-endian architectures or 0x74536152 ("tSaR") for little-endian architectures. The writer of the raster file will use the native word order, and the reader is responsible for detecting a reversed word order file and swapping bytes as needed. The CUPS Imaging API raster functions perform this function automatically.</P>
<P>Following the synchronization word are a series of raster
pages. Each page starts with a page device dictionary header and
is followed immediately by the (uncompressed, raw) raster data
for that page.</P>
<P>Following the synchronization word are a series of raster pages. Each page starts with a page device dictionary header and is followed immediately by the (uncompressed/raw) raster data for that page.</P>
<DIV CLASS="table"><TABLE SUMMARY="CUPS Version 1 Raster Page Device Dictionary">
<CAPTION><A NAME="TABLE1">Table 1: CUPS Version 1 Raster Page Device Dictionary</A></CAPTION>
@@ -177,7 +175,7 @@ for that page.</P>
<TD>328-331</TD>
<TD>Unsigned Integer</TD>
<TD>MediaWeight</TD>
<TD>Media weight in grams per meter squared</TD>
<TD>Media weight in grams per meter squared, 0 = printer default</TD>
</TR>
<TR>
<TD>332-335</TD>
@@ -197,7 +195,7 @@ for that page.</P>
<TD>340-343</TD>
<TD>Unsigned Integer</TD>
<TD>NumCopies</TD>
<TD>1 to 2<SUP>32</SUP> - 1</TD>
<TD>0 to 2<SUP>32</SUP> - 1, 0 = printer default</TD>
</TR>
<TR>
<TD>344-347</TD>
@@ -265,14 +263,14 @@ for that page.</P>
<TD>Unsigned Integer</TD>
<TD>cupsBitsPerColor</TD>
<TD>1, 2, 4, 8 bits for version 1 raster files<BR>
1, 2, 4, 8, and 16 bits for version 2 raster files</TD>
1, 2, 4, 8, and 16 bits for version 2/3 raster files</TD>
</TR>
<TR>
<TD>388-391</TD>
<TD>Unsigned Integer</TD>
<TD>cupsBitsPerPixel</TD>
<TD>1 to 32 bits for version 1 raster files<BR>
1 to 64 bits for version 2 raster files</TD>
1 to 240 bits for version 2/3 raster files</TD>
</TR>
<TR>
<TD>392-395</TD>
@@ -292,9 +290,9 @@ for that page.</P>
<TD>400-403</TD>
<TD>Unsigned Integer</TD>
<TD>cupsColorSpace</TD>
<TD>0 = white (sRGB)<BR>
1 = RGB (sRGB)<BR>
2 = RGBA (sRGB)<BR>
<TD>0 = gray (device, typically sRGB-based)<BR>
1 = RGB (device, typically sRGB)<BR>
2 = RGBA (device, typically sRGB)<BR>
3 = black<BR>
4 = CMY<BR>
5 = YMC<BR>
@@ -310,6 +308,9 @@ for that page.</P>
15 = CIE XYZ<BR>
16 = CIE Lab<BR>
17 = RGBW (sRGB)<BR>
18 = sGray (gray using sRGB gamma/white point)<BR>
19 = sRGB<BR>
20 = AdobeRGB<BR>
32 = ICC1 (CIE Lab with hint for 1 color)<BR>
33 = ICC2 (CIE Lab with hint for 2 colors)<BR>
34 = ICC3 (CIE Lab with hint for 3 colors)<BR>
@@ -325,6 +326,21 @@ for that page.</P>
44 = ICCD (CIE Lab with hint for 13 colors)<BR>
45 = ICCE (CIE Lab with hint for 14 colors)<BR>
46 = ICCF (CIE Lab with hint for 15 colors)<BR>
48 = Device1 (DeviceN for 1 color)<BR>
49 = Device2 (DeviceN for 2 colors)<BR>
50 = Device3 (DeviceN for 3 colors)<BR>
51 = Device4 (DeviceN for 4 colors)<BR>
52 = Device5 (DeviceN for 5 colors)<BR>
53 = Device6 (DeviceN for 6 colors)<BR>
54 = Device7 (DeviceN for 7 colors)<BR>
55 = Device8 (DeviceN for 8 colors)<BR>
56 = Device9 (DeviceN for 9 colors)<BR>
57 = DeviceA (DeviceN for 10 colors)<BR>
58 = DeviceB (DeviceN for 11 colors)<BR>
59 = DeviceC (DeviceN for 12 colors)<BR>
60 = DeviceD (DeviceN for 13 colors)<BR>
61 = DeviceE (DeviceN for 14 colors)<BR>
62 = DeviceF (DeviceN for 15 colors)
</TD>
</TR>
<TR>
@@ -357,18 +373,9 @@ for that page.</P>
<H2 CLASS="title"><A NAME="V2">Version 2 Raster File Format</A></H2>
<P>A version 2 raster file begins with a 32-bit synchronization
word: 0x52615332 ("RaS2") for big-endian architectures and
0x32536152 ("2SaR") for little-endian architectures. The writer
of the raster file will use the native word order, and the reader
is responsible for detecting a reversed word order file and
swapping bytes as needed. The CUPS Imaging API raster functions
perform this function automatically.</P>
<P>A version 2 raster file begins with a 32-bit synchronization word: 0x52615332 ("RaS2") for big-endian architectures or 0x32536152 ("2SaR") for little-endian architectures. The writer of the raster file will use the native word order, and the reader is responsible for detecting a reversed word order file and swapping bytes as needed. The CUPS Imaging API raster functions perform this function automatically.</P>
<P>Following the synchronization word are a series of raster
pages. Each page starts with a version 2 page device dictionary
header and is followed immediately by the compressed raster data
for that page.</P>
<P>Following the synchronization word are a series of raster pages. Each page starts with a version 2 page device dictionary header and is followed immediately by the compressed raster data for that page.</P>
<DIV CLASS="table"><TABLE SUMMARY="CUPS Version 2 Raster Page Device Dictionary">
<CAPTION><A NAME="TABLE2">Table 2: CUPS Version 2 Raster Page Device Dictionary</A></CAPTION>
@@ -390,7 +397,7 @@ for that page.</P>
<TD>420-423</TD>
<TD>Unsigned Integer</TD>
<TD>cupsNumColors</TD>
<TD>1 to 6 colors</TD>
<TD>1 to 15 colors</TD>
</TR>
<TR>
<TD>424-427</TD>
@@ -408,9 +415,7 @@ for that page.</P>
<TD>436-451</TD>
<TD>IEEE Single Precision (4)</TD>
<TD>cupsImagingBBox</TD>
<TD>Four floating point numbers giving the left, bottom,
right, and top positions of the page bounding box in
points</TD>
<TD>Four floating point numbers giving the left, bottom, right, and top positions of the page bounding box in points</TD>
</TR>
<TR>
<TD>452-515</TD>
@@ -453,10 +458,7 @@ for that page.</P>
<H3><A NAME="COMPRESSION">Compressed Raster Data Format</A></H3>
<P>The version 2 raster data is compressed using a modified TIFF
packbits algorithm. Lines are grouped into an integral number of
color values based upon the <CODE>cupsColorOrder</CODE>
setting:</P>
<P>The version 2 raster data is compressed using a PackBits-like algorithm. Lines are grouped into an integral number of color values based upon the <CODE>cupsColorOrder</CODE> setting:</P>
<DIV CLASS="table"><TABLE SUMMARY="Color Value Sizes">
<CAPTION><A NAME="TABLE3">Table 3: Color Value Sizes</A></CAPTION>
@@ -478,53 +480,56 @@ setting:</P>
</TR>
</TABLE></DIV>
<P>Each line of raster data begins with a repetition count from 1
to 256 that is encoded using a single byte of "count - 1".</P>
<P>Each line of raster data begins with a repetition count from 1 to 256 that is encoded using a single byte of "count - 1".</P>
<P>After the repetition count, whole color values for that line
are run-length encoded using the TIFF packbits algorithm. 1 to
128 repeated colors are encoded using an initial byte of "count -
1" followed by the color value byte(s). 2 to 128 non-repeating
colors are encoded using an initial byte of "257 - count"
followed by the color value bytes.</P>
<P>After the repetition count, whole color values for that line are run-length encoded using a PackBits-like run-length encoding algorithm: 1 to 128 repeated colors are encoded using an initial byte of "count - 1" followed by the color value byte(s) while 2 to 128 non-repeating colors are encoded using an initial byte of "257 - count" followed by the color value bytes.</P>
<P>For example, the 8x8 24-bit sRGB image shown in <a href="#SAMPLEIMAGE">Figure 3, "Sample Image"</a>, would be encoded as the following 89 octets:</p>
<PRE CLASS="example">
%x00 %x00.FF.FF.FF %x02.FF.FF.00 %x03.FF.FF.FF
%x00 %xFE.FF.FF.00.00.00.FF.FF.FF.00 %x02.FF.FF.FF %x00.00.FF.00 %x00.FF.FF.FF
%x00 %x01.FF.FF.00 %x02.FF.FF.FF %x02.00.FF.00
%x00 %x02.FF.FF.00 %x02.FF.FF.FF %x00.00.FF.00 %x00.FF.FF.FF
%x00 %x00.FF.FF.FF %x02.FF.FF.00 %x03.FF.FF.FF
%x00 %x07.FF.FF.FF
%x01 %x07.FF.00.00
</PRE>
<P>The first line (%x00) contains 1 white pixel (%x00.FF.FF.FF), 3 yellow pixels (%x02.FF.FF.00), and 4 white pixels (%x03.FF.FF.FF).</P>
<P>The second line (%x00) contains a sequence of yellow + blue + yellow pixels (%xFE.FF.FF.00.00.00.FF.FF.FF.00), 3 white pixels (%x02.FF.FF.FF), 1 green pixel (%x00.00.FF.00), and 1 white pixel (%x00.FF.FF.FF).</P>
<P>The third line (%x00) contains 2 yellow pixels (%x01.FF.FF.00), 3 white pixels (%x02.FF.FF.FF), and 3 green pixels (%x02.00.FF.00)</P>
<P>The fourth line (%x00) contains 3 yellow pixels (%x02.FF.FF.00), 3 white pixels (%x02.FF.FF.FF), 1 green pixel (%x00.00.FF.00), and 1 white pixel (%x00.FF.FF.FF).</P>
<P>The fifth line (%x00) contains 1 white pixel (%x00.FF.FF.FF), 3 yellow pixels (%x02.FF.FF.00), and 4 white pixels (%x03.FF.FF.FF).</P>
<P>The sixth line (%x00) contains 8 white pixels (%x07.FF.FF.FF).</P>
<P>The seventh and eighth lines (%x01) contain 8 red pixels (%x07.FF.00.00).</P>
<DIV CLASS="figure"><TABLE SUMMARY="Sample Image">
<CAPTION><A NAME="SAMPLEIMAGE">Figure 3: Sample Image</A></CAPTION>
<TR><TD><IMG SRC="../images/sample-image.png" WIDTH="257" HEIGHT="257" ALT="Sample Image"></TD></TR>
</TABLE></DIV>
<H2 CLASS="title"><A NAME="V3">Version 3 Raster File Format</A></H2>
<P>A version 3 raster file begins with a 32-bit synchronization
word: 0x52615333 ("RaS3") for big-endian architectures and
0x33536152 ("3SaR") for little-endian architectures. The writer
of the raster file will use the native word order, and the reader
is responsible for detecting a reversed word order file and
swapping bytes as needed. The CUPS Imaging API raster functions
perform this function automatically.</P>
<P>A version 3 raster file begins with a 32-bit synchronization word: 0x52615333 ("RaS3") for big-endian architectures and 0x33536152 ("3SaR") for little-endian architectures. The writer of the raster file will use the native word order, and the reader is responsible for detecting a reversed word order file and swapping bytes as needed. The CUPS Imaging API raster functions perform this function automatically.</P>
<P>Following the synchronization word are a series of raster
pages. Each page starts with a version 2 page device dictionary
header and is followed immediately by the uncompressed raster data
for that page.</P>
<P>Following the synchronization word are a series of raster pages. Each page starts with a version 2 page device dictionary header and is followed immediately by the uncompressed/raw raster data for that page.</P>
<H2 CLASS="title"><A NAME="ENCODING">Pixel Value Coding</A></H2>
<P>The following sections describe the encoding and decoding of
the color values in a CUPS raster file. In general, colors are
packed into the minimum number of bytes, with special
consideration provided for efficiency of encoding and access.
Multi-byte values are stored in the native byte order and
automatically swapped as needed when reading them using the CUPS
imaging API.</P>
<P>The following sections describe the encoding and decoding of the color values in a CUPS Raster file. In general, colors are packed into the minimum number of bytes, with special consideration provided for efficiency of encoding and access. Multi-byte values are stored in the native byte order and automatically swapped as needed when reading them using the CUPS imaging API.</P>
<H3>CUPS_ORDER_CHUNKED</H3>
<P>The chunked order provides the pixel value packed in a single
place. Pixel values with 8 or more bits per color are stored as
an array of colors in order, e.g. for
<CODE>CUPS_CSPACE_RGB</CODE> you will see 8/16-bits of red, then
blue, then green, then red, green, blue, etc. Pixel values with
less than 8 bits per color are packed together as shown in Table
4. <I>Multi-byte pixel values are stored in the native word
order, just as for 16-bit color values.</I></P>
<P>The chunked order provides the pixel value packed in a single place. Pixel values with 8 or more bits per color are stored as an array of colors in order, e.g. for <CODE>CUPS_CSPACE_RGB</CODE> you will see 8/16-bits of red, then blue, then green, then red, green, blue, etc. Pixel values with less than 8 bits per color are packed together as shown in Table 4. <I>Multi-byte pixel values are stored in the native word order, just as for 16-bit color values.</I></P>
<DIV CLASS="table"><TABLE SUMMARY="Chunked Color Values">
<CAPTION><A NAME="TABLE4">Table 4: Chunked Color Values</A></CAPTION>
@@ -566,56 +571,27 @@ order, just as for 16-bit color values.</I></P>
<H3>CUPS_ORDER_BANDED</H3>
<P>The banded order provides each color as a separate line of
data. Each color plane for a line is written in sequence, e.g.
for the <CODE>CUPS_CSPACE_CMYK</CODE> colorspace you would see
all of the cyan pixels for a line followed by the magenta,
yellow, and black pixels for that line. This is repeated for all
of the lines on the page. Color values are packed starting with
the most-significant bit (MSB) first.</P>
<P>The banded order provides each color as a separate line of data. Each color plane for a line is written in sequence, e.g. for the <CODE>CUPS_CSPACE_CMYK</CODE> color space you would see all of the cyan pixels for a line followed by the magenta, yellow, and black pixels for that line. This is repeated for all of the lines on the page. Color values are packed starting with the most-significant bit (MSB) first.</P>
<H3>CUPS_ORDER_PLANAR</H3>
<P>The planar order provides each color as a separate page of
data using a shared page header. Each color plane for a page is
written in sequence, e.g. for the <CODE>CUPS_CSPACE_CMYK</CODE>
colorspace you would see all of the cyan pixels for a page
followed by the magenta, yellow, and black pixels for that page.
Color values are packed starting with the most-significant bit
(MSB) first. Each line starts on an 8-bit boundary.</P>
<P>The planar order provides each color as a separate page of data using a shared page header. Each color plane for a page is written in sequence, e.g. for the <CODE>CUPS_CSPACE_CMYK</CODE> color space you would see all of the cyan pixels for a page followed by the magenta, yellow, and black pixels for that page. Color values are packed starting with the most-significant bit (MSB) first. Each line starts on an 8-bit boundary.</P>
<H3>CUPS_CSPACE_W, CUPS_CSPACE_RGB, CUPS_CSPACE_RGBA, and
CUPS_CSPACE_RGBW</H3>
<H3>CUPS_CSPACE_RGBW</H3>
<P>These colorspaces use the sRGB colorspace definition and
whitepoint.</P>
<P>This color space provides a dedicated black text channel and uses the sRGB color space definition and white point for the RGB color channels. The white channel is 0 for text (or "true") black, otherwise it must contain the maximum color value: 1 for 1-bit, 3 for 2-bit, 15 for 4-bit, 255 for 8-bit, or 65535 for 16-bit.</P>
<H3>CUPS_CSPACE_KCMYcm</H3>
<P>When <CODE>cupsBitsPerColor</CODE> is 1, 6 color planes are
provided - black, cyan, magenta, yellow, light cyan, and light
magenta. When <CODE>cupsBitsPerColor</CODE> is greater than 1, 4
color planes are provided using the <CODE>CUPS_CSPACE_KCMY</CODE>
colorspace instead.</P>
<P>When <CODE>cupsBitsPerColor</CODE> is 1, 6 color planes are provided - black, cyan, magenta, yellow, light cyan, and light magenta. When <CODE>cupsBitsPerColor</CODE> is greater than 1, 4 color planes are provided using the <CODE>CUPS_CSPACE_KCMY</CODE> color space instead.</P>
<P>When <CODE>cupsColorOrder</CODE> is
<CODE>CUPS_ORDER_CHUNKED</CODE>, bit 5 corresponds to black and
bit 0 corresponds to light magenta. For
<CODE>CUPS_ORDER_BANDED</CODE> and
<CODE>CUPS_ORDER_PLANAR</CODE>, each color plane is encoded
separately.</P>
<P>When <CODE>cupsColorOrder</CODE> is <CODE>CUPS_ORDER_CHUNKED</CODE>, bit 5 corresponds to black and bit 0 corresponds to light magenta. For <CODE>CUPS_ORDER_BANDED</CODE> and <CODE>CUPS_ORDER_PLANAR</CODE>, each color plane is encoded separately.</P>
<H3>CUPS_CSPACE_CIELab and CUPS_CSPACE_ICCn</H3>
<P>These colorspaces map a CIE Lab color value with a D65
whitepoint to either a 8- or 16-bit per color chunked
(<CODE>CUPS_ORDER_CHUNKED</CODE>) format; the banded
(<CODE>CUPS_ORDER_BANDED</CODE>) and planar
(<CODE>CUPS_ORDER_PLANAR</CODE>) color orders are not
supported.</P>
<P>These color spaces map a CIE Lab color value with a D65 white point to either a 8- or 16-bit per color chunked (<CODE>CUPS_ORDER_CHUNKED</CODE>) format; the banded (<CODE>CUPS_ORDER_BANDED</CODE>) and planar (<CODE>CUPS_ORDER_PLANAR</CODE>) color orders are not supported.</P>
<P>The values are encoded and decoded using the following
formulas:</P>
<P>The values are encoded and decoded using the following formulas:</P>
<UL>
@@ -647,15 +623,9 @@ formulas:</P>
<H3>CUPS_CSPACE_CIEXYZ</H3>
<P>These colorspaces map a CIE XYZ color value with a D65
whitepoint to either a 8- or 16-bit per color chunked
(<CODE>CUPS_ORDER_CHUNKED</CODE>) format; the banded
(<CODE>CUPS_ORDER_BANDED</CODE>) and planar
(<CODE>CUPS_ORDER_PLANAR</CODE>) color orders are not
supported.</P>
<P>These color spaces map a CIE XYZ color value with a D65 white point to either a 8- or 16-bit per color chunked (<CODE>CUPS_ORDER_CHUNKED</CODE>) format; the banded (<CODE>CUPS_ORDER_BANDED</CODE>) and planar (<CODE>CUPS_ORDER_PLANAR</CODE>) color orders are not supported.</P>
<P>The values are encoded and decoded using the following
formulas:</P>
<P>The values are encoded and decoded using the following formulas:</P>
<UL>
@@ -685,14 +655,21 @@ formulas:</P>
</UL>
<P>The scaling factor for XYZ values is 1/1.1, or 231.8181 for
8-bit values and 59577.2727 for 16-bit values. This allows for a
slight overflow of XYZ values when converting from RGB, improving
accuracy.</P>
<P>The scaling factor for XYZ values is 1/1.1, or 231.8181 for 8-bit values and 59577.2727 for 16-bit values. This allows for a slight overflow of XYZ values when converting from RGB, improving accuracy.</P>
<H2 CLASS="title"><A NAME="HISTORY">Change History</A></H2>
<H3>Changes in CUPS 1.4.7</H3>
<ul>
<li>Greatly improved the detail and now include an example of the bitmap compression.</li>
<li>Added all missing cupsColorSpace values and a separate description of CUPS_CSPACE_RGBW.</li>
</ul>
<H3>Changes in CUPS 1.2.2</H3>
<ul>
@@ -719,20 +696,15 @@ accuracy.</P>
<li>Bumped raster version to 2</li>
<li>Added RGBW colorspace</li>
<li>Added RGBW color space</li>
<li>Added 16 bit per color support</li>
<li>Added cupsNumColors, cupsBorderlessScalingFactor,
cupsPageSize, cupsImagingBBox, cupsInteger, cupsReal,
cupsString, cupsMarkerType, cupsRenderingIntent, and
cupsPageSizeName attributes to the page device
dictionary</li>
<li>Added cupsNumColors, cupsBorderlessScalingFactor, cupsPageSize, cupsImagingBBox, cupsInteger, cupsReal, cupsString, cupsMarkerType, cupsRenderingIntent, and cupsPageSizeName attributes to the page device dictionary</li>
<li>Added raster data compression</li>
<li>Added data type column to device dictionary
documentation.</li>
<li>Added data type column to device dictionary documentation.</li>
</ul>
@@ -740,7 +712,7 @@ accuracy.</P>
<ul>
<li>Added ICC and CIE colorspaces.</li>
<li>Added ICC and CIE color spaces.</li>
</ul>
+1 -1
Ver Arquivo
@@ -17,7 +17,7 @@ to evaluate the stability and compliance of CUPS.</P>
<P>The test software and data files are located in the
<VAR>test</VAR> subdirectory of the source distribution. A script
is provided to compile the <CODE>ipptest</CODE> program and run
is provided to compile the <CODE>ipptool</CODE> program and run
all of the tests that follow, producing a success/fail
report.</P>
+4 -4
Ver Arquivo
@@ -141,7 +141,7 @@ subdirectories for each locale, e.g. "fr" for French, "de" for
German, "fr_ca" for French in Canada, and so forth.</P>
<P>Template files are HTML files with special formatting
characters in them that allow substition of variables and arrays.
characters in them that allow substitution of variables and arrays.
The CUPS CGI programs (<CODE>admin.cgi</CODE>,
<CODE>classes.cgi</CODE>, <CODE>help.cgi</CODE>,
<CODE>jobs.cgi</CODE>, and <CODE>printers.cgi</CODE>) use these
@@ -441,7 +441,7 @@ translated all of the templates, add the locale to the
</TR>
<TR>
<TD>subscription-added.tmpl</TD>
<TD>This template shows "subscription xyz added".</TD>
<TD>This template shows "subscription ... added".</TD>
</TR>
<TR>
<TD>subscription-canceled.tmpl</TD>
@@ -466,7 +466,7 @@ translated all of the templates, add the locale to the
<H3><A NAME="VARIABLE">Inserting Attributes and Values</A></H3>
<P>Template files consist of HTML with variable substitutions for
named inside curley braces "{name}". Variable names are generally
named inside curly braces "{name}". Variable names are generally
the IPP attribute names with the hyphen ("-") replaced by the
underscore ("_") character. For example, the
<TT>job-printer-uri</TT> attribute is renamed to
@@ -518,7 +518,7 @@ in the <CODE>job_id</CODE> array:</P>
&lt;/TABLE&gt;
</PRE>
<P>Arrays can be nested, however all elements within the curley
<P>Arrays can be nested, however all elements within the curly
braces ("{" and "}") are indexed using the innermost array.</P>
<H3>Conditional Tests</H3>
+1 -1
Ver Arquivo
@@ -100,7 +100,7 @@
<LI><EM>Access logging;</EM> the scheduler now supports an AccessLogLevel directive to control what is logged in the access_log file.</LI>
<LI><EM>Configuration files;</EM> the default cupsd.conf file now provides an "authenticated" policy for easy authenticated sharing of printers.</LI>
<LI><EM>Configuration files;</EM> the default cupsd.conf file now provides an "authenticated" policy that can be used to require a username and password to print or cancel a job.</LI>
<LI><EM>Default LogLevel;</EM> the default LogLevel is now "warn" instead of "info".</LI>
+1 -1
Ver Arquivo
@@ -100,7 +100,7 @@ HEIGHT="128" ALT="CUPS"></A></TD>
</TD></TR>
<TR><TD>&nbsp;</TD></TR>
<TR><TD CLASS="trailer">CUPS dan logo CUPS logo adalah merek dagang dari
<A HREF="http://www.apple.com">Apple Inc.</A> Hak cipta CUPS pada 2007-2010 Apple
<A HREF="http://www.apple.com">Apple Inc.</A> Hak cipta CUPS pada 2007-2011 Apple
Inc. Semua hak terpelihara.</TD></TR>
</TABLE>
</BODY>
Arquivo binário não exibido.

Depois

Largura:  |  Altura:  |  Tamanho: 20 KiB

+378
Ver Arquivo
@@ -0,0 +1,378 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="744.09448819"
height="1052.3622047"
id="svg2"
version="1.1"
inkscape:version="0.48.0 r9654"
sodipodi:docname="raster-organization.svg"
inkscape:export-filename="/Users/mike/c/cups-trunk/doc/images/raster-organization.png"
inkscape:export-xdpi="100.04211"
inkscape:export-ydpi="100.04211">
<defs
id="defs4" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="0.80227655"
inkscape:cx="414.35236"
inkscape:cy="794.80623"
inkscape:document-units="px"
inkscape:current-layer="g4208"
showgrid="true"
inkscape:window-width="1089"
inkscape:window-height="815"
inkscape:window-x="308"
inkscape:window-y="0"
inkscape:window-maximized="0">
<inkscape:grid
type="xygrid"
id="grid3979" />
</sodipodi:namedview>
<metadata
id="metadata7">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1">
<rect
style="fill:none;stroke:#000000;stroke-width:0.98624134px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
id="rect2985"
width="359.01376"
height="39.01376"
x="180.49312"
y="52.855301" />
<flowRoot
xml:space="preserve"
style="font-size:20px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans;-inkscape-font-specification:Sans"
id="flowRoot4112"
transform="translate(70.681641,5.4232931)"><flowRegion
id="flowRegion4114"><use
x="0"
y="0"
xlink:href="#rect2985"
id="use4116"
width="744.09448"
height="1052.3622" /></flowRegion><flowPara
id="flowPara4118">Synchronization Word</flowPara></flowRoot> <g
id="g4196">
<rect
style="fill:none;stroke:#000000;stroke-width:1.71552336px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
id="rect3981"
width="358.28448"
height="118.28448"
x="180.85776"
y="133.21994" />
<rect
y="253.5766"
x="181.21442"
height="237.57117"
width="357.57117"
id="rect3983"
style="fill:none;stroke:#000000;stroke-width:2.42882872px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
<flowRoot
xml:space="preserve"
style="font-size:20px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans;-inkscape-font-specification:Sans"
id="flowRoot4120"
transform="translate(106.53711,125.42329)"><flowRegion
id="flowRegion4122"><use
x="0"
y="0"
xlink:href="#rect2985"
id="use4124"
width="744.09448"
height="1052.3622" /></flowRegion><flowPara
id="flowPara4126">Page Header 1</flowPara></flowRoot> <flowRoot
transform="translate(106.53711,295.42329)"
id="flowRoot4128"
style="font-size:20px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans;-inkscape-font-specification:Sans"
xml:space="preserve"><flowRegion
id="flowRegion4130"><use
height="1052.3622"
width="744.09448"
id="use4132"
xlink:href="#rect2985"
y="0"
x="0" /></flowRegion><flowPara
id="flowPara4134">Page Bitmap 1</flowPara></flowRoot> </g>
<g
id="g4208"
transform="translate(4.1127203e-6,510)">
<rect
y="133.21994"
x="180.85776"
height="118.28448"
width="358.28448"
id="rect4210"
style="fill:none;stroke:#000000;stroke-width:1.71552336px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
<rect
style="fill:none;stroke:#000000;stroke-width:2.42882872px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
id="rect4212"
width="357.57117"
height="237.57117"
x="181.21442"
y="253.5766" />
<flowRoot
transform="translate(106.53711,125.42329)"
id="flowRoot4214"
style="font-size:20px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans;-inkscape-font-specification:Sans"
xml:space="preserve"><flowRegion
id="flowRegion4216"><use
height="1052.3622"
width="744.09448"
id="use4218"
xlink:href="#rect2985"
y="0"
x="0" /></flowRegion><flowPara
id="flowPara4220">Page Header N</flowPara></flowRoot> <flowRoot
xml:space="preserve"
style="font-size:20px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans;-inkscape-font-specification:Sans"
id="flowRoot4222"
transform="translate(106.53711,295.42329)"><flowRegion
id="flowRegion4224"><use
x="0"
y="0"
xlink:href="#rect2985"
id="use4226"
width="744.09448"
height="1052.3622" /></flowRegion><flowPara
id="flowPara4228">Page Bitmap N</flowPara></flowRoot> <path
style="fill:none;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:1,2;stroke-dashoffset:0"
d="m 180,92.362183 0,39.999997"
id="path4230"
inkscape:connector-curvature="0"
transform="translate(-4.1127203e-6,-510)" />
<path
inkscape:connector-curvature="0"
id="path4232"
d="m 540,-417.63782 0,40"
style="fill:none;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:1, 2;stroke-dashoffset:0" />
<path
style="fill:none;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:1,2;stroke-dashoffset:0"
d="m 180,492.36218 0,60 -20,10 40,10 -20,10 0,60"
id="path4236"
inkscape:connector-curvature="0"
transform="translate(-4.1127203e-6,-510)"
sodipodi:nodetypes="cccccc" />
<path
sodipodi:nodetypes="cccccc"
inkscape:connector-curvature="0"
id="path4238"
d="m 540,-17.637817 0,60 -20,10 40,10 -20,10 0,59.999997"
style="fill:none;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:1, 2;stroke-dashoffset:0" />
</g>
</g>
</svg>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="744.09448819"
height="1052.3622047"
id="svg2"
version="1.1"
inkscape:version="0.48.0 r9654"
sodipodi:docname="raster-organization.svg"
inkscape:export-filename="/Users/mike/c/cups-trunk/doc/images/raster-organization.png"
inkscape:export-xdpi="100.04211"
inkscape:export-ydpi="100.04211">
<defs
id="defs4" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="0.80227655"
inkscape:cx="414.35236"
inkscape:cy="794.80623"
inkscape:document-units="px"
inkscape:current-layer="g4208"
showgrid="true"
inkscape:window-width="1089"
inkscape:window-height="815"
inkscape:window-x="308"
inkscape:window-y="0"
inkscape:window-maximized="0">
<inkscape:grid
type="xygrid"
id="grid3979" />
</sodipodi:namedview>
<metadata
id="metadata7">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1">
<rect
style="fill:none;stroke:#000000;stroke-width:0.98624134px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
id="rect2985"
width="359.01376"
height="39.01376"
x="180.49312"
y="52.855301" />
<flowRoot
xml:space="preserve"
style="font-size:20px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans;-inkscape-font-specification:Sans"
id="flowRoot4112"
transform="translate(70.681641,5.4232931)"><flowRegion
id="flowRegion4114"><use
x="0"
y="0"
xlink:href="#rect2985"
id="use4116"
width="744.09448"
height="1052.3622" /></flowRegion><flowPara
id="flowPara4118">Synchronization Word</flowPara></flowRoot> <g
id="g4196">
<rect
style="fill:none;stroke:#000000;stroke-width:1.71552336px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
id="rect3981"
width="358.28448"
height="118.28448"
x="180.85776"
y="133.21994" />
<rect
y="253.5766"
x="181.21442"
height="237.57117"
width="357.57117"
id="rect3983"
style="fill:none;stroke:#000000;stroke-width:2.42882872px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
<flowRoot
xml:space="preserve"
style="font-size:20px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans;-inkscape-font-specification:Sans"
id="flowRoot4120"
transform="translate(106.53711,125.42329)"><flowRegion
id="flowRegion4122"><use
x="0"
y="0"
xlink:href="#rect2985"
id="use4124"
width="744.09448"
height="1052.3622" /></flowRegion><flowPara
id="flowPara4126">Page Header 1</flowPara></flowRoot> <flowRoot
transform="translate(106.53711,295.42329)"
id="flowRoot4128"
style="font-size:20px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans;-inkscape-font-specification:Sans"
xml:space="preserve"><flowRegion
id="flowRegion4130"><use
height="1052.3622"
width="744.09448"
id="use4132"
xlink:href="#rect2985"
y="0"
x="0" /></flowRegion><flowPara
id="flowPara4134">Page Bitmap 1</flowPara></flowRoot> </g>
<g
id="g4208"
transform="translate(4.1127203e-6,510)">
<rect
y="133.21994"
x="180.85776"
height="118.28448"
width="358.28448"
id="rect4210"
style="fill:none;stroke:#000000;stroke-width:1.71552336px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
<rect
style="fill:none;stroke:#000000;stroke-width:2.42882872px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
id="rect4212"
width="357.57117"
height="237.57117"
x="181.21442"
y="253.5766" />
<flowRoot
transform="translate(106.53711,125.42329)"
id="flowRoot4214"
style="font-size:20px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans;-inkscape-font-specification:Sans"
xml:space="preserve"><flowRegion
id="flowRegion4216"><use
height="1052.3622"
width="744.09448"
id="use4218"
xlink:href="#rect2985"
y="0"
x="0" /></flowRegion><flowPara
id="flowPara4220">Page Header N</flowPara></flowRoot> <flowRoot
xml:space="preserve"
style="font-size:20px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans;-inkscape-font-specification:Sans"
id="flowRoot4222"
transform="translate(106.53711,295.42329)"><flowRegion
id="flowRegion4224"><use
x="0"
y="0"
xlink:href="#rect2985"
id="use4226"
width="744.09448"
height="1052.3622" /></flowRegion><flowPara
id="flowPara4228">Page Bitmap N</flowPara></flowRoot> <path
style="fill:none;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:1,2;stroke-dashoffset:0"
d="m 180,92.362183 0,39.999997"
id="path4230"
inkscape:connector-curvature="0"
transform="translate(-4.1127203e-6,-510)" />
<path
inkscape:connector-curvature="0"
id="path4232"
d="m 540,-417.63782 0,40"
style="fill:none;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:1, 2;stroke-dashoffset:0" />
<path
style="fill:none;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:1,2;stroke-dashoffset:0"
d="m 180,492.36218 0,60 -20,10 40,10 -20,10 0,60"
id="path4236"
inkscape:connector-curvature="0"
transform="translate(-4.1127203e-6,-510)"
sodipodi:nodetypes="cccccc" />
<path
sodipodi:nodetypes="cccccc"
inkscape:connector-curvature="0"
id="path4238"
d="m 540,-17.637817 0,60 -20,10 40,10 -20,10 0,59.999997"
style="fill:none;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:1, 2;stroke-dashoffset:0" />
</g>
</g>
</svg>

Depois

Largura:  |  Altura:  |  Tamanho: 16 KiB

Arquivo binário não exibido.

Depois

Largura:  |  Altura:  |  Tamanho: 3.5 KiB

+1 -1
Ver Arquivo
@@ -100,7 +100,7 @@ HEIGHT="128" ALT="CUPS"></A></TD>
</TD></TR>
<TR><TD>&nbsp;</TD></TR>
<TR><TD CLASS="trailer">CUPS and the CUPS logo are trademarks of
<A HREF="http://www.apple.com">Apple Inc.</A> CUPS is copyright 2007-2010 Apple
<A HREF="http://www.apple.com">Apple Inc.</A> CUPS is copyright 2007-2011 Apple
Inc. All rights reserved.</TD></TR>
</TABLE>
</BODY>
+1 -1
Ver Arquivo
@@ -100,7 +100,7 @@ HEIGHT="128" ALT="CUPS"></A></TD>
</TD></TR>
<TR><TD>&nbsp;</TD></TR>
<TR><TD CLASS="trailer">CUPS e il logo CUPS sono marchi di
<A HREF="http://www.apple.com">Apple Inc.</A> CUPS è un copyright 2007-2010 di Apple
<A HREF="http://www.apple.com">Apple Inc.</A> CUPS è un copyright 2007-2011 di Apple
Inc. Tutti i diritti sono riservati.</TD></TR>
</TABLE>
</BODY>
+1 -1
Ver Arquivo
@@ -100,7 +100,7 @@ HEIGHT="128" ALT="CUPS"></A></TD>
</TD></TR>
<TR><TD>&nbsp;</TD></TR>
<TR><TD CLASS="trailer">CUPS and the CUPS logo are trademarks of
<A HREF="http://www.apple.com">Apple Inc.</A> CUPS is copyright 2007-2010 Apple
<A HREF="http://www.apple.com">Apple Inc.</A> CUPS is copyright 2007-2011 Apple
Inc. All rights reserved.</TD></TR>
</TABLE>
</BODY>
+1 -1
Ver Arquivo
@@ -101,7 +101,7 @@ HEIGHT="128" ALT="CUPS"></A></TD>
<TR><TD>&nbsp;</TD></TR>
<TR><TD CLASS="trailer">CUPS i logo CUPS
są znakami handlowymi <A HREF="http://www.apple.com">Apple Inc.</A> CUPS
copyright 2007-2010 Apple Inc. Wszystkie prawa zastrzeżone.</TD></TR>
copyright 2007-2011 Apple Inc. Wszystkie prawa zastrzeżone.</TD></TR>
</TABLE>
</BODY>
</HTML>
+1 -1
Ver Arquivo
@@ -97,7 +97,7 @@ HEIGHT="128" ALT="CUPS"></A></TD>
</TD></TR>
<TR><TD>&nbsp;</TD></TR>
<TR><TD CLASS="trailer">CUPS а также логотип CUPS являются зарегистрированными торговыми марками <A HREF="http://www.apple.com">Apple Inc.</A> Авторские права на CUPS принадлежат (2007-2010) компании Apple Inc. Все права защищены.</TD></TR>
<TR><TD CLASS="trailer">CUPS а также логотип CUPS являются зарегистрированными торговыми марками <A HREF="http://www.apple.com">Apple Inc.</A> Авторские права на CUPS принадлежат (2007-2011) компании Apple Inc. Все права защищены.</TD></TR>
</TABLE>
</BODY>
</HTML>
+2 -2
Ver Arquivo
@@ -1,9 +1,9 @@
<!--
"$Id$"
Raster API introduction for the Common UNIX Printing System (CUPS).
Raster API introduction for CUPS.
Copyright 2007-2008 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
+11 -2
Ver Arquivo
@@ -3,7 +3,7 @@
*
* PostScript command filter for CUPS.
*
* Copyright 2008 by Apple Inc.
* Copyright 2008-2011 by Apple Inc.
*
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
@@ -197,7 +197,7 @@ auto_configure(ppd_file_t *ppd, /* I - PPD file */
* Read the response data...
*/
while ((bytes = cupsBackChannelRead(buffer, sizeof(buffer) - 1, 5.0)) > 0)
while ((bytes = cupsBackChannelRead(buffer, sizeof(buffer) - 1, 90.0)) > 0)
{
/*
* Trim whitespace from both ends...
@@ -213,6 +213,8 @@ auto_configure(ppd_file_t *ppd, /* I - PPD file */
for (bufptr = buffer; isspace(*bufptr & 255); bufptr ++);
fprintf(stderr, "DEBUG: Got \"%s\" (%d bytes)\n", bufptr, (int)bytes);
/*
* Skip blank lines...
*/
@@ -220,6 +222,13 @@ auto_configure(ppd_file_t *ppd, /* I - PPD file */
if (!*bufptr)
continue;
/*
* Verify the result is a valid option choice...
*/
if (!ppdFindChoice(option, bufptr))
continue;
/*
* Write out the result and move on to the next option...
*/
+12 -12
Ver Arquivo
@@ -1,9 +1,9 @@
/*
* "$Id$"
*
* GZIP/raw pre-filter for the Common UNIX Printing System (CUPS).
* GZIP/raw pre-filter for CUPS.
*
* Copyright 2007 by Apple Inc.
* Copyright 2007-2011 by Apple Inc.
* Copyright 1993-2007 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
@@ -27,6 +27,7 @@
#include <cups/string.h>
#include <cups/i18n.h>
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
@@ -50,8 +51,9 @@ main(int argc, /* I - Number of command-line arguments */
if (argc != 7)
{
fprintf(stderr, _("Usage: %s job-id user title copies options file\n"),
argv[0]);
_cupsLangPrintf(stderr,
_("Usage: %s job-id user title copies options file\n"),
argv[0]);
return (1);
}
@@ -71,8 +73,8 @@ main(int argc, /* I - Number of command-line arguments */
if ((fp = cupsFileOpen(argv[6], "r")) == NULL)
{
fprintf(stderr, _("ERROR: Unable to open file \"%s\": %s\n"), argv[6],
strerror(errno));
_cupsLangPrintf(stderr, _("ERROR: Unable to open file \"%s\": %s\n"),
argv[6], strerror(errno));
return (1);
}
@@ -80,8 +82,6 @@ main(int argc, /* I - Number of command-line arguments */
* Copy the file to stdout...
*/
setbuf(stdout, NULL);
while (copies > 0)
{
if (!getenv("FINAL_CONTENT_TYPE"))
@@ -90,11 +90,11 @@ main(int argc, /* I - Number of command-line arguments */
cupsFileRewind(fp);
while ((bytes = cupsFileRead(fp, buffer, sizeof(buffer))) > 0)
if (fwrite(buffer, 1, bytes, stdout) < bytes)
if (write(1, buffer, bytes) < bytes)
{
fprintf(stderr,
_("ERROR: Unable to write uncompressed document data: %s\n"),
strerror(ferror(stdout)));
_cupsLangPrintf(stderr,
_("ERROR: Unable to write uncompressed document data: "
"%s\n"), strerror(errno));
cupsFileClose(fp);
return (1);
+20 -26
Ver Arquivo
@@ -353,7 +353,7 @@ gif_get_code(FILE *fp, /* I - File to read from */
* Read in another buffer...
*/
if ((count = gif_get_block (fp, buf + last_byte)) <= 0)
if ((count = gif_get_block(fp, buf + last_byte)) <= 0)
{
/*
* Whoops, no more data!
@@ -582,19 +582,13 @@ gif_read_lzw(FILE *fp, /* I - File to read from */
gif_get_code(fp, 0, 1);
/*
* Wipe the decompressor table...
* Wipe the decompressor table (already mostly 0 due to the calloc above...)
*/
fresh = 1;
for (i = 0; i < clear_code; i ++)
{
table[0][i] = 0;
for (i = 1; i < clear_code; i ++)
table[1][i] = i;
}
for (; i < 4096; i ++)
table[0][i] = table[1][0] = 0;
sp = stack;
@@ -605,29 +599,30 @@ gif_read_lzw(FILE *fp, /* I - File to read from */
fresh = 0;
do
{
firstcode = oldcode = gif_get_code(fp, code_size, 0);
}
while (firstcode == clear_code);
return (firstcode);
return (firstcode & 255);
}
else if (!table)
return (0);
if (sp > stack)
return (*--sp);
return ((*--sp) & 255);
while ((code = gif_get_code (fp, code_size, 0)) >= 0)
while ((code = gif_get_code(fp, code_size, 0)) >= 0)
{
if (code == clear_code)
{
for (i = 0; i < clear_code; i ++)
{
table[0][i] = 0;
table[1][i] = i;
}
/*
* Clear/reset the compression table...
*/
for (; i < 4096; i ++)
table[0][i] = table[1][i] = 0;
memset(table, 0, 2 * sizeof(gif_table_t));
for (i = 1; i < clear_code; i ++)
table[1][i] = i;
code_size = set_code_size + 1;
max_code_size = 2 * clear_code;
@@ -637,12 +632,11 @@ gif_read_lzw(FILE *fp, /* I - File to read from */
firstcode = oldcode = gif_get_code(fp, code_size, 0);
return (firstcode);
return (firstcode & 255);
}
else if (code == end_code)
else if (code == end_code || code > max_code)
{
unsigned char buf[260];
unsigned char buf[260]; /* Block buffer */
if (!gif_eof)
while (gif_get_block(fp, buf) > 0);
@@ -652,7 +646,7 @@ gif_read_lzw(FILE *fp, /* I - File to read from */
incode = code;
if (code >= max_code)
if (code == max_code)
{
*sp++ = firstcode;
code = oldcode;
@@ -686,10 +680,10 @@ gif_read_lzw(FILE *fp, /* I - File to read from */
oldcode = incode;
if (sp > stack)
return (*--sp);
return ((*--sp) & 255);
}
return (code);
return (code & 255);
}
+4 -4
Ver Arquivo
@@ -1,9 +1,9 @@
/*
* "$Id$"
*
* cupsImage zoom routines for the Common UNIX Printing System (CUPS).
* cupsImage zoom routines for CUPS.
*
* Copyright 2007 by Apple Inc.
* Copyright 2007-2011 by Apple Inc.
* Copyright 1993-2006 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
@@ -136,7 +136,7 @@ _cupsImageZoomNew(
z->ystep = z->height / z->ysize;
z->yincr = 1;
z->instep = z->xstep * z->depth;
z->inincr = z->xincr * z->depth;
z->inincr = /* z->xincr * */ z->depth; /* z->xincr is always 1 */
if (z->width < img->ysize)
z->xmax = z->width;
@@ -163,7 +163,7 @@ _cupsImageZoomNew(
z->ystep = z->height / z->ysize;
z->yincr = 1;
z->instep = z->xstep * z->depth;
z->inincr = z->xincr * z->depth;
z->inincr = /* z->xincr * */ z->depth; /* z->xincr is always 1 */
if (z->width < img->xsize)
z->xmax = z->width;
+13
Ver Arquivo
@@ -0,0 +1,13 @@
LIBRARY libcupsimage2
VERSION 2.2
EXPORTS
cupsRasterClose
cupsRasterErrorString
cupsRasterInterpretPPD
cupsRasterOpen
cupsRasterReadHeader
cupsRasterReadHeader2
cupsRasterReadPixels
cupsRasterWriteHeader
cupsRasterWriteHeader2
cupsRasterWritePixels
+10 -15
Ver Arquivo
@@ -2420,18 +2420,6 @@ set_pstops_options(
doc->new_bounding_box[2] = INT_MIN;
doc->new_bounding_box[3] = INT_MIN;
/*
* See what the source content type is. When printing PostScript content we
* want to do scaling and orientation, but otherwise we don't want to change
* anything...
*/
if ((content_type = getenv("CONTENT_TYPE")) == NULL)
content_type = "application/postscript";
if (!strcasecmp(content_type, "application/postscript"))
Orientation = 0;
/*
* AP_FIRSTPAGE_* and the corresponding non-first-page options.
*/
@@ -2526,6 +2514,9 @@ set_pstops_options(
* (Only for original PostScript content)
*/
if ((content_type = getenv("CONTENT_TYPE")) == NULL)
content_type = "application/postscript";
if (!strcasecmp(content_type, "application/postscript"))
{
if ((val = cupsGetOption("fitplot", num_options, options)) != NULL &&
@@ -2936,9 +2927,6 @@ start_nup(pstops_doc_t *doc, /* I - Document information */
else if (doc->number_up > 1 || doc->fitplot)
doc_printf(doc, "%.1f %.1f translate\n", PageLeft, PageBottom);
if (doc->mirror)
doc_printf(doc, "%.1f 0.0 translate -1 1 scale\n", PageWidth);
switch (doc->number_up)
{
default :
@@ -3288,6 +3276,13 @@ start_nup(pstops_doc_t *doc, /* I - Document information */
bboxx + margin, bboxy + margin,
bboxw - 2 * margin, bboxl - 2 * margin);
}
/*
* Mirror the page as needed...
*/
if (doc->mirror)
doc_printf(doc, "%.1f 0.0 translate -1 1 scale\n", PageWidth);
}
+168 -98
Ver Arquivo
@@ -3,7 +3,7 @@
*
* Raster file routines for CUPS.
*
* Copyright 2007-2010 by Apple Inc.
* Copyright 2007-2011 by Apple Inc.
* Copyright 1997-2006 by Easy Software Products.
*
* This file is part of the CUPS Imaging library.
@@ -19,7 +19,7 @@
* Contents:
*
* cupsRasterClose() - Close a raster stream.
* cupsRasterOpen() - Open a raster stream.
* cupsRasterOpen() - Open a raster stream using a file descriptor.
* cupsRasterReadHeader() - Read a raster page header and store it in a
* version 1 page header structure.
* cupsRasterReadHeader2() - Read a raster page header and store it in a
@@ -30,14 +30,14 @@
* cupsRasterWriteHeader2() - Write a raster page header from a version 2
* page header structure.
* cupsRasterWritePixels() - Write raster pixels.
* cups_raster_read() - Read through the raster buffer.
* cups_raster_read_header() - Read a raster page header.
* cups_raster_read() - Read through the raster buffer.
* cups_raster_update() - Update the raster header and row count for the
* current page.
* cups_raster_write() - Write a row of raster data...
* cups_read() - Read bytes from a file.
* cups_raster_write() - Write a row of compressed raster data...
* cups_read_fd() - Read bytes from a file.
* cups_swap() - Swap bytes in raster data...
* cups_write() - Write bytes to a file.
* cups_write_fd() - Write bytes to a file.
*/
/*
@@ -45,13 +45,9 @@
*/
#include "image-private.h"
#include <cups/debug.h>
#include <stdlib.h>
#include <errno.h>
#include <cups/string.h>
#if defined(WIN32) || defined(__EMX__)
# include <io.h>
# include <winsock2.h> /* for htonl() definition */
#else
# include <unistd.h>
#endif /* WIN32 || __EMX__ */
@@ -61,10 +57,13 @@
* Private structures...
*/
typedef ssize_t (*_cups_raster_iocb_t)(void *ctx, unsigned char *buffer, size_t length);
struct _cups_raster_s /**** Raster stream data ****/
{
unsigned sync; /* Sync word from start of stream */
int fd; /* File descriptor */
void *ctx; /* File descriptor */
_cups_raster_iocb_t iocb; /* IO callback */
cups_mode_t mode; /* Read/write mode */
cups_page_header2_t header; /* Raster header for current page */
int count, /* Current row run-length count */
@@ -78,7 +77,7 @@ struct _cups_raster_s /**** Raster stream data ****/
unsigned char *buffer, /* Read/write buffer */
*bufptr, /* Current (read) position in buffer */
*bufend; /* End of current (read) buffer */
int bufsize; /* Buffer size */
size_t bufsize; /* Buffer size */
};
@@ -86,14 +85,16 @@ struct _cups_raster_s /**** Raster stream data ****/
* Local functions...
*/
static int cups_raster_io(cups_raster_t *r, unsigned char *buf, int bytes);
static unsigned cups_raster_read_header(cups_raster_t *r);
static int cups_raster_read(cups_raster_t *r, unsigned char *buf,
int bytes);
static void cups_raster_update(cups_raster_t *r);
static int cups_raster_write(cups_raster_t *r, const unsigned char *pixels);
static int cups_read(int fd, unsigned char *buf, int bytes);
static int cups_raster_write(cups_raster_t *r,
const unsigned char *pixels);
static ssize_t cups_read_fd(void *ctx, unsigned char *buf, size_t bytes);
static void cups_swap(unsigned char *buf, int bytes);
static int cups_write(int fd, const unsigned char *buf, int bytes);
static ssize_t cups_write_fd(void *ctx, unsigned char *buf, size_t bytes);
/*
@@ -120,7 +121,7 @@ cupsRasterClose(cups_raster_t *r) /* I - Stream to close */
/*
* 'cupsRasterOpen()' - Open a raster stream.
* 'cupsRasterOpen()' - Open a raster stream using a file descriptor.
*
* This function associates a raster stream with the given file descriptor.
* For most printer driver filters, "fd" will be 0 (stdin). For most raster
@@ -128,13 +129,15 @@ cupsRasterClose(cups_raster_t *r) /* I - Stream to close */
* (stdout).
*
* When writing raster data, the @code CUPS_RASTER_WRITE@ or
* @code CUPS_RASTER_WRITE_COMPRESS@ mode can be used - compressed output
* is generally 25-50% smaller but adds a 100-300% execution time overhead.
* @code CUPS_RASTER_WRITE_COMPRESS@ mode can be used - compressed output is
* generally 25-50% smaller but adds a 100-300% execution time overhead.
*/
cups_raster_t * /* O - New stream */
cupsRasterOpen(int fd, /* I - File descriptor */
cups_mode_t mode) /* I - Mode - @code CUPS_RASTER_READ@, @code CUPS_RASTER_WRITE@, or @code CUPS_RASTER_WRITE_COMPRESSED@ */
cups_mode_t mode) /* I - Mode - @code CUPS_RASTER_READ@,
@code CUPS_RASTER_WRITE@, or
@code CUPS_RASTER_WRITE_COMPRESSED@ */
{
cups_raster_t *r; /* New stream */
@@ -148,8 +151,9 @@ cupsRasterOpen(int fd, /* I - File descriptor */
return (NULL);
}
r->fd = fd;
r->mode = mode == CUPS_RASTER_WRITE_COMPRESSED ? CUPS_RASTER_WRITE : mode;
r->ctx = (void *)((intptr_t)fd);
r->iocb = mode == CUPS_RASTER_READ ? cups_read_fd : cups_write_fd;
r->mode = mode;
if (mode == CUPS_RASTER_READ)
{
@@ -157,7 +161,8 @@ cupsRasterOpen(int fd, /* I - File descriptor */
* Open for read - get sync word...
*/
if (!cups_read(r->fd, (unsigned char *)&(r->sync), sizeof(r->sync)))
if (cups_raster_io(r, (unsigned char *)&(r->sync), sizeof(r->sync)) !=
sizeof(r->sync))
{
_cupsRasterAddError("Unable to read header from raster stream: %s\n",
strerror(errno));
@@ -194,15 +199,20 @@ cupsRasterOpen(int fd, /* I - File descriptor */
* Open for write - put sync word...
*/
if (mode == CUPS_RASTER_WRITE_COMPRESSED)
switch (mode)
{
r->compressed = 1;
r->sync = CUPS_RASTER_SYNCv2;
}
else
r->sync = CUPS_RASTER_SYNC;
default :
case CUPS_RASTER_WRITE :
r->sync = CUPS_RASTER_SYNC;
break;
if (cups_write(r->fd, (unsigned char *)&(r->sync), sizeof(r->sync))
case CUPS_RASTER_WRITE_COMPRESSED :
r->compressed = 1;
r->sync = CUPS_RASTER_SYNCv2;
break;
}
if (cups_raster_io(r, (unsigned char *)&(r->sync), sizeof(r->sync))
< sizeof(r->sync))
{
_cupsRasterAddError("Unable to write raster stream header: %s\n",
@@ -240,7 +250,7 @@ cupsRasterReadHeader(
if (!cups_raster_read_header(r))
return (0);
/*
* Copy the header to the user-supplied buffer...
*/
@@ -269,7 +279,7 @@ cupsRasterReadHeader2(
if (!cups_raster_read_header(r))
return (0);
/*
* Copy the header to the user-supplied buffer...
*/
@@ -313,17 +323,17 @@ cupsRasterReadPixels(cups_raster_t *r, /* I - Raster stream */
r->remaining -= len / r->header.cupsBytesPerLine;
if (!cups_read(r->fd, p, len))
if (cups_raster_io(r, p, len) < (ssize_t)len)
return (0);
/*
* Swap bytes as needed...
*/
if ((r->header.cupsBitsPerColor == 16 ||
if (r->swapped &&
(r->header.cupsBitsPerColor == 16 ||
r->header.cupsBitsPerPixel == 12 ||
r->header.cupsBitsPerPixel == 16) &&
r->swapped)
r->header.cupsBitsPerPixel == 16))
cups_swap(p, len);
/*
@@ -354,7 +364,7 @@ cupsRasterReadPixels(cups_raster_t *r, /* I - Raster stream */
ptr = r->pixels;
/*
* Read using a modified TIFF "packbits" compression...
* Read using a modified PackBits compression...
*/
if (!cups_raster_read(r, &byte, 1))
@@ -464,7 +474,7 @@ cupsRasterReadPixels(cups_raster_t *r, /* I - Raster stream */
* Copy fragment from buffer...
*/
if ((bytes = r->pend - r->pcurrent) > remaining)
if ((unsigned)(bytes = r->pend - r->pcurrent) > remaining)
bytes = remaining;
memcpy(p, r->pcurrent, bytes);
@@ -494,13 +504,13 @@ cupsRasterReadPixels(cups_raster_t *r, /* I - Raster stream */
*
* @deprecated@
*/
unsigned /* O - 1 on success, 0 on failure */
cupsRasterWriteHeader(
cups_raster_t *r, /* I - Raster stream */
cups_page_header_t *h) /* I - Raster page header */
{
if (r == NULL || r->mode != CUPS_RASTER_WRITE)
if (r == NULL || r->mode == CUPS_RASTER_READ)
return (0);
/*
@@ -517,8 +527,8 @@ cupsRasterWriteHeader(
* Write the raster header...
*/
return (cups_write(r->fd, (unsigned char *)&(r->header), sizeof(r->header))
> 0);
return (cups_raster_io(r, (unsigned char *)&(r->header), sizeof(r->header))
== sizeof(r->header));
}
@@ -530,13 +540,13 @@ cupsRasterWriteHeader(
*
* @since CUPS 1.2/Mac OS X 10.5@
*/
unsigned /* O - 1 on success, 0 on failure */
cupsRasterWriteHeader2(
cups_raster_t *r, /* I - Raster stream */
cups_page_header2_t *h) /* I - Raster page header */
{
if (r == NULL || r->mode != CUPS_RASTER_WRITE)
if (r == NULL || r->mode == CUPS_RASTER_READ)
return (0);
/*
@@ -552,8 +562,8 @@ cupsRasterWriteHeader2(
* Write the raster header...
*/
return (cups_write(r->fd, (unsigned char *)&(r->header), sizeof(r->header))
> 0);
return (cups_raster_io(r, (unsigned char *)&(r->header), sizeof(r->header))
== sizeof(r->header));
}
@@ -577,18 +587,65 @@ cupsRasterWritePixels(cups_raster_t *r, /* I - Raster stream */
DEBUG_printf(("cupsRasterWritePixels(r=%p, p=%p, len=%u), remaining=%u\n",
r, p, len, r->remaining));
if (r == NULL || r->mode != CUPS_RASTER_WRITE || r->remaining == 0)
if (r == NULL || r->mode == CUPS_RASTER_READ || r->remaining == 0)
return (0);
if (!r->compressed)
{
/*
* Without compression, just write the raster data raw...
* Without compression, just write the raster data raw unless the data needs
* to be swapped...
*/
r->remaining -= len / r->header.cupsBytesPerLine;
return (cups_write(r->fd, p, len));
if (r->swapped &&
(r->header.cupsBitsPerColor == 16 ||
r->header.cupsBitsPerPixel == 12 ||
r->header.cupsBitsPerPixel == 16))
{
unsigned char *bufptr; /* Pointer into write buffer */
unsigned count; /* Remaining count */
/*
* Allocate a write buffer as needed...
*/
if ((size_t)len > r->bufsize)
{
if (r->buffer)
bufptr = realloc(r->buffer, len);
else
bufptr = malloc(len);
if (!bufptr)
return (0);
r->buffer = bufptr;
r->bufsize = len;
}
/*
* Byte swap the pixels...
*/
for (bufptr = r->buffer, count = len; count > 1; count -= 2, bufptr += 2)
{
bufptr[1] = *p++;
bufptr[0] = *p++;
}
if (count) /* This should never happen... */
*bufptr = *p;
/*
* Write the byte-swapped buffer...
*/
return (cups_raster_io(r, r->buffer, len));
}
else
return (cups_raster_io(r, p, len));
}
/*
@@ -760,6 +817,37 @@ cups_raster_read_header(
}
/*
* 'cups_raster_io()' - Read/write bytes from a context, handling interruptions.
*/
static int /* O - Bytes read or -1 */
cups_raster_io(cups_raster_t *r, /* I - Raster stream */
unsigned char *buf, /* I - Buffer for read/write */
int bytes) /* I - Number of bytes to read/write */
{
ssize_t count; /* Number of bytes read/written */
size_t total; /* Total bytes read/written */
DEBUG_printf(("4cups_raster_io(r=%p, buf=%p, bytes=%d)", r, buf, bytes));
for (total = 0; total < bytes; total += count, buf += count)
{
count = (*r->iocb)(r->ctx, buf, bytes - total);
DEBUG_printf(("5cups_raster_io: count=%d, total=%d", (int)count,
(int)total));
if (count == 0)
return (0);
else if (count < 0)
return (-1);
}
return ((int)total);
}
/*
* 'cups_raster_read()' - Read through the raster buffer.
*/
@@ -777,7 +865,7 @@ cups_raster_read(cups_raster_t *r, /* I - Raster stream */
DEBUG_printf(("cups_raster_read(r=%p, buf=%p, bytes=%d)\n", r, buf, bytes));
if (!r->compressed)
return (cups_read(r->fd, buf, bytes));
return (cups_raster_io(r, buf, bytes));
/*
* Allocate a read buffer as needed...
@@ -785,7 +873,7 @@ cups_raster_read(cups_raster_t *r, /* I - Raster stream */
count = 2 * r->header.cupsBytesPerLine;
if (count > r->bufsize)
if ((size_t)count > r->bufsize)
{
int offset = r->bufptr - r->buffer; /* Offset to current start of buffer */
int end = r->bufend - r->buffer; /* Offset to current end of buffer */
@@ -826,7 +914,7 @@ cups_raster_read(cups_raster_t *r, /* I - Raster stream */
* Read into the raster buffer and then copy...
*/
remaining = cups_read(r->fd, r->buffer, r->bufsize);
remaining = (*r->iocb)(r->ctx, r->buffer, r->bufsize);
if (remaining <= 0)
return (0);
@@ -839,7 +927,7 @@ cups_raster_read(cups_raster_t *r, /* I - Raster stream */
* Read directly into "buf"...
*/
count = cups_read(r->fd, buf, count);
count = (*r->iocb)(r->ctx, buf, count);
if (count <= 0)
return (0);
@@ -1047,7 +1135,7 @@ cups_raster_write(
*/
count = r->header.cupsBytesPerLine * 2;
if (count > r->bufsize)
if ((size_t)count > r->bufsize)
{
if (r->buffer)
wptr = realloc(r->buffer, count);
@@ -1119,7 +1207,7 @@ cups_raster_write(
count ++;
ptr += bpp;
}
*wptr++ = 257 - count;
count *= bpp;
@@ -1128,39 +1216,29 @@ cups_raster_write(
}
}
return (cups_write(r->fd, r->buffer, wptr - r->buffer));
return (cups_raster_io(r, r->buffer, wptr - r->buffer));
}
/*
* 'cups_read()' - Read bytes from a file.
* 'cups_read_fd()' - Read bytes from a file.
*/
static int /* O - Bytes read or -1 */
cups_read(int fd, /* I - File descriptor */
unsigned char *buf, /* I - Buffer for read */
int bytes) /* I - Number of bytes to read */
static ssize_t /* O - Bytes read or -1 */
cups_read_fd(void *ctx, /* I - File descriptor as pointer */
unsigned char *buf, /* I - Buffer for read */
size_t bytes) /* I - Maximum number of bytes to read */
{
int count, /* Number of bytes read */
total; /* Total bytes read */
int fd = (int)((intptr_t)ctx);
/* File descriptor */
ssize_t count; /* Number of bytes read */
for (total = 0; total < bytes; total += count, buf += count)
{
count = read(fd, buf, bytes - total);
while ((count = read(fd, buf, bytes)) < 0)
if (errno != EINTR && errno != EAGAIN)
return (-1);
if (count == 0)
return (0);
else if (count < 0)
{
if (errno == EINTR)
count = 0;
else
return (-1);
}
}
return (total);
return (count);
}
@@ -1191,32 +1269,24 @@ cups_swap(unsigned char *buf, /* I - Buffer to swap */
/*
* 'cups_write()' - Write bytes to a file.
* 'cups_write_fd()' - Write bytes to a file.
*/
static int /* O - Bytes written or -1 */
cups_write(int fd, /* I - File descriptor */
const unsigned char *buf, /* I - Bytes to write */
int bytes) /* I - Number of bytes to write */
static ssize_t /* O - Bytes written or -1 */
cups_write_fd(void *ctx, /* I - File descriptor pointer */
unsigned char *buf, /* I - Bytes to write */
size_t bytes) /* I - Number of bytes to write */
{
int count, /* Number of bytes written */
total; /* Total bytes written */
int fd = (int)((intptr_t)ctx);
/* File descriptor */
ssize_t count; /* Number of bytes written */
for (total = 0; total < bytes; total += count, buf += count)
{
count = write(fd, buf, bytes - total);
while ((count = write(fd, buf, bytes)) < 0)
if (errno != EINTR && errno != EAGAIN)
return (-1);
if (count < 0)
{
if (errno == EINTR)
count = 0;
else
return (-1);
}
}
return (total);
return (count);
}
+75 -81
Ver Arquivo
@@ -1,9 +1,9 @@
/*
* "$Id$"
*
* Raster test program routines for the Common UNIX Printing System (CUPS).
* Raster test program routines for CUPS.
*
* Copyright 2007-2008 by Apple Inc.
* Copyright 2007-2011 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
@@ -19,6 +19,7 @@
* main() - Test the raster functions.
* do_ppd_tests() - Test the default option commands in a PPD file.
* do_ps_tests() - Test standard PostScript commands.
* do_ras_file() - Test reading of a raster file.
* do_raster_tests() - Test reading and writing of raster data.
* print_changes() - Print differences in the page header.
*/
@@ -28,8 +29,12 @@
*/
#include "image-private.h"
#include <stdlib.h>
#include <cups/string.h>
#ifdef WIN32
# include <io.h>
#else
# include <unistd.h>
# include <fcntl.h>
#endif /* WIN32 */
/*
@@ -195,6 +200,7 @@ static cups_page_header2_t setpagedevice_header =
static int do_ppd_tests(const char *filename, int num_options,
cups_option_t *options);
static int do_ps_tests(void);
static int do_ras_file(const char *filename);
static int do_raster_tests(cups_mode_t mode);
static void print_changes(cups_page_header2_t *header,
cups_page_header2_t *expected);
@@ -209,6 +215,7 @@ main(int argc, /* I - Number of command-line args */
char *argv[]) /* I - Command-line arguments */
{
int errors; /* Number of errors */
const char *ext; /* Filename extension */
if (argc == 1)
@@ -240,6 +247,7 @@ main(int argc, /* I - Number of command-line args */
else
{
puts("Usage: testraster [-o name=value ...] [filename.ppd ...]");
puts(" testraster [filename.ras ...]");
return (1);
}
}
@@ -247,11 +255,23 @@ main(int argc, /* I - Number of command-line args */
else
{
puts("Usage: testraster [-o name=value ...] [filename.ppd ...]");
puts(" testraster [filename.ras ...]");
return (1);
}
}
else if ((ext = strrchr(argv[i], '.')) != NULL)
{
if (!strcmp(ext, ".ppd"))
errors += do_ppd_tests(argv[i], num_options, options);
else
errors += do_ras_file(argv[i]);
}
else
errors += do_ppd_tests(argv[i], num_options, options);
{
puts("Usage: testraster [-o name=value ...] [filename.ppd ...]");
puts(" testraster [filename.ras ...]");
return (1);
}
}
cupsFreeOptions(num_options, options);
@@ -353,7 +373,7 @@ do_ps_tests(void)
}
else
puts("PASS");
fputs("_cupsRasterExecPS(\"roll\"): ", stdout);
fflush(stdout);
@@ -432,92 +452,66 @@ do_ps_tests(void)
else
puts("PASS");
#if 0
fputs("_cupsRasterExecPS(\"\"): ", stdout);
fflush(stdout);
return (errors);
}
if (_cupsRasterExecPS(&header, &preferred_bits,
""))
{
puts("FAIL (error from function)");
errors ++;
}
else if (header.)
{
printf("FAIL ()\n");
errors ++;
}
else
puts("PASS");
fputs("_cupsRasterExecPS(\"\"): ", stdout);
fflush(stdout);
/*
* 'do_ras_file()' - Test reading of a raster file.
*/
if (_cupsRasterExecPS(&header, &preferred_bits,
""))
{
puts("FAIL (error from function)");
errors ++;
}
else if (header.)
{
printf("FAIL ()\n");
errors ++;
}
else
puts("PASS");
static int /* O - Number of errors */
do_ras_file(const char *filename) /* I - Filename */
{
unsigned y; /* Looping vars */
int fd; /* File descriptor */
cups_raster_t *ras; /* Raster stream */
cups_page_header2_t header; /* Page header */
unsigned char *data; /* Raster data */
int errors = 0; /* Number of errors */
unsigned pages = 0; /* Number of pages */
fputs("_cupsRasterExecPS(\"\"): ", stdout);
fflush(stdout);
if (_cupsRasterExecPS(&header, &preferred_bits,
""))
if ((fd = open(filename, O_RDONLY)) < 0)
{
puts("FAIL (error from function)");
errors ++;
printf("%s: %s\n", filename, strerror(errno));
return (1);
}
else if (header.)
{
printf("FAIL ()\n");
errors ++;
}
else
puts("PASS");
fputs("_cupsRasterExecPS(\"\"): ", stdout);
fflush(stdout);
if ((ras = cupsRasterOpen(fd, CUPS_RASTER_READ)) == NULL)
{
printf("%s: cupsRasterOpen failed.\n", filename);
close(fd);
return (1);
}
if (_cupsRasterExecPS(&header, &preferred_bits,
""))
{
puts("FAIL (error from function)");
errors ++;
}
else if (header.)
{
printf("FAIL ()\n");
errors ++;
}
else
puts("PASS");
printf("%s:\n", filename);
fputs("_cupsRasterExecPS(\"\"): ", stdout);
fflush(stdout);
while (cupsRasterReadHeader2(ras, &header))
{
pages ++;
data = malloc(header.cupsBytesPerLine);
if (_cupsRasterExecPS(&header, &preferred_bits,
""))
{
puts("FAIL (error from function)");
errors ++;
printf(" Page %u: %ux%ux%u@%ux%udpi", pages,
header.cupsWidth, header.cupsHeight, header.cupsBitsPerPixel,
header.HWResolution[0], header.HWResolution[1]);
fflush(stdout);
for (y = 0; y < header.cupsHeight; y ++)
if (cupsRasterReadPixels(ras, data, header.cupsBytesPerLine) <
header.cupsBytesPerLine)
break;
if (y < header.cupsHeight)
printf(" ERROR AT LINE %d\n", y);
else
putchar('\n');
free(data);
}
else if (header.)
{
printf("FAIL ()\n");
errors ++;
}
else
puts("PASS");
#endif /* 0 */
cupsRasterClose(ras);
close(fd);
return (errors);
}
@@ -545,7 +539,7 @@ do_raster_tests(cups_mode_t mode) /* O - Write mode */
printf("cupsRasterOpen(%s): ",
mode == CUPS_RASTER_WRITE ? "CUPS_RASTER_WRITE" :
"CUPS_RASTER_WRITE_COMPRESSED");
"CUPS_RASTER_WRITE_COMPRESSED");
fflush(stdout);
if ((fp = fopen("test.raster", "wb")) == NULL)
+24 -7
Ver Arquivo
@@ -1,9 +1,9 @@
.\"
.\" "$Id$"
.\"
.\" cups-driverd man page for the Common UNIX Printing System (CUPS).
.\" cups-driverd man page for CUPS.
.\"
.\" Copyright 2007-2009 by Apple Inc.
.\" Copyright 2007-2011 by Apple Inc.
.\" Copyright 1997-2006 by Easy Software Products.
.\"
.\" These coded instructions, statements, and computer programs are the
@@ -12,7 +12,7 @@
.\" 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-driverd 8 "CUPS" "16 June 2008" "Apple Inc."
.TH cups-driverd 8 "CUPS" "6 January 2011" "Apple Inc."
.SH NAME
cups-driverd \- cups driver daemon
.SH SYNOPSIS
@@ -49,7 +49,7 @@ and may be compressed using the \fIgzip(1)\fR program. Driver
programs must implement the command-line interface shown in the
next section.
.SS DRIVER PROGRAMS
Driver programs provide an interface to dynamically-generated PPD
Driver programs provide a interface to dynamically-generated PPD
files. The following arguments are currently defined:
.TP 5
drivername list
@@ -59,12 +59,20 @@ Lists the supported PPD files to stdout.
drivername cat ppdname
.br
Writes the named PPD file to stdout.
.PP
Driver programs MUST NOT query hardware or make other long-term operations that
would delay the return of a driver list. See the NOTES section below for
specific recommendations.
.SS LISTING FILES (drivername list)
When run with the single argument "list", the program must list
the available PPD files it can generate to stdout using the
following format:
.nf
"drivername:ppdname" language "make" "make and model"
"drivername:ppdname" language "make" "make and model" "1284 device id"
"drivername:ppdname" language "make" "make and model" "1284 device id" "(PPD product)"
"drivername:ppdname" language "make" "make and model" "1284 device id" "(PPD product)" "PostScript version"
"drivername:ppdname" language "make" "make and model" "1284 device id" "(PPD product)" "PostScript version" "type"
.fi
.LP
\fIDrivername\fR is the name of the driver program. \fIPpdname\fR
@@ -73,7 +81,11 @@ the locale associated with the default language of the PPD file,
typically "en". \fIMake\fR is the Manufacturer name from the PPD
file. \fIMake and model\fR is the NickName name from the PPD
file. \fI1284 device id\fR is the 1284DeviceId from the PPD file,
if any.
if any. \fI(PPD product)\fR is the Product string as it would appear in the PPD
file or from a PostScript query. \fIPostScript version\fR is the PSVersion
string as it would appear in the PPD file or from a PostScript query. \fIType\fR
is "postscript" for PostScript printers, "pdf" for PDF printers, "raster" for
raster printers, or "fax" for facsimile devices.
.SS WRITING FILES (drivername cat ppdname)
When the driver program is run with the "cat ppdname" arguments,
it must write the named PPD file to stdout, uncompressed. If the
@@ -94,12 +106,17 @@ Error messages
INFO: [drivername]
.br
Informational messages
.SH NOTES
Due to performance considerations, driver programs have been officially
deprecated and should not be used for new development. Currently only the
CUPS web interface and \fIlpinfo(8)\fR command will request lists from all
driver programs.
.SH SEE ALSO
cupsd(8), cupsd.conf(5), cupstestppd(1),
cupsd(8), cupsd.conf(5), cupstestppd(1), lpinfo(8),
.br
http://localhost:631/help
.SH COPYRIGHT
Copyright 2007-2009 by Apple Inc.
Copyright 2007-2011 by Apple Inc.
.\"
.\" End of "$Id$".
.\"
+8 -6
Ver Arquivo
@@ -1,9 +1,9 @@
.\"
.\" "$Id: cupsctl.man 8421 2009-03-09 21:59:55Z mike $"
.\" "$Id: cupsctl.man 9470 2011-01-11 07:05:58Z mike $"
.\"
.\" cupsctl man page for the Common UNIX Printing System (CUPS).
.\" cupsctl man page for CUPS.
.\"
.\" Copyright 2007-2009 by Apple Inc.
.\" Copyright 2007-2011 by Apple Inc.
.\" Copyright 2007 by Easy Software Products.
.\"
.\" These coded instructions, statements, and computer programs are the
@@ -12,7 +12,7 @@
.\" 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 cupsctl 8 "CUPS" "5 July 2007" "Apple Inc."
.TH cupsctl 8 "CUPS" "10 January 2011" "Apple Inc."
.SH NAME
cupsctl \- configure cupsd.conf options
.SH SYNOPSIS
@@ -94,12 +94,14 @@ Enable printing using the file: pseudo-device:
.nf
cupsctl FileDevice=Yes
.fi
.SH KNOWN ISSUES
You cannot set the Listen or Port directives using \fIcupsctl\fR.
.SH SEE ALSO
\fIcupsd.conf(5)\fR, \fIcupsd(8)\fR,
.br
http://localhost:631/help
.SH COPYRIGHT
Copyright 2007-2009 by Apple Inc.
Copyright 2007-2011 by Apple Inc.
.\"
.\" End of "$Id: cupsctl.man 8421 2009-03-09 21:59:55Z mike $".
.\" End of "$Id: cupsctl.man 9470 2011-01-11 07:05:58Z mike $".
.\"
+10 -11
Ver Arquivo
@@ -1,9 +1,9 @@
.\"
.\" "$Id: lp.man 9282 2010-08-31 15:56:40Z mike $"
.\" "$Id: lp.man 9665 2011-03-31 18:54:19Z mike $"
.\"
.\" lp man page for the Common UNIX Printing System (CUPS).
.\" lp man page for CUPS.
.\"
.\" Copyright 2007-2010 by Apple Inc.
.\" Copyright 2007-2011 by Apple Inc.
.\" Copyright 1997-2006 by Easy Software Products.
.\"
.\" These coded instructions, statements, and computer programs are the
@@ -12,7 +12,7 @@
.\" 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 lp 1 "CUPS" "31 August 2010" "Apple Inc."
.TH lp 1 "CUPS" "31 March 2011" "Apple Inc."
.SH NAME
lp - print files
.SH SYNOPSIS
@@ -142,11 +142,10 @@ Submits jobs as \fIusername\fR.
.TP 5
-H resume
.br
Specifies when the job should be printed. A value of
\fIimmediate\fR will print the file immediately, a value of
\fIhold\fR will hold the job indefinitely, and a time value
(HH:MM) will hold the job until the specified time. Use a value
of \fIresume\fR with the \fI-i\fR option to resume a held job.
Specifies when the job should be printed. A value of \fIimmediate\fR will print
the file immediately, a value of \fIhold\fR will hold the job indefinitely, and
a UTC time value (HH:MM) will hold the job until the specified UTC (not local)
time. Use a value of \fIresume\fR with the \fI-i\fR option to resume a held job.
Use a value of \fIrestart\fR with the \fI-i\fR option to restart
a completed job.
.TP 5
@@ -257,7 +256,7 @@ is highest priority).
.br
http://localhost:631/help
.SH COPYRIGHT
Copyright 2007-2010 by Apple Inc.
Copyright 2007-2011 by Apple Inc.
.\"
.\" End of "$Id: lp.man 9282 2010-08-31 15:56:40Z mike $".
.\" End of "$Id: lp.man 9665 2011-03-31 18:54:19Z mike $".
.\"
+7 -7
Ver Arquivo
@@ -1,9 +1,9 @@
.\"
.\" "$Id: lpadmin.man 9291 2010-09-01 15:51:59Z mike $"
.\" "$Id: lpadmin.man 9473 2011-01-11 16:28:51Z mike $"
.\"
.\" lpadmin man page for the Common UNIX Printing System (CUPS).
.\" lpadmin man page for CUPS.
.\"
.\" Copyright 2007-2010 by Apple Inc.
.\" Copyright 2007-2011 by Apple Inc.
.\" Copyright 1997-2006 by Easy Software Products.
.\"
.\" These coded instructions, statements, and computer programs are the
@@ -12,7 +12,7 @@
.\" 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 lpadmin 8 "CUPS" "1 September 2010" "Apple Inc."
.TH lpadmin 8 "CUPS" "7 January 2011" "Apple Inc."
.SH NAME
lpadmin \- configure cups printers and classes
.SH SYNOPSIS
@@ -132,7 +132,7 @@ classes.
-o printer-is-shared=true/false
.br
Sets the destination to shared/published or unshared/unpublished.
Shared/published destinations are publically announced by the server
Shared/published destinations are publicly announced by the server
on the LAN based on the browsing configuration in
\fBcupsd.conf\fR, while unshared/unpublished destinations are not
announced. The default value is "true".
@@ -202,7 +202,7 @@ System V or Solaris printing system configuration options.
.br
http://localhost:631/help
.SH COPYRIGHT
Copyright 2007-2010 by Apple Inc.
Copyright 2007-2011 by Apple Inc.
.\"
.\" End of "$Id: lpadmin.man 9291 2010-09-01 15:51:59Z mike $".
.\" End of "$Id: lpadmin.man 9473 2011-01-11 16:28:51Z mike $".
.\"
+1 -1
Ver Arquivo
@@ -332,7 +332,7 @@ main(int argc, /* I - Number of command-line args */
const char *word2 = event + 4; /* Second word */
params = PARAMS_JOB;
if (!strcmp(word2, "state"))
if (!strcmp(word2, "state-changed"))
signame = "JobState";
else if (!strcmp(word2, "created"))
signame = "JobCreated";

Alguns arquivos não foram exibidos porque demasiados arquivos foram alterados neste diff Mostrar Mais