CHANGES IN CUPS V1.3.7
+ - Kerberos access to the web interface did not work
+ (STR #2748)
+ - The scheduler did not support "AuthType Default" in IPP
+ policies (STR #2749)
+ - The scheduler did not support the "HideImplicitMembers"
+ directive as documented (STR #2760)
+ - "make check" didn't return a non-zero exit code on
+ error (STR #2758)
+ - The scheduler incorrectly logged AUTH_foo environment
+ variables in debug mode (STR #2751)
+ - The image filters inverted PBM files (STR #2746)
+ - cupsctl would crash if the scheduler was not running
+ (STR #2741)
+ - The scheduler could crash when printing using a port
+ monitor (STR #2742)
- The scheduler would crash if PAM was broken (STR #2734)
- The image filters did not work with some CMYK JPEG files
produced by Adobe applications (STR #2727)
char *uri, /* O - Device URI */
int uri_size) /* I - Size of buffer */
{
+#ifdef __APPLE__ /* This function is a no-op */
+ return (-1);
+
+#else /* Get the device ID from the specified file descriptor... */
char *attr, /* 1284 attribute */
*delim, /* 1284 delimiter */
*uriptr, /* Pointer into URI */
manufacturer[256], /* Manufacturer string */
serial_number[1024]; /* Serial number string */
int manulen; /* Length of manufacturer string */
-#ifdef __linux
+# ifdef __linux
int length; /* Length of device ID info */
int got_id = 0;
-#endif /* __linux */
-#if defined(__sun) && defined(ECPPIOC_GETDEVID)
+# endif /* __linux */
+# if defined(__sun) && defined(ECPPIOC_GETDEVID)
struct ecpp_device_id did; /* Device ID buffer */
-#endif /* __sun && ECPPIOC_GETDEVID */
+# endif /* __sun && ECPPIOC_GETDEVID */
DEBUG_printf(("backendGetDeviceID(fd=%d, device_id=%p, device_id_size=%d, "
*device_id = '\0';
-#ifdef __linux
+# ifdef __linux
if (ioctl(fd, LPIOC_GET_DEVICE_ID(device_id_size), device_id))
{
/*
memmove(device_id, device_id + 2, length);
device_id[length] = '\0';
}
-# ifdef DEBUG
+# ifdef DEBUG
else
printf("backendGetDeviceID: ioctl failed - %s\n", strerror(errno));
-# endif /* DEBUG */
-#endif /* __linux */
+# endif /* DEBUG */
+# endif /* __linux */
-#if defined(__sun) && defined(ECPPIOC_GETDEVID)
+# if defined(__sun) && defined(ECPPIOC_GETDEVID)
did.mode = ECPP_CENTRONICS;
did.len = device_id_size - 1;
did.rlen = 0;
else
device_id[device_id_size - 1] = '\0';
}
-# ifdef DEBUG
+# ifdef DEBUG
else
printf("backendGetDeviceID: ioctl failed - %s\n", strerror(errno));
-# endif /* DEBUG */
-#endif /* __sun && ECPPIOC_GETDEVID */
+# endif /* DEBUG */
+# endif /* __sun && ECPPIOC_GETDEVID */
}
DEBUG_printf(("backendGetDeviceID: device_id=\"%s\"\n", device_id));
}
return (0);
+#endif /* __APPLE__ */
}
if (mfg)
{
+ /*
+ * Skip leading whitespace...
+ */
+
+ while (isspace(*mfg & 255))
+ mfg ++;
+
+ /*
+ * Map common bad names to the ones we use for driver selection...
+ */
+
if (!strncasecmp(mfg, "Hewlett-Packard", 15))
strlcpy(make_model, "HP", make_model_size);
else if (!strncasecmp(mfg, "Lexmark International", 21))
strlcpy(make_model, "Lexmark", make_model_size);
else
+ {
+ /*
+ * Use the manufacturer that is supplied...
+ */
+
strlcpy(make_model, mfg, make_model_size);
- if ((delim = strchr(make_model, ';')) != NULL)
- *delim = '\0';
+ if ((delim = strchr(make_model, ';')) != NULL)
+ *delim = '\0';
+
+ /*
+ * But strip trailing whitespace...
+ */
+
+ for (delim = make_model + strlen(make_model) - 1;
+ delim > make_model && *delim == ' ';
+ delim --)
+ *delim = '\0';
+ }
if (!strncasecmp(make_model, mdl, strlen(make_model)))
{
* Concatenate the make and model...
*/
+ while (isspace(*mdl & 255))
+ mdl ++;
+
strlcat(make_model, " ", make_model_size);
strlcat(make_model, mdl, make_model_size);
}
* Just copy model string, since it has the manufacturer...
*/
+ while (isspace(*mdl & 255))
+ mdl ++;
+
strlcpy(make_model, mdl, make_model_size);
}
}
* Use description...
*/
+ while (isspace(*attr & 255))
+ attr ++;
+
if (!strncasecmp(attr, "Hewlett-Packard hp ", 19))
{
/*
if ((delim = strchr(make_model, ';')) != NULL)
*delim = '\0';
+ for (delim = make_model + strlen(make_model) - 1;
+ delim > make_model && *delim == ' ';
+ delim --)
+ *delim = '\0';
+
/*
* Strip trailing whitespace...
*/
#include <cups/debug.h>
#include <cups/sidechannel.h>
#include <cups/i18n.h>
+#include "backend-private.h"
#include <CoreFoundation/CoreFoundation.h>
#include <IOKit/usb/IOUSBLib.h>
{
CFStringRef make = NULL, model = NULL, serial = NULL;
char uristr[1024], makestr[1024], modelstr[1024], serialstr[1024];
- char optionsstr[1024], idstr[1024];
+ char optionsstr[1024], idstr[1024], make_modelstr[1024];
copy_deviceinfo(deviceIDString, &make, &model, &serial);
-
- modelstr[0] = '/';
-
CFStringGetCString(deviceIDString, idstr, sizeof(idstr),
kCFStringEncodingUTF8);
+ backendGetMakeModel(idstr, make_modelstr, sizeof(make_modelstr));
+
+ modelstr[0] = '/';
if (!CFStringGetCString(make, makestr, sizeof(makestr),
kCFStringEncodingUTF8))
httpAssembleURI(HTTP_URI_CODING_ALL, uristr, sizeof(uristr), "usb", NULL, makestr, 0, modelstr);
strncat(uristr, optionsstr, sizeof(uristr));
- printf("direct %s \"%s %s\" \"%s %s USB\" \"%s\"\n", uristr, makestr,
- &modelstr[1], makestr, &modelstr[1], idstr);
+ printf("direct %s \"%s\" \"%s USB\" \"%s\"\n", uristr, make_modelstr,
+ make_modelstr, idstr);
release_deviceinfo(&make, &model, &serial);
CFRelease(deviceIDString);
CFStringRef modelKeys[] = { CFSTR("MDL:"), CFSTR("MODEL:"), NULL };
CFStringRef makeKeys[] = { CFSTR("MFG:"), CFSTR("MANUFACTURER:"), NULL };
CFStringRef serialKeys[] = { CFSTR("SN:"), CFSTR("SERN:"), NULL };
- CFRange hpRange = { 0, 3 };
if (make != NULL)
{
if ((*make = copy_value_for_key(deviceIDString, makeKeys)) == NULL)
*make = CFStringCreateWithCString(kCFAllocatorDefault, "Unknown",
kCFStringEncodingUTF8);
- else if (!CFStringCompare(*make, CFSTR("Hewlett-Packard"),
- kCFCompareCaseInsensitive))
- {
- /*
- * Fix a common HP 1284 bug...
- */
-
- CFRelease(*make);
- *make = CFStringCreateWithCString(kCFAllocatorDefault, "HP",
- kCFStringEncodingUTF8);
- }
}
if (model != NULL)
if ((*model = copy_value_for_key(deviceIDString, modelKeys)) == NULL)
*model = CFStringCreateWithCString(kCFAllocatorDefault, "Printer",
kCFStringEncodingUTF8);
- else if (!CFStringCompareWithOptions(*model, CFSTR("hp "), hpRange,
- kCFCompareCaseInsensitive |
- kCFCompareAnchored))
- {
- /*
- * Fix a common HP 1284 bug...
- */
-
- CFRange subRange = { 3, CFStringGetLength(*model) - 3 };
- CFStringRef sub = CFStringCreateWithSubstring(kCFAllocatorDefault,
- *model, subRange);
-
- CFRelease(*model);
- *model = sub;
- }
}
if (serial != NULL)
*
* Raster file definitions for the Common UNIX Printing System (CUPS).
*
- * Copyright 2007 by Apple Inc.
+ * Copyright 2007-2008 by Apple Inc.
* Copyright 1997-2006 by Easy Software Products.
*
* This file is part of the CUPS Imaging library.
CUPS_CSPACE_CIEXYZ = 15, /* CIE XYZ @since CUPS 1.1.19@ */
CUPS_CSPACE_CIELab = 16, /* CIE Lab @since CUPS 1.1.19@ */
- CUPS_CSPACE_RGBW = 17, /* Red, green, blue, white @since CUPS 1.2@ */
+ CUPS_CSPACE_RGBW = 17, /* Red, green, blue, white @since CUPS 1.2/Mac OS X 10.5@ */
CUPS_CSPACE_ICC1 = 32, /* ICC-based, 1 color @since CUPS 1.1.19@ */
CUPS_CSPACE_ICC2 = 33, /* ICC-based, 2 colors @since CUPS 1.1.19@ */
* (from CUPS 1.2 and higher) page header, for binary compatibility.
*/
-typedef struct cups_page_header_s /**** Version 1 page header ****/
+typedef struct cups_page_header_s /**** Version 1 page header @deprecated@ ****/
{
/**** Standard Page Device Dictionary String Values ****/
char MediaClass[64]; /* MediaClass string */
/**** Standard Page Device Dictionary Integer Values ****/
unsigned AdvanceDistance; /* AdvanceDistance value in points */
- cups_adv_t AdvanceMedia; /* AdvanceMedia value (see above) */
+ cups_adv_t AdvanceMedia; /* AdvanceMedia value (@link cups_adv_t@) */
cups_bool_t Collate; /* Collated copies value */
- cups_cut_t CutMedia; /* CutMedia value (see above) */
+ cups_cut_t CutMedia; /* CutMedia value (@link cups_cut_t@) */
cups_bool_t Duplex; /* Duplexed (double-sided) value */
unsigned HWResolution[2]; /* Resolution in dots-per-inch */
- unsigned ImagingBoundingBox[4]; /* Pixel region that is painted (points) */
+ unsigned ImagingBoundingBox[4]; /* Pixel region that is painted (points, left, bottom, right, top) */
cups_bool_t InsertSheet; /* InsertSheet value */
- cups_jog_t Jog; /* Jog value (see above) */
- cups_edge_t LeadingEdge; /* LeadingEdge value (see above) */
+ cups_jog_t Jog; /* Jog value (@link cups_jog_t@) */
+ cups_edge_t LeadingEdge; /* LeadingEdge value (@link cups_edge_t@) */
unsigned Margins[2]; /* Lower-lefthand margins in points */
cups_bool_t ManualFeed; /* ManualFeed value */
unsigned MediaPosition; /* MediaPosition value */
cups_bool_t MirrorPrint; /* MirrorPrint value */
cups_bool_t NegativePrint; /* NegativePrint value */
unsigned NumCopies; /* Number of copies to produce */
- cups_orient_t Orientation; /* Orientation value (see above) */
+ cups_orient_t Orientation; /* Orientation value (@link cups_orient_t@) */
cups_bool_t OutputFaceUp; /* OutputFaceUp value */
unsigned PageSize[2]; /* Width and length of page in points */
cups_bool_t Separations; /* Separations value */
} cups_page_header_t;
/**** New in CUPS 1.2 ****/
-typedef struct cups_page_header2_s /**** Version 2 page header @since CUPS 1.2@ ****/
+typedef struct cups_page_header2_s /**** Version 2 page header @since CUPS 1.2/Mac OS X 10.5@ ****/
{
/**** Standard Page Device Dictionary String Values ****/
char MediaClass[64]; /* MediaClass string */
/**** Standard Page Device Dictionary Integer Values ****/
unsigned AdvanceDistance; /* AdvanceDistance value in points */
- cups_adv_t AdvanceMedia; /* AdvanceMedia value (see above) */
+ cups_adv_t AdvanceMedia; /* AdvanceMedia value (@link cups_adv_t@) */
cups_bool_t Collate; /* Collated copies value */
- cups_cut_t CutMedia; /* CutMedia value (see above) */
+ cups_cut_t CutMedia; /* CutMedia value (@link cups_cut_t@) */
cups_bool_t Duplex; /* Duplexed (double-sided) value */
unsigned HWResolution[2]; /* Resolution in dots-per-inch */
- unsigned ImagingBoundingBox[4]; /* Pixel region that is painted (points) */
+ unsigned ImagingBoundingBox[4]; /* Pixel region that is painted (points, left, bottom, right, top) */
cups_bool_t InsertSheet; /* InsertSheet value */
- cups_jog_t Jog; /* Jog value (see above) */
- cups_edge_t LeadingEdge; /* LeadingEdge value (see above) */
+ cups_jog_t Jog; /* Jog value (@link cups_jog_t@) */
+ cups_edge_t LeadingEdge; /* LeadingEdge value (@link cups_edge_t@) */
unsigned Margins[2]; /* Lower-lefthand margins in points */
cups_bool_t ManualFeed; /* ManualFeed value */
unsigned MediaPosition; /* MediaPosition value */
cups_bool_t MirrorPrint; /* MirrorPrint value */
cups_bool_t NegativePrint; /* NegativePrint value */
unsigned NumCopies; /* Number of copies to produce */
- cups_orient_t Orientation; /* Orientation value (see above) */
+ cups_orient_t Orientation; /* Orientation value (@link cups_orient_t@) */
cups_bool_t OutputFaceUp; /* OutputFaceUp value */
unsigned PageSize[2]; /* Width and length of page in points */
cups_bool_t Separations; /* Separations value */
unsigned cupsRowStep; /* Spacing between lines */
/**** Version 2 Dictionary Values ****/
- unsigned cupsNumColors; /* Number of colors @since CUPS 1.2@ */
+ unsigned cupsNumColors; /* Number of color compoents @since CUPS 1.2/Mac OS X 10.5@ */
float cupsBorderlessScalingFactor;
- /* Scaling that was applied to page data @since CUPS 1.2@ */
+ /* Scaling that was applied to page data @since CUPS 1.2/Mac OS X 10.5@ */
float cupsPageSize[2]; /* Floating point PageSize (scaling *
- * factor not applied) @since CUPS 1.2@ */
- float cupsImagingBBox[4]; /* Floating point ImagingBoundingBox *
- * (scaling factor not applied) @since CUPS 1.2@ */
- unsigned cupsInteger[16]; /* User-defined integer values @since CUPS 1.2@ */
- float cupsReal[16]; /* User-defined floating-point values @since CUPS 1.2@ */
- char cupsString[16][64]; /* User-defined string values @since CUPS 1.2@ */
- char cupsMarkerType[64]; /* Ink/toner type @since CUPS 1.2@ */
- char cupsRenderingIntent[64];/* Color rendering intent @since CUPS 1.2@ */
- char cupsPageSizeName[64]; /* PageSize name @since CUPS 1.2@ */
+ * factor not applied) @since CUPS 1.2/Mac OS X 10.5@ */
+ float cupsImagingBBox[4]; /* Floating point ImagingBoundingBox
+ * (scaling factor not applied, left,
+ * bottom, right, top) @since CUPS 1.2/Mac OS X 10.5@ */
+ unsigned cupsInteger[16]; /* User-defined integer values @since CUPS 1.2/Mac OS X 10.5@ */
+ float cupsReal[16]; /* User-defined floating-point values @since CUPS 1.2/Mac OS X 10.5@ */
+ char cupsString[16][64]; /* User-defined string values @since CUPS 1.2/Mac OS X 10.5@ */
+ char cupsMarkerType[64]; /* Ink/toner type @since CUPS 1.2/Mac OS X 10.5@ */
+ char cupsRenderingIntent[64];/* Color rendering intent @since CUPS 1.2/Mac OS X 10.5@ */
+ char cupsPageSizeName[64]; /* PageSize name @since CUPS 1.2/Mac OS X 10.5@ */
} cups_page_header2_t;
typedef struct _cups_raster_s cups_raster_t;
* This function is called by
* @link cupsRasterInterpretPPD@ to
* validate (and update, as needed)
- * the page header attributes.
+ * the page header attributes. The
+ * "preferred_bits" argument provides
+ * the value of the
+ * @code cupsPreferredBitsPerColor@
+ * key from the PostScript page device
+ * dictionary and is 0 if undefined.
****/
extern void cupsRasterClose(cups_raster_t *r);
extern cups_raster_t *cupsRasterOpen(int fd, cups_mode_t mode);
extern unsigned cupsRasterReadHeader(cups_raster_t *r,
- cups_page_header_t *h);
+ cups_page_header_t *h) _CUPS_DEPRECATED;
extern unsigned cupsRasterReadPixels(cups_raster_t *r,
unsigned char *p, unsigned len);
extern unsigned cupsRasterWriteHeader(cups_raster_t *r,
- cups_page_header_t *h);
+ cups_page_header_t *h) _CUPS_DEPRECATED;
extern unsigned cupsRasterWritePixels(cups_raster_t *r,
unsigned char *p, unsigned len);
* file is missing or damaged, see the license at "http://www.cups.org/".
*/
-#media "10x11/10x11 - 10x11in" 720 792
-#media "10x13/10x13 - 10x13in" 720 936
-#media "10x14/10x14 - 10x14in" 720 1008
-#media "12x11/12x11 - 12x11in" 864 792
-#media "15x11/15x11 - 15x11in" 1080 792
-#media "7x9/7x9 - 7x9in" 504 648
-#media "8x10/8x10 - 8x10in" 576 720
-#media "9x11/9x11 - 9x11in" 648 792
-#media "9x12/9x12 - 9x12in" 648 864
-#media "A0/A0 - 841x1189mm" 2384 3370
-#media "A0.Transverse/A0 - 1189x841mm" 3370 2384
-#media "A10/A10 - 26x37mm" 73 105
-#media "A1/A1 - 594x841mm" 1684 2384
-#media "A1.Transverse/A1 - 841x594mm" 2384 1684
-#media "A2/A2 - 420x594mm" 1191 1684
-#media "A2.Transverse/A2 - 594x420mm" 1684 1191
-#media "A3/A3 - 297x420mm" 842 1191
-#media "A3Extra/A3 Extra - 322x445mm" 913 1262
-#media "A3Extra.Transverse/A3 Extra.Transverse - 322x445mm" 913 1262
-#media "A3Rotated/A3 Rotated - 420x297mm" 1191 842
-#media "A3.Transverse/A3 - 420x297mm" 1191 842
-#media "A4/A4 - 210x297mm" 595 842
-#media "A4Extra/A4 Extra - 9.270x12.690in" 667 914
-#media "A4Plus/A4 Plus - 210x330mm" 595 936
-#media "A4Rotated/A4 Rotated - 297x210mm" 842 595
-#media "A4Small/A4 Small - 210x297mm" 595 842
-#media "A4.Transverse/A4 - 297x210mm" 842 595
-#media "A5/A5 - 148x210mm" 420 595
-#media "A5/A5 - 149x210mm" 420 595
-#media "A5Extra/A5 Extra - 174x235mm" 492 668
-#media "A5Rotated/A5 Rotated - 210x148mm" 595 420
-#media "A5.Transverse/A5 - 210x149mm" 595 420
-#media "A6/A6 - 105x148mm" 297 420
-#media "A6Rotated/A6 Rotated - 148x105mm" 420 297
-#media "A7/A7 - 74x105mm" 210 297
-#media "A8/A8 - 52x74mm" 148 210
-#media "A9/A9 - 37x52mm" 105 148
-#media "AnsiA/ANSI A - 8.5x11in" 612 792
-#media "AnsiB/ANSI B - 11x17in" 792 1224
-#media "AnsiC/ANSI C - 17x22in" 1224 1584
-#media "AnsiD/ANSI D - 22x34in" 1584 2448
-#media "AnsiE/ANSI E - 34x44in" 2448 3168
-#media "ARCHA/Arch. A - 9x12in" 648 864
-#media "ARCHA.Transverse/Arch. A - 12x9in" 864 648
-#media "ARCHB/Arch. B - 12x18in" 864 1296
-#media "ARCHB.Transverse/Arch. B - 18x12in" 1296 864
-#media "ARCHC/Arch. C - 18x24in" 1296 1728
-#media "ARCHC.Transverse/Arch. C - 24x18in" 1728 1296
-#media "ARCHD/Arch. D - 24x36in" 1728 2592
-#media "ARCHD.Transverse/Arch. D - 36x24in" 2592 1728
-#media "ARCHE/Arch. E - 36x48in" 2592 3456
-#media "ARCHE.Transverse/Arch. E - 48x36in" 3456 2592
-#media "B0/B0 - 1030x1456mm" 2920 4127
-#media "B10/B10 - 32x45mm" 91 127
-#media "B1/B1 - 728x1028mm" 2064 2918
-#media "B1/B1 - 728x1030mm" 2064 2920
-#media "B2/B2 - 515x728mm" 1460 2064
-#media "B3/B3 - 364x515mm" 1032 1460
-#media "B4/B4 - 257x364mm" 729 1032
-#media "B4Rotated/B4 Rotated - 364x257mm" 1032 729
-#media "B5/B5 - 182x257mm" 516 729
-#media "B5Rotated/B5 Rotated - 257x182mm" 729 516
-#media "B5.Transverse/B5.Transverse - 182x257mm" 516 729
-#media "B6/B6 - 128x182mm" 363 516
-#media "B6Rotated/B6 Rotated - 182x128mm" 516 363
-#media "B7/B7 - 91x128mm" 258 363
-#media "B8/B8 - 64x91mm" 181 258
-#media "B9/B9 - 45x64mm" 127 181
-#media "C4/C4 - 229x324mm" 649 918
-#media "C5/C5 - 162x229mm" 459 649
-#media "C6/C6 - 114x162mm" 323 459
-#media "DL/DL - 110x220mm" 312 624
-#media "DoublePostcard/DoublePostcard - 200x148mm" 567 420
-#media "DoublePostcardRotated/DoublePostcardRotated - 148x200mm" 420 567
-#media "Env10/#10 Envelope - 4.13x9.5in" 297 684
-#media "Env11/#11 Envelope - 4.5x10.375in" 324 747
-#media "Env12/#12 Envelope - 4.75x11in" 342 792
-#media "Env14/#14 Envelope - 127x292mm" 360 828
-#media "Env9/#9 Envelope - 3.875x8.875in" 279 639
-#media "EnvC0/C0 Envelope - 917x1297mm" 2599 3676
-#media "EnvC1/C1 Envelope - 648x917mm" 1837 2599
-#media "EnvC2/C2 Envelope - 458x648mm" 1298 1837
-#media "EnvC3/C3 Envelope - 324x458mm" 918 1296
-#media "EnvC4/C4 Envelope - 229x324mm" 649 918
-#media "EnvC5/C5 Envelope - 162x229mm" 459 649
-#media "EnvC65/C65 Envelope - 114x229mm" 324 648
-#media "EnvC6/C6 Envelope - 114x162mm" 323 459
-#media "EnvC7/C7 Envelope - 81x114mm" 230 323
-#media "EnvChou3/Chou3 Envelope - 120x235mm" 340 666
-#media "EnvChou3Rotated/Chou3 Envelope Rotated - 235x120mm" 666 340
-#media "EnvChou4/Chou4 Envelope - 90x205mm" 255 581
-#media "EnvChou4Rotated/Chou4 Envelope Rotated - 205x90mm" 581 255
-#media "EnvDL/DL Envelope - 110x220mm" 312 624
-#media "EnvInvite/Invite Envelope - 220x220mm" 624 624
-#media "EnvISOB4/ISOB4 Envelope - 250x353mm" 708 1001
-#media "EnvISOB5/ISOB5 Envelope - 176x250mm" 499 709
-#media "EnvISOB6/ISOB6 Envelope - 176x125mm" 499 354
-#media "EnvItalian/Italian Envelope - 110x230mm" 312 652
-#media "EnvKaku2/Kaku2 Envelope - 240x332mm" 680 941
-#media "EnvKaku2Rotated/Kaku2 Envelope Rotated - 332x240mm" 941 680
-#media "EnvKaku3/Kaku3 Envelope - 216x277mm" 612 785
-#media "EnvKaku3Rotated/Kaku3 Envelope Rotated - 277x216mm" 785 612
-#media "EnvMonarch/Monarch Envelope - 3.875x7.5in" 279 540
-#media "EnvPersonal/Personal Envelope - 3.625x6.5in" 261 468
-#media "EnvPRC10/PRC10 Envelope - 324x458mm" 918 1298
-#media "EnvPRC10Rotated/PRC10 Envelope Rotated - 458x324mm" 1298 918
-#media "EnvPRC1/PRC1 Envelope - 102x165mm" 289 468
-#media "EnvPRC1Rotated/PRC1 Envelope Rotated - 165x102mm" 468 289
-#media "EnvPRC2/PRC2 Envelope - 102x176mm" 289 499
-#media "EnvPRC2Rotated/PRC2 Envelope Rotated - 176x102mm" 499 289
-#media "EnvPRC3/PRC3 Envelope - 125x176mm" 354 499
-#media "EnvPRC3Rotated/PRC3 Envelope Rotated - 176x125mm" 499 354
-#media "EnvPRC4/PRC4 Envelope - 110x208mm" 312 590
-#media "EnvPRC4Rotated/PRC4 Envelope Rotated - 208x110mm" 590 312
-#media "EnvPRC5/PRC5 Envelope - 110x220mm" 312 624
-#media "EnvPRC5Rotated/PRC5 Envelope Rotated - 220x110mm" 624 312
-#media "EnvPRC6/PRC6 Envelope - 120x230mm" 340 652
-#media "EnvPRC6Rotated/PRC6 Envelope Rotated - 230x120mm" 652 340
-#media "EnvPRC7/PRC7 Envelope - 160x230mm" 454 652
-#media "EnvPRC7Rotated/PRC7 Envelope Rotated - 230x160mm" 652 454
-#media "EnvPRC8/PRC8 Envelope - 120x309mm" 340 876
-#media "EnvPRC8Rotated/PRC8 Envelope Rotated - 309x120mm" 876 340
-#media "EnvPRC9/PRC9 Envelope - 229x324mm" 649 918
-#media "EnvPRC9Rotated/PRC9 Envelope Rotated - 324x229mm" 918 649
-#media "EnvYou4/You4 Envelope - 105x235mm" 298 666
-#media "EnvYou4Rotated/You4 Envelope Rotated - 235x105mm" 666 298
-#media "Executive/Executive - 7.25x10.5in" 522 756
-#media "FanFoldGerman/FanFold German - 8.5x12in" 612 864
-#media "FanFoldGermanLegal/FanFold German Legal - 216x330mm" 612 936
-#media "FanFoldUS/Fanfold - 14.875x11in" 1071 792
-#media "Folio/Folio - 210x330mm" 595 935
-#media "ISOB0/ISOB0 - 1000x1414mm" 2835 4008
-#media "ISOB10/ISOB10 - 31x44mm" 88 125
-#media "ISOB1/ISOB1 - 707x1000mm" 2004 2835
-#media "ISOB2/ISOB2 - 500x707mm" 1417 2004
-#media "ISOB3/ISOB3 - 353x500mm" 1001 1417
-#media "ISOB4/ISOB4 - 250x353mm" 709 1001
-#media "ISOB5Extra/ISOB5 Extra - 201x276mm" 570 782
-#media "ISOB5/ISOB5 - 176x250mm" 499 709
-#media "ISOB6/ISOB6 - 125x176mm" 354 499
-#media "ISOB7/ISOB7 - 88x125mm" 249 354
-#media "ISOB8/ISOB8 - 62x88mm" 176 249
-#media "ISOB9/ISOB9 - 44x62mm" 125 176
-#media "Ledger/Ledger - 17x11in" 1224 792
-#media "LegalExtra/Legal Extra - 9.5x15in" 684 1080
-#media "Legal/Legal - 8.5x14in" 612 1008
-#media "LetterExtra/Letter Extra - 9.5x12in" 684 864
-#media "LetterExtra.Transverse/Letter Extra - 12x9.5in" 864 684
-#media "Letter/Letter - 8.5x11in" 612 792
-#media "LetterPlus/Letter Plus - 8.5x12.690in" 612 914
-#media "LetterRotated/Letter Rotated - 11x8.5in" 792 612
-#media "LetterSmall/Letter Small - 8.5x11in" 612 792
-#media "Letter.Transverse/Letter - 11x8.5in" 792 612
-#media "Monarch/Monarch - 3.875x7.5in" 279 540
-#media "Note/Note - 8.5x11in" 612 792
-#media "Postcard/Postcard - 100x148mm" 284 419
-#media "PostcardRotated/PostcardRotated - 148x100mm" 419 284
-#media "PRC16K/PRC16K - 146x215mm" 414 610
-#media "PRC16KRotated/PRC16KRotated - 215x146mm" 610 414
-#media "PRC32KBig/PRC32KBig - 97x151mm" 275 428
-#media "PRC32KBigRotated/PRC32KBigRotated - 151x97mm" 428 275
-#media "PRC32K/PRC32K - 97x151mm" 275 428
-#media "PRC32KRotated/PRC32KRotated - 151x97mm" 428 275
-#media "Quarto/Quarto - 8.5x10.830in" 610 780
-#media "Statement/Statement - 5.5x8.5in" 396 612
-#media "SuperA/SuperA - 227x356mm" 643 1009
-#media "SuperB/SuperB - 305x487mm" 864 1380
-#media "TabloidExtra/Tabloid Extra - 12x18in" 864 1296
-#media "Tabloid/Tabloid - 11x17in" 792 1224
+#media "10x11/10 x 11\"" 720 792
+#media "10x13/10 x 13\"" 720 936
+#media "10x14/10 x 14\"" 720 1008
+#media "12x11/12 x 11\"" 864 792
+#media "15x11/15 x 11\"" 1080 792
+#media "7x9/7 x 9\"" 504 648
+#media "8x10/8 x 10\"" 576 720
+#media "9x11/9 x 11\"" 648 792
+#media "9x12/9 x 12\"" 648 864
+#media "A0/A0" 2384 3370
+#media "A0.Transverse/A0" 3370 2384
+#media "A1/A1" 1684 2384
+#media "A1.Transverse/A1" 2384 1684
+#media "A2/A2" 1191 1684
+#media "A2.Transverse/A2" 1684 1191
+#media "A3/A3" 842 1191
+#media "A3.Transverse/A3" 1191 842
+#media "A3Extra/A3 (Oversize)" 913 1262
+#media "A3Extra.Transverse/A3 (Oversize)" 913 1262
+#media "A3Rotated/A3" 1191 842
+#media "A4/A4" 595 842
+#media "A4Extra/A4 (Oversize)" 667 914
+#media "A4Plus/A4 (Oversize)" 595 936
+#media "A4Rotated/A4" 842 595
+#media "A4Small/A4 (Small)" 595 842
+#media "A4.Transverse/A4" 842 595
+#media "A5/A5" 420 595
+#media "A5Extra/A5 (Oversize)" 492 668
+#media "A5Rotated/A5" 595 420
+#media "A5.Transverse/A5" 595 420
+#media "A6/A6" 297 420
+#media "A6Rotated/A6" 420 297
+#media "A7/A7" 210 297
+#media "A8/A8" 148 210
+#media "A9/A9" 105 148
+#media "A10/A10" 73 105
+#media "AnsiA/ANSI A" 612 792
+#media "AnsiB/ANSI B" 792 1224
+#media "AnsiC/ANSI C" 1224 1584
+#media "AnsiD/ANSI D" 1584 2448
+#media "AnsiE/ANSI E" 2448 3168
+#media "ARCHA/ARCH A" 648 864
+#media "ARCHA.Transverse/ARCH A" 864 648
+#media "ARCHB/ARCH B" 864 1296
+#media "ARCHB.Transverse/ARCH B" 1296 864
+#media "ARCHC/ARCH C" 1296 1728
+#media "ARCHC.Transverse/ARCH C" 1728 1296
+#media "ARCHD/ARCH D" 1728 2592
+#media "ARCHD.Transverse/ARCH D" 2592 1728
+#media "ARCHE/ARCH E" 2592 3456
+#media "ARCHE.Transverse/ARCH E" 3456 2592
+#media "B0/B0" 2920 4127
+#media "B10/B10" 91 127
+#media "B1/B1" 2064 2918
+#media "B1/B1" 2064 2920
+#media "B2/B2" 1460 2064
+#media "B3/B3" 1032 1460
+#media "B4/B4" 729 1032
+#media "B4Rotated/B4" 1032 729
+#media "B5/B5" 516 729
+#media "B5Rotated/B5" 729 516
+#media "B5.Transverse/B5" 516 729
+#media "B6/B6" 363 516
+#media "B6Rotated/B6" 516 363
+#media "B7/B7" 258 363
+#media "B8/B8" 181 258
+#media "B9/B9" 127 181
+#media "C4/C4" 649 918
+#media "C5/C5" 459 649
+#media "C6/C6" 323 459
+#media "DL/DL" 312 624
+#media "DoublePostcard/Double Postcard" 567 420
+#media "DoublePostcardRotated/Double Postcard" 420 567
+#media "Env10/#10 Envelope" 297 684
+#media "Env11/#11 Envelope" 324 747
+#media "Env12/#12 Envelope" 342 792
+#media "Env14/#14 Envelope" 360 828
+#media "Env9/#9 Envelope" 279 639
+#media "EnvC0/C0 Envelope" 2599 3676
+#media "EnvC1/C1 Envelope" 1837 2599
+#media "EnvC2/C2 Envelope" 1298 1837
+#media "EnvC3/C3 Envelope" 918 1296
+#media "EnvC4/C4 Envelope" 649 918
+#media "EnvC5/C5 Envelope" 459 649
+#media "EnvC65/C65 Envelope" 324 648
+#media "EnvC6/C6 Envelope" 323 459
+#media "EnvC7/C7 Envelope" 230 323
+#media "EnvChou3/Chou3 Envelope" 340 666
+#media "EnvChou3Rotated/Chou3 Envelope" 666 340
+#media "EnvChou4/Chou4 Envelope" 255 581
+#media "EnvChou4Rotated/Chou4 Envelope" 581 255
+#media "EnvDL/DL Envelope" 312 624
+#media "EnvInvite/Invite Envelope" 624 624
+#media "EnvISOB4/ISO B4 Envelope" 708 1001
+#media "EnvISOB5/ISO B5 Envelope" 499 709
+#media "EnvISOB6/ISO B6 Envelope" 499 354
+#media "EnvItalian/Italian Envelope" 312 652
+#media "EnvKaku2/Kaku2 Envelope" 680 941
+#media "EnvKaku2Rotated/Kaku2 Envelope" 941 680
+#media "EnvKaku3/Kaku3 Envelope" 612 785
+#media "EnvKaku3Rotated/Kaku3 Envelope" 785 612
+#media "EnvMonarch/Monarch Envelope" 279 540
+#media "EnvPersonal/Personal Envelope" 261 468
+#media "EnvPRC1/PRC1 Envelope" 289 468
+#media "EnvPRC1Rotated/PRC1 Envelope" 468 289
+#media "EnvPRC2/PRC2 Envelope" 289 499
+#media "EnvPRC2Rotated/PRC2 Envelope" 499 289
+#media "EnvPRC3/PRC3 Envelope" 354 499
+#media "EnvPRC3Rotated/PRC3 Envelope" 499 354
+#media "EnvPRC4/PRC4 Envelope" 312 590
+#media "EnvPRC4Rotated/PRC4 Envelope" 590 312
+#media "EnvPRC5/PRC5 Envelope" 312 624
+#media "EnvPRC5Rotated/PRC5 Envelope" 624 312
+#media "EnvPRC6/PRC6 Envelope" 340 652
+#media "EnvPRC6Rotated/PRC6 Envelope" 652 340
+#media "EnvPRC7/PRC7 Envelope" 454 652
+#media "EnvPRC7Rotated/PRC7 Envelope" 652 454
+#media "EnvPRC8/PRC8 Envelope" 340 876
+#media "EnvPRC8Rotated/PRC8 Envelope" 876 340
+#media "EnvPRC9/PRC9 Envelope" 649 918
+#media "EnvPRC9Rotated/PRC9 Envelope" 918 649
+#media "EnvPRC10/PRC10 Envelope" 918 1298
+#media "EnvPRC10Rotated/PRC10 Envelope" 1298 918
+#media "EnvYou4/You4 Envelope" 298 666
+#media "EnvYou4Rotated/You4 Envelope" 666 298
+#media "Executive/US Executive" 522 756
+#media "FanFoldGerman/German FanFold" 612 864
+#media "FanFoldGermanLegal/German FanFold Legal" 612 936
+#media "FanFoldUS/US Fanfold" 1071 792
+#media "Folio/Folio" 595 935
+#media "ISOB0/ISO B0" 2835 4008
+#media "ISOB1/ISO B1" 2004 2835
+#media "ISOB2/ISO B2" 1417 2004
+#media "ISOB3/ISO B3" 1001 1417
+#media "ISOB4/ISO B4" 709 1001
+#media "ISOB5/ISO B5" 499 709
+#media "ISOB5Extra/ISO B5 (Oversize)" 570 782
+#media "ISOB6/ISO B6" 354 499
+#media "ISOB7/ISO B7" 249 354
+#media "ISOB8/ISO B8" 176 249
+#media "ISOB9/ISO B9" 125 176
+#media "ISOB10/ISO B10" 88 125
+#media "Ledger/US Ledger" 1224 792
+#media "Legal/US Legal" 612 1008
+#media "LegalExtra/US Legal (Oversize)" 684 1080
+#media "Letter/US Letter" 612 792
+#media "Letter.Transverse/US Letter" 792 612
+#media "LetterExtra/US Letter (Oversize)" 684 864
+#media "LetterExtra.Transverse/US Letter (Oversize)" 864 684
+#media "LetterPlus/US Letter (Oversize)" 612 914
+#media "LetterRotated/US Letter" 792 612
+#media "LetterSmall/US Letter (Small)" 612 792
+#media "Monarch/Monarch" 279 540
+#media "Note/Note" 612 792
+#media "Postcard/Postcard" 284 419
+#media "PostcardRotated/Postcard" 419 284
+#media "PRC16K/PRC16K" 414 610
+#media "PRC16KRotated/PRC16K" 610 414
+#media "PRC32K/PRC32K" 275 428
+#media "PRC32KBig/PRC32K (Oversize)" 275 428
+#media "PRC32KBigRotated/PRC32K (Oversize)" 428 275
+#media "PRC32KRotated/PRC32K" 428 275
+#media "Quarto/Quarto" 610 780
+#media "Statement/Statement" 396 612
+#media "SuperA/Super A" 643 1009
+#media "SuperB/Super B" 864 1380
+#media "Tabloid/Tabloid" 792 1224
+#media "TabloidExtra/Tabloid (Oversize)" 864 1296
/*
* Non-standard sizes...
*/
-#media "Photo4x6/Photo - 4x6in" 288 432
-#media "PhotoLabel/Photo Labels - 4x6.5in" 288 468
-#media "w288h418/Photo - 4x5.8in" 288 418
-#media "w936h1368/Super B/A3 - 13x19in" 936 1368
-#media "w81h252/Address - 1 1/8x3 1/2in" 81 252
-#media "w101h252/Large Address - 1 4/10x3 1/2in" 101 252
-#media "w54h144/Return Address - 3/4x2in" 54 144
-#media "w167h288/Shipping Address - 2 5/16x4in" 167 288
-#media "w162h540/Internet Postage 2-Part - 2 1/4x7 1/2in" 162 540
-#media "w162h504/Internet Postage 3-Part - 2 1/4x7in" 162 504
-#media "w41h248/File Folder - 9/16x3 7/16in" 41 248
-#media "w41h144/Hanging Folder - 9/16x2in" 41 144
-#media "w153h198/3.5\" Disk - 2 1/8x2 3/4in" 153 198
+#media "Photo4x6/Photo" 288 432
+#media "PhotoLabel/Photo Labels" 288 468
+#media "w288h418/Photo" 288 418
+#media "w936h1368/Super B/A3" 936 1368
+#media "w81h252/Address" 81 252
+#media "w101h252/Large Address" 101 252
+#media "w54h144/Return Address" 54 144
+#media "w167h288/Shipping Address" 167 288
+#media "w162h540/Internet Postage 2-Part" 162 540
+#media "w162h504/Internet Postage 3-Part" 162 504
+#media "w41h248/File Folder" 41 248
+#media "w41h144/Hanging Folder" 41 144
+#media "w153h198/3.5\" Disk" 153 198
/*
raster format is updated from time to time, it is important to use this API to
avoid incompatibilities with newer versions of CUPS.</p>
+<p>Two kinds of CUPS filters use the CUPS raster API - raster image processor
+(RIP) filters such as <code>pstoraster</code> and <code>cgpdftoraster</code>
+(Mac OS X) that produce CUPS raster files and printer driver filters that
+convert CUPS raster files into a format usable by the printer. Printer
+driver filters are by far the most common.</p>
+
<p>CUPS raster files (<code>application/vnd.cups-raster</code>) consists of
a stream of raster page descriptions produced by one of the RIP filters such as
<var>pstoraster</var>, <var>imagetoraster</var>, or
<p>Each page of data begins with a page dictionary structure called
<a href="#cups_page_header2_t"><code>cups_page_header2_t</code></a>. This
structure contains the colorspace, bits per color, media size, media type,
-hardware resolution, and so forth used for the page. You read the page header
-using the
+hardware resolution, and so forth used for the page.</p>
+
+<blockquote><b>Note:</b>
+
+ <p>Do not confuse the colorspace in the page header with the PPD
+ <tt>ColorModel</tt> keyword. <tt>ColorModel</tt> refers to the general type of
+ color used for a device (Gray, RGB, CMYK, DeviceN) and is often used to
+ select a particular colorspace for the page header along with the associate
+ color profile. The page header colorspace (<tt>cupsColorSpace</tt>) describes
+ both the type and organization of the color data, for example KCMY (black
+ first) instead of CMYK and RGBA (RGB + alpha) instead of RGB.</p>
+
+</blockquote>
+
+<p>You read the page header using the
<a href="#cupsRasterReadHeader2"><code>cupsRasterReadHeader2</code></a>
function:</p>
if (<a href="#cupsRasterReadPixels">cupsRasterReadPixels</a>(ras, buffer, header.cupsBytesPerLine) == 0)
break;
- /* write raster data to printer */
+ /* write raster data to printer on stdout */
}
/* finish this page */
<a href="#cupsRasterClose">cupsRasterClose</a>(ras);
</pre>
+
+
+<h2 class='title'><a name="TASKS">Functions by Task</a></h2>
+
+<h3><a name="OPENCLOSE">Opening and Closing Raster Streams</a></h3>
+
+<ul class="code">
+
+ <li><a href="#cupsRasterClose" title="Close a raster stream.">cupsRasterClose</a></li>
+ <li><a href="#cupsRasterOpen" title="Open a raster stream.">cupsRasterOpen</a></li>
+
+</ul>
+
+<h3><a name="READING">Reading Raster Streams</a></h3>
+
+<ul class="code">
+
+ <li><a href="#cupsRasterReadHeader" title="Read a raster page header and store it in a version 1 page header structure.">cupsRasterReadHeader</a> <span class="info">Deprecated in CUPS 1.2/Mac OS X 10.5</span></li>
+ <li><a href="#cupsRasterReadHeader2" title="Read a raster page header and store it in a version 2 page header structure.">cupsRasterReadHeader2</a></li>
+ <li><a href="#cupsRasterReadPixels" title="Read raster pixels.">cupsRasterReadPixels</a></li>
+
+</ul>
+
+<h3><a name="WRITING">Writing Raster Streams</a></h3>
+
+<ul class="code">
+
+ <li><a href="#cupsRasterInterpretPPD" title="Interpret PPD commands to create a page header.">cupsRasterInterpretPPD</a></li>
+ <li><a href="#cupsRasterWriteHeader" title="Write a raster page header from a version 1 page header structure.">cupsRasterWriteHeader</a></li>
+ <li><a href="#cupsRasterWriteHeader2" title="Write a raster page header from a version 2 page header structure.">cupsRasterWriteHeader2</a> <span class="info">Deprecated in CUPS 1.2/Mac OS X 10.5</span></li>
+ <li><a href="#cupsRasterWritePixels" title="Write raster pixels.">cupsRasterWritePixels</a></li>
+
+</ul>
switch (format)
{
case 1 :
+ for (x = img->xsize, inptr = in; x > 0; x --, inptr ++)
+ if (fscanf(fp, "%d", &val) == 1)
+ *inptr = val ? 0 : 255;
+ break;
+
case 2 :
for (x = img->xsize, inptr = in; x > 0; x --, inptr ++)
if (fscanf(fp, "%d", &val) == 1)
x --, inptr ++)
{
if (*outptr & bit)
- *inptr = 255;
- else
*inptr = 0;
+ else
+ *inptr = 255;
if (bit > 1)
bit >>= 1;
/*
* 'cupsRasterInterpretPPD()' - Interpret PPD commands to create a page header.
*
- * This function does not mark the options in the PPD using the "num_options"
- * and "options" arguments. Instead, mark the options with
- * @code cupsMarkOptions@ and @code ppdMarkOption@ prior to calling
- * @code cupsRasterInterpretPPD@ - this allows you to do per-page options
- * without manipulating the options array.
+ * This function is used by raster image processing (RIP) filters like
+ * cgpdftoraster and imagetoraster when writing CUPS raster data for a page.
+ * It is not used by raster printer driver filters which only read CUPS
+ * raster data.
+ *
+ *
+ * @code cupsRasterInterpretPPD@ does not mark the options in the PPD using
+ * the "num_options" and "options" arguments. Instead, mark the options with
+ * @code cupsMarkOptions@ and @code ppdMarkOption@ prior to calling it -
+ * this allows for per-page options without manipulating the options array.
*
* The "func" argument specifies an optional callback function that is
* called prior to the computation of the final raster data. The function
* supported raster format and then returns 0 on success and -1 if the
* requested attributes cannot be supported.
*
+ *
* @code cupsRasterInterpretPPD@ supports a subset of the PostScript language.
* Currently only the @code [@, @code ]@, @code <<@, @code >>@, @code {@,
* @code }@, @code cleartomark@, @code copy@, @code dup@, @code index@,
* @code pop@, @code roll@, @code setpagedevice@, and @code stopped@ operators
* are supported.
*
- * @since CUPS 1.2@
+ * @since CUPS 1.2/Mac OS X 10.5@
*/
int /* O - 0 on success, -1 on failure */
cupsRasterInterpretPPD(
- cups_page_header2_t *h, /* O - Page header */
+ cups_page_header2_t *h, /* O - Page header to create */
ppd_file_t *ppd, /* I - PPD file */
int num_options, /* I - Number of options */
cups_option_t *options, /* I - Options */
- cups_interpret_cb_t func) /* I - Optional page header callback */
+ cups_interpret_cb_t func) /* I - Optional page header callback (@code NULL@ for none) */
{
int status; /* Cummulative status */
char *code; /* Code to run */
*
* Raster file routines for the Common UNIX Printing System (CUPS).
*
- * Copyright 2007 by Apple Inc.
+ * Copyright 2007-2008 by Apple Inc.
* Copyright 1997-2006 by Easy Software Products.
*
* This file is part of the CUPS Imaging library.
* cupsRasterClose() - Close a raster stream.
* cupsRasterOpen() - Open a raster stream.
* cupsRasterReadHeader() - Read a raster page header and store it in a
- * V1 page header structure.
+ * version 1 page header structure.
* cupsRasterReadHeader2() - Read a raster page header and store it in a
- * V2 page header structure.
+ * version 2 page header structure.
* cupsRasterReadPixels() - Read raster pixels.
- * cupsRasterWriteHeader() - Write a raster page header from a V1 page
- * header structure.
- * cupsRasterWriteHeader2() - Write a raster page header from a V2 page
- * header structure.
+ * cupsRasterWriteHeader() - Write a raster page header from a version 1
+ * page header structure.
+ * 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.
/*
* 'cupsRasterClose()' - Close a raster stream.
+ *
+ * The file descriptor associated with the raster stream must be closed
+ * separately as needed.
*/
void
/*
* 'cupsRasterOpen()' - Open a raster stream.
+ *
+ * This function associates a raster stream with the given file descriptor.
+ * For most printer driver filters, "fd" will be 0 (stdin). For most raster
+ * image processor (RIP) filters that generate raster data, "fd" will be 1
+ * (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.
*/
cups_raster_t * /* O - New stream */
cupsRasterOpen(int fd, /* I - File descriptor */
- cups_mode_t mode) /* I - Mode */
+ 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 */
/*
* 'cupsRasterReadHeader()' - Read a raster page header and store it in a
- * V1 page header structure.
+ * version 1 page header structure.
+ *
+ * This function is deprecated. Use @link cupsRasterReadHeader2@ instead.
+ *
+ * @deprecated@
*/
unsigned /* O - 1 on success, 0 on fail */
/*
* 'cupsRasterReadHeader2()' - Read a raster page header and store it in a
- * V2 page header structure.
+ * version 2 page header structure.
*
- * @since CUPS 1.2@
+ * @since CUPS 1.2/Mac OS X 10.5@
*/
unsigned /* O - 1 on success, 0 on fail */
/*
- * 'cupsRasterWriteHeader()' - Write a raster page header from a V1 page
+ * 'cupsRasterWriteHeader()' - Write a raster page header from a version 1 page
* header structure.
+ *
+ * This function is deprecated. Use @link cupsRasterWriteHeader2@ instead.
+ *
+ * @deprecated@
*/
unsigned /* O - 1 on success, 0 on failure */
/*
- * 'cupsRasterWriteHeader2()' - Write a raster page header from a V2 page
- * header structure.
+ * 'cupsRasterWriteHeader2()' - Write a raster page header from a version 2
+ * page header structure.
+ *
+ * The page header can be initialized using @link cupsRasterInterpretPPD@.
*
- * @since CUPS 1.2@
+ * @since CUPS 1.2/Mac OS X 10.5@
*/
unsigned /* O - 1 on success, 0 on failure */
static double get_time(void);
static void read_test(int fd);
static int run_read_test(void);
-static void write_test(int fd);
+static void write_test(int fd, cups_mode_t mode);
/*
*/
int /* O - Exit status */
-main(void)
+main(int argc, /* I - Number of command-line args */
+ char *argv[]) /* I - Command-line arguments */
{
int i; /* Looping var */
int ras_fd, /* File descriptor for read process */
write_secs, /* Write time */
read_secs, /* Read time */
pass_secs[TEST_PASSES]; /* Total test times */
+ cups_mode_t mode; /* Write mode */
+ /*
+ * See if we have anything on the command-line...
+ */
+
+ if (argc > 2 || (argc == 2 && strcmp(argv[1], "-z")))
+ {
+ puts("Usage: rasterbench [-z]");
+ return (1);
+ }
+
+ mode = argc > 1 ? CUPS_RASTER_WRITE_COMPRESSED : CUPS_RASTER_WRITE;
+
/*
* Ignore SIGPIPE...
*/
ras_fd = run_read_test();
start_secs = get_time();
- write_test(ras_fd);
+ write_test(ras_fd, mode);
write_secs = get_time();
printf(" %.3f write,", write_secs - start_secs);
{
int y; /* Looping var */
cups_raster_t *r; /* Raster stream */
- cups_page_header_t header; /* Page header */
+ cups_page_header2_t header; /* Page header */
unsigned char buffer[8 * TEST_WIDTH];
/* Read buffer */
return;
}
- while (cupsRasterReadHeader(r, &header))
+ while (cupsRasterReadHeader2(r, &header))
{
for (y = 0; y < header.cupsHeight; y ++)
cupsRasterReadPixels(r, buffer, header.cupsBytesPerLine);
*/
static void
-write_test(int fd) /* I - File descriptor to write to */
+write_test(int fd, /* I - File descriptor to write to */
+ cups_mode_t mode) /* I - Write mode */
{
int page, x, y; /* Looping vars */
int count; /* Number of bytes to set */
cups_raster_t *r; /* Raster stream */
- cups_page_header_t header; /* Page header */
+ cups_page_header2_t header; /* Page header */
unsigned char data[32][8 * TEST_WIDTH];
/* Raster data to write */
* Test write speed...
*/
- if ((r = cupsRasterOpen(fd, CUPS_RASTER_WRITE)) == NULL)
+ if ((r = cupsRasterOpen(fd, mode)) == NULL)
{
perror("Unable to create raster output stream");
return;
header.cupsBitsPerPixel = (page & 1) ? 32 : 8;
}
- cupsRasterWriteHeader(r, &header);
+ cupsRasterWriteHeader2(r, &header);
for (y = 0; y < TEST_HEIGHT; y ++)
cupsRasterWritePixels(r, data[y & 31], header.cupsBytesPerLine);
*
* Raster test program routines for the Common UNIX Printing System (CUPS).
*
- * Copyright 2007 by Apple Inc.
+ * Copyright 2007-2008 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
*
* Contents:
*
- * main() - Test the raster functions.
- * print_changes() - Print differences in the page header.
+ * 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_raster_tests() - Test reading and writing of raster data.
+ * print_changes() - Print differences in the page 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_raster_tests(void);
+static int do_raster_tests(cups_mode_t mode);
static void print_changes(cups_page_header2_t *header,
cups_page_header2_t *expected);
if (argc == 1)
{
errors = do_ps_tests();
- errors += do_raster_tests();
+ errors += do_raster_tests(CUPS_RASTER_WRITE);
+ errors += do_raster_tests(CUPS_RASTER_WRITE_COMPRESSED);
}
else
{
*/
static int /* O - Number of errors */
-do_raster_tests(void)
+do_raster_tests(cups_mode_t mode) /* O - Write mode */
{
int page, x, y; /* Looping vars */
FILE *fp; /* Raster file */
* Test writing...
*/
- fputs("cupsRasterOpen(CUPS_RASTER_WRITE): ", stdout);
+ printf("cupsRasterOpen(%s): ",
+ mode == CUPS_RASTER_WRITE ? "CUPS_RASTER_WRITE" :
+ "CUPS_RASTER_WRITE_COMPRESSED");
fflush(stdout);
if ((fp = fopen("test.raster", "wb")) == NULL)
return (1);
}
- if ((r = cupsRasterOpen(fileno(fp), CUPS_RASTER_WRITE)) == NULL)
+ if ((r = cupsRasterOpen(fileno(fp), mode)) == NULL)
{
printf("FAIL (%s)\n", strerror(errno));
fclose(fp);
char *ptr, /* Pointer into string */
username[256], /* Username string */
password[33]; /* Password string */
- const char *localuser; /* Certificate username */
+ cupsd_cert_t *localuser; /* Certificate username */
char nonce[HTTP_MAX_VALUE], /* Nonce value from client */
md5[33], /* MD5 password */
basicmd5[33]; /* MD5 of Basic password */
if ((localuser = cupsdFindCert(authorization)) != NULL)
{
- strlcpy(username, localuser, sizeof(username));
+ strlcpy(username, localuser->username, sizeof(username));
cupsdLogMessage(CUPSD_LOG_DEBUG,
"cupsdAuthorize: Authorized as %s using Local",
return;
}
- con->type = CUPSD_AUTH_BASIC;
+#ifdef HAVE_GSSAPI
+ if (localuser->ccache)
+ con->type = CUPSD_AUTH_NEGOTIATE;
+ else
+#endif /* HAVE_GSSAPI */
+ con->type = CUPSD_AUTH_BASIC;
}
else if (!strncmp(authorization, "Basic", 5))
{
* 'cupsdFindCert()' - Find a certificate.
*/
-const char * /* O - Matching username or NULL */
+cupsd_cert_t * /* O - Matching certificate or NULL */
cupsdFindCert(const char *certificate) /* I - Certificate */
{
cupsd_cert_t *cert; /* Current certificate */
if (!strcasecmp(certificate, cert->certificate))
{
DEBUG_printf((" returning %s...\n", cert->username));
- return (cert->username);
+ return (cert);
}
DEBUG_puts(" certificate not found!");
void *ccache);
extern void cupsdDeleteCert(int pid);
extern void cupsdDeleteAllCerts(void);
-extern const char *cupsdFindCert(const char *certificate);
+extern cupsd_cert_t *cupsdFindCert(const char *certificate);
extern void cupsdInitCerts(void);
#ifdef HAVE_GSSAPI
{ "GSSServiceName", &GSSServiceName, CUPSD_VARTYPE_STRING },
#endif /* HAVE_GSSAPI */
+ { "HideImplicitMembers", &HideImplicitMembers, CUPSD_VARTYPE_BOOLEAN },
{ "ImplicitClasses", &ImplicitClasses, CUPSD_VARTYPE_BOOLEAN },
{ "ImplicitAnyClasses", &ImplicitAnyClasses, CUPSD_VARTYPE_BOOLEAN },
{ "JobRetryLimit", &JobRetryLimit, CUPSD_VARTYPE_INTEGER },
CFMutableDictionaryRef dict; /* Dictionary for name */
char *language; /* Current language */
ppd_attr_t *attr; /* Profile attribute */
+ CFStringRef cflang, /* Language string */
+ cftext; /* Localized text */
/*
&kCFTypeDictionaryKeyCallBacks,
&kCFTypeDictionaryValueCallBacks);
- CFDictionarySetValue(dict, CFSTR("en"),
- CFStringCreateWithCString(kCFAllocatorDefault,
- text, kCFStringEncodingUTF8));
+ cftext = CFStringCreateWithCString(kCFAllocatorDefault, text,
+ kCFStringEncodingUTF8);
- if (iccfile && languages)
+ if (cftext)
+ {
+ CFDictionarySetValue(dict, CFSTR("en"), cftext);
+ CFRelease(cftext);
+ }
+
+ if (languages)
{
/*
* Find localized names for the color profiles...
language;
language = (char *)cupsArrayNext(languages))
{
- if ((attr = _ppdLocalizedAttr(ppd, "cupsICCProfile", name,
- language)) != NULL && attr->text[0])
- CFDictionarySetValue(dict,
- CFStringCreateWithCString(kCFAllocatorDefault,
- language,
- kCFStringEncodingUTF8),
- CFStringCreateWithCString(kCFAllocatorDefault,
- attr->text,
- kCFStringEncodingUTF8));
+ if (iccfile)
+ attr = _ppdLocalizedAttr(ppd, "cupsICCProfile", name, language);
+ else
+ attr = _ppdLocalizedAttr(ppd, "ColorModel", name, language);
+
+ if (attr && attr->text[0])
+ {
+ cflang = CFStringCreateWithCString(kCFAllocatorDefault, language,
+ kCFStringEncodingUTF8);
+ cftext = CFStringCreateWithCString(kCFAllocatorDefault, attr->text,
+ kCFStringEncodingUTF8);
+
+ if (cflang && cftext)
+ CFDictionarySetValue(dict, cflang, cftext);
+
+ if (cflang)
+ CFRelease(cflang);
+
+ if (cftext)
+ CFRelease(cftext);
+ }
}
cupsArrayRestore(ppd->sorted_attrs);
{
int i; /* Looping var */
char ppdfile[1024], /* PPD filename */
- iccfile[1024]; /* ICC filename */
+ iccfile[1024], /* ICC filename */
+ selector[PPD_MAX_NAME];
+ /* Profile selection string */
ppd_file_t *ppd; /* PPD file */
- ppd_attr_t *attr; /* cupsICCProfile attributes */
+ ppd_attr_t *attr, /* cupsICCProfile attributes */
+ *profileid_attr;/* cupsProfileID attribute */
ppd_option_t *cm_option; /* Color model option */
- ppd_choice_t *cm_choice; /* Color model choice */
+ ppd_choice_t *cm_choice, /* Color model choice */
+ *q1_choice, /* ColorModel (or other) qualifier */
+ *q2_choice, /* MediaType (or other) qualifier */
+ *q3_choice; /* Resolution (or other) qualifier */
int num_profiles; /* Number of profiles */
CMError error; /* Last error */
- unsigned id; /* Printer device ID */
- CFMutableDictionaryRef name; /* Printer device name dictionary */
+ unsigned device_id, /* Printer device ID */
+ profile_id, /* Profile ID */
+ default_profile_id = 0;
+ /* Default profile ID */
+ CFMutableDictionaryRef device_name; /* Printer device name dictionary */
+ CFStringRef printer_name; /* Printer name string */
CMDeviceScope scope = /* Scope of the registration */
{
kCFPreferencesAnyUser,
if ((ppd = ppdOpenFile(ppdfile)) == NULL)
return;
+ ppdMarkDefaults(ppd);
+
/*
* See if we have any profiles...
*/
if (num_profiles > 0)
{
+ /*
+ * Figure out the default profile selectors...
+ */
+
+ if ((attr = ppdFindAttr(ppd, "cupsICCQualifier1", NULL)) != NULL &&
+ attr->value && attr->value[0])
+ q1_choice = ppdFindMarkedChoice(ppd, attr->value);
+ else
+ q1_choice = ppdFindMarkedChoice(ppd, "ColorModel");
+
+ if ((attr = ppdFindAttr(ppd, "cupsICCQualifier2", NULL)) != NULL &&
+ attr->value && attr->value[0])
+ q2_choice = ppdFindMarkedChoice(ppd, attr->value);
+ else
+ q2_choice = ppdFindMarkedChoice(ppd, "MediaType");
+
+ if ((attr = ppdFindAttr(ppd, "cupsICCQualifier3", NULL)) != NULL &&
+ attr->value && attr->value[0])
+ q3_choice = ppdFindMarkedChoice(ppd, attr->value);
+ else
+ q3_choice = ppdFindMarkedChoice(ppd, "Resolution");
+
/*
* Build the array of profiles...
*
if (access(iccfile, 0))
continue;
- apple_init_profile(ppd, languages, profile, _ppdHashName(attr->spec),
- attr->spec, attr->text[0] ? attr->text : attr->spec,
- iccfile);
+ cupsArraySave(ppd->sorted_attrs);
+
+ if ((profileid_attr = ppdFindAttr(ppd, "cupsProfileID",
+ attr->spec)) != NULL &&
+ profileid_attr->value && isdigit(profileid_attr->value[0] & 255))
+ profile_id = (unsigned)strtoul(profileid_attr->value, NULL, 10);
+ else
+ profile_id = _ppdHashName(attr->spec);
+
+ cupsArrayRestore(ppd->sorted_attrs);
+
+ apple_init_profile(ppd, languages, profile, profile_id, attr->spec,
+ attr->text[0] ? attr->text : attr->spec, iccfile);
profile ++;
+
+ /*
+ * See if this is the default profile...
+ */
+
+ if (!default_profile_id && q1_choice)
+ {
+ if (q2_choice)
+ {
+ if (q3_choice)
+ {
+ snprintf(selector, sizeof(selector), "%s.%s.%s",
+ q1_choice->choice, q2_choice->choice, q3_choice->choice);
+ if (!strcmp(selector, attr->spec))
+ default_profile_id = profile_id;
+ }
+
+ if (!default_profile_id)
+ {
+ snprintf(selector, sizeof(selector), "%s.%s.", q1_choice->choice,
+ q2_choice->choice);
+ if (!strcmp(selector, attr->spec))
+ default_profile_id = profile_id;
+ }
+ }
+
+ if (!default_profile_id && q3_choice)
+ {
+ snprintf(selector, sizeof(selector), "%s..%s", q1_choice->choice,
+ q3_choice->choice);
+ if (!strcmp(selector, attr->spec))
+ default_profile_id = profile_id;
+ }
+
+ if (!default_profile_id)
+ {
+ snprintf(selector, sizeof(selector), "%s..", q1_choice->choice);
+ if (!strcmp(selector, attr->spec))
+ default_profile_id = profile_id;
+ }
+ }
}
_ppdFreeLanguages(languages);
else if ((cm_option = ppdFindOption(ppd, "ColorModel")) != NULL)
{
/*
- * Extract standard grayscale, RGB, or CMYK profiles...
+ * Extract profiles from ColorModel option...
*/
- for (num_profiles = 0, i = cm_option->num_choices,
- cm_choice = cm_option->choices;
- i > 0;
- i --, cm_choice ++)
- if (!strcmp(cm_choice->choice, "Gray") ||
- !strcmp(cm_choice->choice, "RGB") ||
- !strcmp(cm_choice->choice, "CMYK"))
- num_profiles ++;
+ const char *profile_name; /* Name of generic profile */
- /*
- * Build the array of profiles...
- *
- * Note: This calloc actually requests slightly more memory than needed.
- */
+
+ num_profiles = cm_option->num_choices;
if ((profiles = calloc(num_profiles, sizeof(CMDeviceProfileArray))) == NULL)
{
for (profile = profiles->profiles, i = cm_option->num_choices,
cm_choice = cm_option->choices;
i > 0;
- i --, cm_choice ++)
- if (!strcmp(cm_choice->choice, "Gray"))
- {
- apple_init_profile(ppd, NULL, profile, _ppdHashName("Gray.."),
- "Gray", "Gray", NULL);
- profile ++;
- }
- else if (!strcmp(cm_choice->choice, "RGB"))
- {
- apple_init_profile(ppd, NULL, profile, _ppdHashName("RGB.."),
- "RGB", "RGB", NULL);
- profile ++;
- }
- else if (!strcmp(cm_choice->choice, "CMYK"))
- {
- apple_init_profile(ppd, NULL, profile, _ppdHashName("CMYK.."),
- "CMYK", "CMYK", NULL);
- profile ++;
- }
+ i --, cm_choice ++, profile ++)
+ {
+ if (!strcmp(cm_choice->choice, "Gray") ||
+ !strcmp(cm_choice->choice, "Black"))
+ profile_name = "Gray";
+ else if (!strcmp(cm_choice->choice, "RGB") ||
+ !strcmp(cm_choice->choice, "CMY"))
+ profile_name = "RGB";
+ else if (!strcmp(cm_choice->choice, "CMYK") ||
+ !strcmp(cm_choice->choice, "KCMY"))
+ profile_name = "CMYK";
+ else
+ profile_name = "DeviceN";
+
+ snprintf(selector, sizeof(selector), "%s..", profile_name);
+ profile_id = _ppdHashName(selector);
+
+ apple_init_profile(ppd, NULL, profile, profile_id, cm_choice->choice,
+ cm_choice->text, NULL);
+
+ if (cm_choice->marked)
+ default_profile_id = profile_id;
+ }
}
else
{
* Use the default colorspace...
*/
- num_profiles = 1;
+ num_profiles = 1 + ppd->colorspace != PPD_CS_GRAY;
- if ((profiles = calloc(1, sizeof(CMDeviceProfileArray))) == NULL)
+ if ((profiles = calloc(num_profiles, sizeof(CMDeviceProfileArray))) == NULL)
{
cupsdLogMessage(CUPSD_LOG_ERROR,
"Unable to allocate memory for %d profiles!",
return;
}
- profiles->profileCount = 1;
+ profiles->profileCount = num_profiles;
+
+ apple_init_profile(ppd, NULL, profiles->profiles, _ppdHashName("Gray.."),
+ "Gray", "Gray", NULL);
switch (ppd->colorspace)
{
- case PPD_CS_GRAY :
- apple_init_profile(ppd, NULL, profiles->profiles,
- _ppdHashName("Gray.."), "Gray", "Gray", NULL);
- break;
case PPD_CS_RGB :
- apple_init_profile(ppd, NULL, profiles->profiles,
+ case PPD_CS_CMY :
+ apple_init_profile(ppd, NULL, profiles->profiles + 1,
_ppdHashName("RGB.."), "RGB", "RGB", NULL);
break;
+ case PPD_CS_RGBK :
case PPD_CS_CMYK :
- apple_init_profile(ppd, NULL, profiles->profiles,
+ apple_init_profile(ppd, NULL, profiles->profiles + 1,
_ppdHashName("CMYK.."), "CMYK", "CMYK", NULL);
break;
+ case PPD_CS_N :
+ apple_init_profile(ppd, NULL, profiles->profiles + 1,
+ _ppdHashName("DeviceN.."), "DeviceN", "DeviceN",
+ NULL);
+ break;
+
default :
- free(profiles);
- num_profiles = 0;
break;
}
}
if (num_profiles > 0)
{
+ /*
+ * Make sure we have a default profile ID...
+ */
+
+ if (!default_profile_id)
+ default_profile_id = profiles->profiles[num_profiles - 1].profileID;
+
/*
* Get the device ID hash and pathelogical name dictionary.
*/
cupsdLogMessage(CUPSD_LOG_INFO, "Registering ICC color profiles for \"%s\"",
p->name);
- id = _ppdHashName(p->name);
- name = CFDictionaryCreateMutable(kCFAllocatorDefault, 0,
- &kCFTypeDictionaryKeyCallBacks,
- &kCFTypeDictionaryValueCallBacks);
+ device_id = _ppdHashName(p->name);
+ device_name = CFDictionaryCreateMutable(kCFAllocatorDefault, 0,
+ &kCFTypeDictionaryKeyCallBacks,
+ &kCFTypeDictionaryValueCallBacks);
+ printer_name = CFStringCreateWithCString(kCFAllocatorDefault, p->name,
+ kCFStringEncodingUTF8);
- CFDictionarySetValue(name, CFSTR("en"),
- CFStringCreateWithCString(kCFAllocatorDefault, p->name,
- kCFStringEncodingUTF8));
+ if (device_name && printer_name)
+ {
+ CFDictionarySetValue(device_name, CFSTR("en"), printer_name);
- /*
- * Register the device with ColorSync...
- */
+ /*
+ * Register the device with ColorSync...
+ */
- error = CMRegisterColorDevice(cmPrinterDeviceClass, id, name, &scope);
+ error = CMRegisterColorDevice(cmPrinterDeviceClass, device_id,
+ device_name, &scope);
- /*
- * Register the profiles...
- */
+ /*
+ * Register the profiles...
+ */
- if (error == noErr)
- error = CMSetDeviceFactoryProfiles(cmPrinterDeviceClass, id,
- profiles->profiles[0].profileID,
- profiles);
+ if (error == noErr)
+ error = CMSetDeviceFactoryProfiles(cmPrinterDeviceClass, device_id,
+ default_profile_id, profiles);
+ }
+ else
+ error = 1000;
/*
* Clean up...
CFRelease(profile->profileName);
free(profiles);
- CFRelease(name);
+
+ if (printer_name)
+ CFRelease(printer_name);
+
+ if (device_name)
+ CFRelease(device_name);
}
ppdClose(ppd);
{
char resource[HTTP_MAX_URI]; /* Resource portion of URI */
cupsd_location_t *auth; /* Pointer to authentication element */
+ int auth_type; /* Type of authentication required */
if (printer->type & CUPS_PRINTER_CLASS)
if ((auth = cupsdFindBest(resource, HTTP_POST)) == NULL ||
auth->type == CUPSD_AUTH_NONE)
- auth = cupsdFindPolicyOp(printer->op_policy_ptr, IPP_PRINT_JOB);
+ auth = cupsdFindPolicyOp(printer->op_policy_ptr,
+ con->request ?
+ con->request->request.op.operation_id :
+ IPP_PRINT_JOB);
+
+ if (!auth)
+ auth_type = CUPSD_AUTH_NONE;
+ else if (auth->type == CUPSD_AUTH_DEFAULT)
+ auth_type = DefaultAuthType;
+ else
+ auth_type = auth->type;
- cupsdSendError(con, status, auth ? auth->type : CUPSD_AUTH_NONE);
+ cupsdSendError(con, status, auth_type);
}
else
cupsdSendError(con, status, CUPSD_AUTH_NONE);
if (!filters)
filters = cupsArrayNew(NULL, NULL);
+ port_monitor.src = NULL;
+ port_monitor.dst = NULL;
+ port_monitor.cost = 0;
+
+ snprintf(port_monitor.filter, sizeof(port_monitor.filter),
+ "%s/monitor/%s", ServerBin, printer->port_monitor);
+
if (!cupsArrayAdd(filters, &port_monitor))
{
cupsdLogMessage(CUPSD_LOG_ERROR,
return;
}
-
- snprintf(port_monitor.filter, sizeof(port_monitor.filter),
- "%s/monitor/%s", ServerBin, printer->port_monitor);
}
/*
envp[envc ++] = device_uri;
envp[envc ++] = printer_name;
- if (!printer->remote && !printer->raw &&
- (filter = (mime_filter_t *)cupsArrayLast(filters)) != NULL &&
- filter->dst)
+ if (!printer->remote && !printer->raw)
{
- snprintf(final_content_type, sizeof(final_content_type),
- "FINAL_CONTENT_TYPE=%s/%s",
- filter->dst->super, filter->dst->type);
- envp[envc ++] = final_content_type;
+ filter = (mime_filter_t *)cupsArrayLast(filters);
+
+ if (printer->port_monitor)
+ filter = (mime_filter_t *)cupsArrayPrev(filters);
+
+ if (filter && filter->dst)
+ {
+ snprintf(final_content_type, sizeof(final_content_type),
+ "FINAL_CONTENT_TYPE=%s/%s",
+ filter->dst->super, filter->dst->type);
+ envp[envc ++] = final_content_type;
+ }
}
if (Classification && !banner_page)
envp[envc] = NULL;
for (i = 0; i < envc; i ++)
- if (!strncmp(envp[i], "CUPSD_AUTH_", 5))
- cupsdLogMessage(CUPSD_LOG_DEBUG, "[Job %d] envp[%d]=\"CUPSD_AUTH_%c****\"",
+ if (!strncmp(envp[i], "AUTH_", 5))
+ cupsdLogMessage(CUPSD_LOG_DEBUG, "[Job %d] envp[%d]=\"AUTH_%c****\"",
job->id, i, envp[i][5]);
else if (strncmp(envp[i], "DEVICE_URI=", 11))
cupsdLogMessage(CUPSD_LOG_DEBUG, "[Job %d] envp[%d]=\"%s\"",
*
* CUPS control program for the Common UNIX Printing System (CUPS).
*
- * Copyright 2007 by Apple Inc.
+ * Copyright 2007-2008 by Apple Inc.
* Copyright 2006-2007 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
#include <cups/adminutil.h>
#include <cups/string.h>
#include <cups/i18n.h>
+#include <errno.h>
/*
* Connect to the server using the defaults...
*/
- http = httpConnectEncrypt(cupsServer(), ippPort(), cupsEncryption());
+ if ((http = httpConnectEncrypt(cupsServer(), ippPort(),
+ cupsEncryption())) == NULL)
+ {
+ _cupsLangPrintf(stderr, _("cupsctl: Unable to connect to server: %s\n"),
+ strerror(errno));
+ return (1);
+ }
/*
* Set the current configuration if we have anything on the command-line...
echo "A HTML report was created in test/$strfile."
echo ""
+if test $fail != 0; then
+ exit 1
+fi
+
#
# End of "$Id: run-stp-tests.sh 6649 2007-07-11 21:46:42Z mike $"
#