Comparar commits

..

1 Commits

Autor SHA1 Mensagem Data
msweet 641f3d83c2 Import cups.org releases
git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/tags/release-1.0b7@4306 a1ca3aef-8c08-0410-bb20-df032aa958be
2013-05-10 18:56:23 +00:00
23 arquivos alterados com 275 adições e 339 exclusões
+7 -7
Ver Arquivo
@@ -1,4 +1,4 @@
README - CUPS v1.0b8 - 08/31/1999
README - CUPS v1.0b6 - 07/30/1999
---------------------------------
BETA SOFTWARE BETA SOFTWARE BETA SOFTWARE BETA SOFTWARE BETA SOFTWARE
@@ -57,7 +57,7 @@ the binary distributions from Easy Software Products:
- Digital UNIX (aka OSF1 aka Compaq Tru64 UNIX) 4.0 or higher
- HP-UX 10.20 or higher
- IRIX 5.3 or higher
- Linux 2.0 with glibc2 or higher (tested with RedHat 5.2)
- Linux 2.0.36 with glibc2 or higher (tested with RedHat 5.2)
- Solaris 2.5 or higher (SPARC or Intel)
@@ -124,11 +124,6 @@ Similarly, for the sample LaserJet driver you can use "LaserJet" and
For other printers and interfaces see the CUPS System Administator's
Manual included with this software.
If you're interested in a complete, commercial printing solution for
UNIX, check out our ESP Print Pro software at:
http://www.easysw.com/printpro
PRINTING FILES
@@ -193,3 +188,8 @@ licensing information, please contact:
Voice: +1.301.373.9603
Email: cups-info@cups.org
WWW: http://www.cups.org
If you're interested in a complete, commercial printing solution for
UNIX, check out our ESP Print Pro software at:
http://www.easysw.com/printpro
+1 -1
Ver Arquivo
@@ -28,7 +28,7 @@
* Version of software...
*/
#define CUPS_SVERSION "CUPS v1.0b8"
#define CUPS_SVERSION "CUPS v1.0"
/*
* Where are files stored?
+1 -2
Ver Arquivo
@@ -91,7 +91,6 @@ AC_PROG_RANLIB
AC_PATH_PROG(AR,ar)
AC_PATH_PROG(CHMOD,chmod)
AC_PATH_PROG(CP,cp)
AC_PATH_PROG(MV,mv)
AC_PATH_PROG(NROFF,nroff)
if test "$NROFF" = ""; then
AC_PATH_PROG(GROFF,groff)
@@ -273,7 +272,7 @@ if test "$prefix" = "NONE"; then
fi
dnl Fix "libdir" variable for IRIX 6.x...
if test "$uname" = "IRIX" -a $uversion -ge 65; then
if test "$uname" = "IRIX" -a $uversion -ge 62; then
libdir="/usr/lib32"
fi
+11 -26
Ver Arquivo
@@ -685,11 +685,6 @@ httpRead(http_t *http, /* I - HTTP data */
* data, go idle...
*/
if (http->data_encoding == HTTP_ENCODE_CHUNKED &&
(http->state == HTTP_GET_SEND || http->state == HTTP_POST_RECV ||
http->state == HTTP_POST_SEND || http->state == HTTP_PUT_RECV))
httpGets(len, sizeof(len), http);
if (http->state == HTTP_POST_RECV)
http->state ++;
else
@@ -725,20 +720,12 @@ httpRead(http_t *http, /* I - HTTP data */
if (bytes > 0)
http->data_remaining -= bytes;
if (http->data_remaining == 0)
if (http->data_remaining == 0 && http->data_encoding != HTTP_ENCODE_CHUNKED)
{
if (http->data_encoding == HTTP_ENCODE_CHUNKED &&
(http->state == HTTP_GET_SEND || http->state == HTTP_POST_RECV ||
http->state == HTTP_POST_SEND || http->state == HTTP_PUT_RECV))
httpGets(len, sizeof(len), http);
if (http->data_encoding != HTTP_ENCODE_CHUNKED)
{
if (http->state == HTTP_POST_RECV)
http->state ++;
else
http->state = HTTP_WAITING;
}
if (http->state == HTTP_POST_RECV)
http->state ++;
else
http->state = HTTP_WAITING;
}
return (bytes);
@@ -767,8 +754,11 @@ httpWrite(http_t *http, /* I - HTTP data */
if (http->data_encoding == HTTP_ENCODE_CHUNKED &&
(http->state == HTTP_GET_SEND || http->state == HTTP_POST_RECV ||
http->state == HTTP_POST_SEND || http->state == HTTP_PUT_RECV))
if (httpPrintf(http, "%x\r\n", length) < 0)
{
sprintf(len, "%x\r\n", length);
if (send(http->fd, len, strlen(len), 0) < 3)
return (-1);
}
if (length == 0)
{
@@ -804,12 +794,6 @@ httpWrite(http_t *http, /* I - HTTP data */
http->data_remaining -= bytes;
}
if (http->data_encoding == HTTP_ENCODE_CHUNKED &&
(http->state == HTTP_GET_SEND || http->state == HTTP_POST_RECV ||
http->state == HTTP_POST_SEND || http->state == HTTP_PUT_RECV))
if (httpPrintf(http, "\r\n") < 0)
return (-1);
if (http->data_remaining == 0 && http->data_encoding == HTTP_ENCODE_LENGTH)
{
/*
@@ -879,7 +863,8 @@ httpGets(char *line, /* I - Line to read into */
* Nope, can't get a line this time...
*/
if (errno != lasterror)
if (errno != lasterror && errno != ECONNRESET &&
errno != ECONNABORTED && errno != ENETRESET)
{
lasterror = errno;
continue;
+1 -2
Ver Arquivo
@@ -149,8 +149,7 @@ cupsLangGet(const char *language) /* I - Language or locale */
* operating systems.
*/
if (language == NULL || language[0] == '\0' ||
strcmp(language, "POSIX") == 0)
if (language == NULL || language[0] == '\0')
strcpy(langname, "C");
else
strcpy(langname, language);
+1 -6
Ver Arquivo
@@ -177,12 +177,7 @@ typedef struct cups_lang_str /**** Language Cache Structure ****/
* Prototypes...
*/
# ifdef WIN32
# define cupsLangDefault() cupsLangGet(setlocale(LC_ALL, ""))
# else /* This fix works around bugs in the Linux and HP-UX setlocale() */
# define cupsLangDefault() cupsLangGet(getenv("LANG"))
# endif /* WIN32 */
# define cupsLangDefault() cupsLangGet(setlocale(LC_ALL, ""))
extern char *cupsLangEncoding(cups_lang_t *lang);
extern void cupsLangFlush(void);
extern void cupsLangFree(cups_lang_t *lang);
-2
Ver Arquivo
@@ -456,8 +456,6 @@ ppdOpen(FILE *fp) /* I - File to read from */
return (NULL);
}
DEBUG_printf(("ppdOpen: keyword = %s, string = %08x\n", keyword, string));
safe_free(string);
/*
+35 -35
Ver Arquivo
@@ -84,9 +84,9 @@ static void zshear(float [3][3], float, float);
*/
void
ImageWhiteToWhite(const ib_t *in, /* I - Input pixels */
ib_t *out, /* I - Output pixels */
int count) /* I - Number of pixels */
ImageWhiteToWhite(ib_t *in, /* I - Input pixels */
ib_t *out, /* I - Output pixels */
int count) /* I - Number of pixels */
{
if (ImageHaveProfile)
while (count > 0)
@@ -104,9 +104,9 @@ ImageWhiteToWhite(const ib_t *in, /* I - Input pixels */
*/
void
ImageWhiteToRGB(const ib_t *in, /* I - Input pixels */
ib_t *out, /* I - Output pixels */
int count) /* I - Number of pixels */
ImageWhiteToRGB(ib_t *in, /* I - Input pixels */
ib_t *out, /* I - Output pixels */
int count) /* I - Number of pixels */
{
if (ImageHaveProfile)
while (count > 0)
@@ -133,9 +133,9 @@ ImageWhiteToRGB(const ib_t *in, /* I - Input pixels */
*/
void
ImageWhiteToBlack(const ib_t *in, /* I - Input pixels */
ib_t *out, /* I - Output pixels */
int count) /* I - Number of pixels */
ImageWhiteToBlack(ib_t *in, /* I - Input pixels */
ib_t *out, /* I - Output pixels */
int count) /* I - Number of pixels */
{
if (ImageHaveProfile)
while (count > 0)
@@ -157,9 +157,9 @@ ImageWhiteToBlack(const ib_t *in, /* I - Input pixels */
*/
void
ImageWhiteToCMY(const ib_t *in, /* I - Input pixels */
ib_t *out, /* I - Output pixels */
int count) /* I - Number of pixels */
ImageWhiteToCMY(ib_t *in, /* I - Input pixels */
ib_t *out, /* I - Output pixels */
int count) /* I - Number of pixels */
{
if (ImageHaveProfile)
while (count > 0)
@@ -186,9 +186,9 @@ ImageWhiteToCMY(const ib_t *in, /* I - Input pixels */
*/
void
ImageWhiteToCMYK(const ib_t *in, /* I - Input pixels */
ib_t *out, /* I - Output pixels */
int count) /* I - Number of pixels */
ImageWhiteToCMYK(ib_t *in, /* I - Input pixels */
ib_t *out, /* I - Output pixels */
int count) /* I - Number of pixels */
{
if (ImageHaveProfile)
while (count > 0)
@@ -216,9 +216,9 @@ ImageWhiteToCMYK(const ib_t *in, /* I - Input pixels */
*/
void
ImageRGBToBlack(const ib_t *in, /* I - Input pixels */
ib_t *out, /* I - Output pixels */
int count) /* I - Number of pixels */
ImageRGBToBlack(ib_t *in, /* I - Input pixels */
ib_t *out, /* I - Output pixels */
int count) /* I - Number of pixels */
{
if (ImageHaveProfile)
while (count > 0)
@@ -242,9 +242,9 @@ ImageRGBToBlack(const ib_t *in, /* I - Input pixels */
*/
void
ImageRGBToCMY(const ib_t *in, /* I - Input pixels */
ib_t *out, /* I - Output pixels */
int count) /* I - Number of pixels */
ImageRGBToCMY(ib_t *in, /* I - Input pixels */
ib_t *out, /* I - Output pixels */
int count) /* I - Number of pixels */
{
int c, m, y, k; /* CMYK values */
int cc, cm, cy; /* Calibrated CMY values */
@@ -316,9 +316,9 @@ ImageRGBToCMY(const ib_t *in, /* I - Input pixels */
*/
void
ImageRGBToCMYK(const ib_t *in, /* I - Input pixels */
ib_t *out, /* I - Output pixels */
int count)/* I - Number of pixels */
ImageRGBToCMYK(ib_t *in, /* I - Input pixels */
ib_t *out, /* I - Output pixels */
int count) /* I - Number of pixels */
{
int c, m, y, k, /* CMYK values */
diff, /* Color differences */
@@ -385,7 +385,7 @@ ImageRGBToCMYK(const ib_t *in, /* I - Input pixels */
else if (cy > 255)
*out++ = ImageDensity[255];
else
*out++ = ImageDensity[cy];
*out++ = cy;
*out++ = ImageDensity[k];
@@ -433,9 +433,9 @@ ImageRGBToCMYK(const ib_t *in, /* I - Input pixels */
*/
void
ImageRGBToWhite(const ib_t *in, /* I - Input pixels */
ib_t *out, /* I - Output pixels */
int count) /* I - Number of pixels */
ImageRGBToWhite(ib_t *in, /* I - Input pixels */
ib_t *out, /* I - Output pixels */
int count) /* I - Number of pixels */
{
if (ImageHaveProfile)
while (count > 0)
@@ -459,9 +459,9 @@ ImageRGBToWhite(const ib_t *in, /* I - Input pixels */
*/
void
ImageRGBToRGB(const ib_t *in, /* I - Input pixels */
ib_t *out, /* I - Output pixels */
int count) /* I - Number of pixels */
ImageRGBToRGB(ib_t *in, /* I - Input pixels */
ib_t *out, /* I - Output pixels */
int count) /* I - Number of pixels */
{
int c, m, y, k; /* CMYK values */
int cr, cg, cb; /* Calibrated RGB values */
@@ -521,9 +521,9 @@ ImageRGBToRGB(const ib_t *in, /* I - Input pixels */
*/
void
ImageLut(ib_t *pixels, /* IO - Input/output pixels */
int count, /* I - Number of pixels/bytes to adjust */
const ib_t *lut) /* I - Lookup table */
ImageLut(ib_t *pixels, /* I - Input/output pixels */
int count, /* I - Number of pixels/bytes to adjust */
ib_t *lut) /* I - Lookup table */
{
while (count > 0)
{
@@ -539,7 +539,7 @@ ImageLut(ib_t *pixels, /* IO - Input/output pixels */
*/
void
ImageRGBAdjust(ib_t *pixels, /* IO - Input/output pixels */
ImageRGBAdjust(ib_t *pixels, /* I - Input/output pixels */
int count, /* I - Number of pixels to adjust */
int saturation, /* I - Color saturation (%) */
int hue) /* I - Color hue (degrees) */
+14 -14
Ver Arquivo
@@ -72,14 +72,14 @@ static int gif_read_image(FILE *fp, image_t *img, gif_cmap_t cmap,
* 'ImageReadGIF()' - Read a GIF image file.
*/
int /* O - Read status */
ImageReadGIF(image_t *img, /* IO - Image */
FILE *fp, /* I - Image file */
int primary, /* I - Primary choice for colorspace */
int secondary, /* I - Secondary choice for colorspace */
int saturation, /* I - Color saturation (%) */
int hue, /* I - Color hue (degrees) */
const ib_t *lut) /* I - Lookup table for gamma/brightness */
int /* O - Read status */
ImageReadGIF(image_t *img, /* IO - Image */
FILE *fp, /* I - Image file */
int primary, /* I - Primary choice for colorspace */
int secondary, /* I - Secondary choice for colorspace */
int saturation,/* I - Color saturation (%) */
int hue, /* I - Color hue (degrees) */
ib_t *lut) /* I - Lookup table for gamma/brightness */
{
unsigned char buf[1024]; /* Input buffer */
gif_cmap_t cmap; /* Colormap */
@@ -236,13 +236,13 @@ ImageReadGIF(image_t *img, /* IO - Image */
* 'gif_read_cmap()' - Read the colormap from a GIF file...
*/
static int /* O - -1 on error, 0 on success */
gif_read_cmap(FILE *fp, /* I - File to read from */
int ncolors, /* I - Number of colors in file */
gif_cmap_t cmap, /* O - Colormap information */
int *gray) /* IO - Is the image grayscale? */
static int
gif_read_cmap(FILE *fp,
int ncolors,
gif_cmap_t cmap,
int *gray)
{
int i; /* Looping var */
int i;
/*
+7 -7
Ver Arquivo
@@ -41,13 +41,13 @@
*/
int /* O - Read status */
ImageReadJPEG(image_t *img, /* IO - Image */
FILE *fp, /* I - Image file */
int primary, /* I - Primary choice for colorspace */
int secondary, /* I - Secondary choice for colorspace */
int saturation, /* I - Color saturation (%) */
int hue, /* I - Color hue (degrees) */
const ib_t *lut) /* I - Lookup table for gamma/brightness */
ImageReadJPEG(image_t *img, /* IO - Image */
FILE *fp, /* I - Image file */
int primary, /* I - Primary choice for colorspace */
int secondary, /* I - Secondary choice for colorspace */
int saturation, /* I - Color saturation (%) */
int hue, /* I - Color hue (degrees) */
ib_t *lut) /* I - Lookup table for gamma/brightness */
{
struct jpeg_decompress_struct cinfo; /* Decompressor info */
struct jpeg_error_mgr jerr; /* Error handler info */
+7 -7
Ver Arquivo
@@ -44,13 +44,13 @@
*/
int /* O - Read status */
ImageReadPhotoCD(image_t *img, /* IO - Image */
FILE *fp, /* I - Image file */
int primary, /* I - Primary choice for colorspace */
int secondary, /* I - Secondary choice for colorspace */
int saturation, /* I - Color saturation (%) */
int hue, /* I - Color hue (degrees) */
const ib_t *lut) /* I - Lookup table for gamma/brightness */
ImageReadPhotoCD(image_t *img, /* IO - Image */
FILE *fp, /* I - Image file */
int primary, /* I - Primary choice for colorspace */
int secondary, /* I - Secondary choice for colorspace */
int saturation, /* I - Color saturation (%) */
int hue, /* I - Color hue (degrees) */
ib_t *lut) /* I - Lookup table for gamma/brightness */
{
int x, y; /* Looping vars */
int xdir, /* X direction */
+8 -8
Ver Arquivo
@@ -40,14 +40,14 @@
* 'ImageReadPNG()' - Read a PNG image file.
*/
int /* O - Read status */
ImageReadPNG(image_t *img, /* IO - Image */
FILE *fp, /* I - Image file */
int primary, /* I - Primary choice for colorspace */
int secondary, /* I - Secondary choice for colorspace */
int saturation, /* I - Color saturation (%) */
int hue, /* I - Color hue (degrees) */
const ib_t *lut) /* I - Lookup table for gamma/brightness */
int /* O - Read status */
ImageReadPNG(image_t *img, /* IO - Image */
FILE *fp, /* I - Image file */
int primary, /* I - Primary choice for colorspace */
int secondary, /* I - Secondary choice for colorspace */
int saturation,/* I - Color saturation (%) */
int hue, /* I - Color hue (degrees) */
ib_t *lut) /* I - Lookup table for gamma/brightness */
{
int y; /* Looping var */
png_structp pp; /* PNG read pointer */
+8 -8
Ver Arquivo
@@ -38,14 +38,14 @@
* 'ImageReadPNM()' - Read a PNM image file.
*/
int /* O - Read status */
ImageReadPNM(image_t *img, /* IO - Image */
FILE *fp, /* I - Image file */
int primary, /* I - Primary choice for colorspace */
int secondary, /* I - Secondary choice for colorspace */
int saturation, /* I - Color saturation (%) */
int hue, /* I - Color hue (degrees) */
const ib_t *lut) /* I - Lookup table for gamma/brightness */
int /* O - Read status */
ImageReadPNM(image_t *img, /* IO - Image */
FILE *fp, /* I - Image file */
int primary, /* I - Primary choice for colorspace */
int secondary, /* I - Secondary choice for colorspace */
int saturation,/* I - Color saturation (%) */
int hue, /* I - Color hue (degrees) */
ib_t *lut) /* I - Lookup table for gamma/brightness */
{
int x, y; /* Looping vars */
int bpp; /* Bytes per pixel */
+8 -8
Ver Arquivo
@@ -38,14 +38,14 @@
* 'ImageReadSGI()' - Read a SGI image file.
*/
int /* O - Read status */
ImageReadSGI(image_t *img, /* IO - Image */
FILE *fp, /* I - Image file */
int primary, /* I - Primary choice for colorspace */
int secondary, /* I - Secondary choice for colorspace */
int saturation, /* I - Color saturation (%) */
int hue, /* I - Color hue (degrees) */
const ib_t *lut) /* I - Lookup table for gamma/brightness */
int /* O - Read status */
ImageReadSGI(image_t *img, /* IO - Image */
FILE *fp, /* I - Image file */
int primary, /* I - Primary choice for colorspace */
int secondary, /* I - Secondary choice for colorspace */
int saturation,/* I - Color saturation (%) */
int hue, /* I - Color hue (degrees) */
ib_t *lut) /* I - Lookup table for gamma/brightness */
{
int i, y; /* Looping vars */
int bpp; /* Bytes per pixel */
+7 -7
Ver Arquivo
@@ -75,13 +75,13 @@ static unsigned read_unsigned(FILE *fp);
*/
int /* O - Read status */
ImageReadSunRaster(image_t *img, /* IO - Image */
FILE *fp, /* I - Image file */
int primary, /* I - Primary choice for colorspace */
int secondary,/* I - Secondary choice for colorspace */
int saturation,/* I - Color saturation (%) */
int hue, /* I - Color hue (degrees) */
const ib_t *lut) /* I - Lookup table for gamma/brightness */
ImageReadSunRaster(image_t *img, /* IO - Image */
FILE *fp, /* I - Image file */
int primary, /* I - Primary choice for colorspace */
int secondary, /* I - Secondary choice for colorspace */
int saturation, /* I - Color saturation (%) */
int hue, /* I - Color hue (degrees) */
ib_t *lut) /* I - Lookup table for gamma/brightness */
{
int i, x, y,
bpp, /* Bytes per pixel */
+7 -7
Ver Arquivo
@@ -42,13 +42,13 @@
*/
int /* O - Read status */
ImageReadTIFF(image_t *img, /* IO - Image */
FILE *fp, /* I - Image file */
int primary, /* I - Primary choice for colorspace */
int secondary, /* I - Secondary choice for colorspace */
int saturation, /* I - Color saturation (%) */
int hue, /* I - Color hue (degrees) */
const ib_t *lut) /* I - Lookup table for gamma/brightness */
ImageReadTIFF(image_t *img, /* IO - Image */
FILE *fp, /* I - Image file */
int primary, /* I - Primary choice for colorspace */
int secondary, /* I - Secondary choice for colorspace */
int saturation, /* I - Color saturation (%) */
int hue, /* I - Color hue (degrees) */
ib_t *lut) /* I - Lookup table for gamma/brightness */
{
TIFF *tif; /* TIFF file */
uint32 width, height; /* Size of image */
+115 -132
Ver Arquivo
@@ -67,12 +67,12 @@ static void flush_tile(image_t *img);
*/
image_t * /* O - New image */
ImageOpen(char *filename, /* I - Filename of image */
int primary, /* I - Primary colorspace needed */
int secondary, /* I - Secondary colorspace if primary no good */
int saturation,/* I - Color saturation level */
int hue, /* I - Color hue adjustment */
const ib_t *lut) /* I - RGB gamma/brightness LUT */
ImageOpen(char *filename, /* I - Filename of image */
int primary, /* I - Primary colorspace needed */
int secondary, /* I - Secondary colorspace if primary no good */
int saturation, /* I - Color saturation level */
int hue, /* I - Color hue adjustment */
ib_t *lut) /* I - RGB gamma/brightness LUT */
{
FILE *fp; /* File pointer */
unsigned char header[16], /* First 16 bytes of file */
@@ -105,7 +105,6 @@ ImageOpen(char *filename, /* I - Filename of image */
memset(header2, 0, sizeof(header2));
fread(header2, 1, sizeof(header2), fp);
fseek(fp, 0, SEEK_SET);
lseek(fileno(fp), 0, SEEK_SET); /* Avoid standard C library bugs */
/*
* Allocate memory...
@@ -179,46 +178,33 @@ ImageClose(image_t *img) /* I - Image to close */
*next; /* Next cached tile */
/*
* Free the image cache...
*/
for (current = img->first; current != NULL; current = next)
{
next = current->next;
free(current);
}
/*
* Wipe the tile cache file (if any)...
*/
if (img->cachefile != NULL)
{
fprintf(stderr, "DEBUG: Closing and removing swap file \"%s\"...\n",
img->cachename);
fclose(img->cachefile);
unlink(img->cachename);
}
/*
* Free the image cache...
*/
fputs("DEBUG: Freeing memory...\n", stderr);
for (current = img->first; current != NULL; current = next)
{
fprintf(stderr, "DEBUG: Freeing cache (%08lx, next = %08lx)...\n",
current, next);
next = current->next;
free(current);
}
/*
* Free the rest of memory...
*/
if (img->tiles != NULL)
{
fprintf(stderr, "DEBUG: Freeing tiles (%08lx)...\n", img->tiles[0]);
free(img->tiles[0]);
fprintf(stderr, "DEBUG: Freeing tile pointers (%08lx)...\n", img->tiles);
free(img->tiles);
}
@@ -230,7 +216,7 @@ ImageClose(image_t *img) /* I - Image to close */
* 'ImageSetMaxTiles()' - Set the maximum number of tiles to cache.
*
* If the "max_tiles" argument is 0 then the maximum number of tiles is
* computed from the image size or the RIP_CACHE environment variable.
* computed from the image size.
*/
void
@@ -287,7 +273,9 @@ ImageSetMaxTiles(image_t *img, /* I - Image to set */
img->max_ics = max_tiles;
fprintf(stderr, "DEBUG: max_ics=%d...\n", img->max_ics);
#ifdef DEBUG
fprintf(stderr, "ImageSetMaxTiles: max_ics=%d...\n", img->max_ics);
#endif /* DEBUG */
}
@@ -300,19 +288,18 @@ ImageSetProfile(float d, /* I - Ink/marker density */
float g, /* I - Ink/marker gamma */
float matrix[3][3]) /* I - Color transform matrix */
{
int i, j, k; /* Looping vars */
float m; /* Current matrix value */
int *im; /* Pointer into ImageMatrix */
int i, j, k; /* Looping vars */
ImageHaveProfile = 1;
for (i = 0, im = ImageMatrix[0][0]; i < 3; i ++)
for (i = 0; i < 3; i ++)
for (j = 0; j < 3; j ++)
for (k = 0, m = matrix[i][j]; k < 256; k ++)
*im++ = (int)(k * m + 0.5);
for (k = 0; k < 256; k ++)
ImageMatrix[i][j][k] = (int)(k * matrix[i][j] + 0.5);
for (k = 0, im = ImageDensity; k < 256; k ++)
*im++ = 255.0 * d * pow((float)k / 255.0, g) + 0.5;
for (k = 0; k < 256; k ++)
ImageDensity[k] = 255.0 * d * pow((float)k / 255.0, g) + 0.5;
}
@@ -320,17 +307,17 @@ ImageSetProfile(float d, /* I - Ink/marker density */
* 'ImageGetCol()' - Get a column of pixels from an image.
*/
int /* O - -1 on error, 0 on success */
ImageGetCol(image_t *img, /* I - Image */
int x, /* I - Column */
int y, /* I - Start row */
int height, /* I - Column height */
ib_t *pixels) /* O - Pixel data */
int
ImageGetCol(image_t *img,
int x,
int y,
int height,
ib_t *pixels)
{
int bpp, /* Bytes per pixel */
twidth, /* Tile width */
count; /* Number of pixels to get */
const ib_t *ib; /* Pointer into tile */
int bpp,
twidth,
count;
ib_t *ib;
if (img == NULL || x < 0 || x >= img->xsize || y >= img->ysize)
@@ -387,16 +374,16 @@ ImageGetCol(image_t *img, /* I - Image */
* 'ImageGetRow()' - Get a row of pixels from an image.
*/
int /* O - -1 on error, 0 on success */
ImageGetRow(image_t *img, /* I - Image */
int x, /* I - Start column */
int y, /* I - Row */
int width, /* I - Width of row */
ib_t *pixels) /* O - Pixel data */
int
ImageGetRow(image_t *img,
int x,
int y,
int width,
ib_t *pixels)
{
int bpp, /* Bytes per pixel */
count; /* Number of pixels to get */
const ib_t *ib; /* Pointer to pixels */
int bpp,
count;
ib_t *ib;
if (img == NULL || y < 0 || y >= img->ysize || x >= img->xsize)
@@ -440,19 +427,19 @@ ImageGetRow(image_t *img, /* I - Image */
* 'ImagePutCol()' - Put a column of pixels to an image.
*/
int /* O - -1 on error, 0 on success */
ImagePutCol(image_t *img, /* I - Image */
int x, /* I - Column */
int y, /* I - Start row */
int height, /* I - Column height */
const ib_t *pixels) /* I - Pixels to put */
int
ImagePutCol(image_t *img,
int x,
int y,
int height,
ib_t *pixels)
{
int bpp, /* Bytes per pixel */
twidth, /* Width of tile */
count; /* Number of pixels to put */
int tilex, /* Column within tile */
tiley; /* Row within tile */
ib_t *ib; /* Pointer to pixels in tile */
int bpp,
twidth,
count;
int tilex,
tiley;
ib_t *ib;
if (img == NULL || x < 0 || x >= img->xsize || y >= img->ysize)
@@ -514,18 +501,18 @@ ImagePutCol(image_t *img, /* I - Image */
* 'ImagePutRow()' - Put a row of pixels to an image.
*/
int /* O - -1 on error, 0 on success */
ImagePutRow(image_t *img, /* I - Image */
int x, /* I - Start column */
int y, /* I - Row */
int width, /* I - Row width */
const ib_t *pixels) /* I - Pixel data */
int
ImagePutRow(image_t *img,
int x,
int y,
int width,
ib_t *pixels)
{
int bpp, /* Bytes per pixel */
count; /* Number of pixels to put */
int tilex, /* Column within tile */
tiley; /* Row within tile */
ib_t *ib; /* Pointer to pixels in tile */
int bpp,
count;
int tilex,
tiley;
ib_t *ib;
if (img == NULL || y < 0 || y >= img->ysize || x >= img->xsize)
@@ -574,33 +561,28 @@ ImagePutRow(image_t *img, /* I - Image */
* 'get_tile()' - Get a cached tile.
*/
static ib_t * /* O - Pointer to tile or NULL */
get_tile(image_t *img, /* I - Image */
int x, /* I - Column in image */
int y) /* I - Row in image */
static ib_t *
get_tile(image_t *img,
int x,
int y)
{
int bpp, /* Bytes per pixel */
tilex, /* Column within tile */
tiley, /* Row within tile */
xtiles, /* Number of tiles horizontally */
ytiles; /* Number of tiles vertically */
ic_t *ic; /* Cache pointer */
itile_t *tile; /* Tile pointer */
int bpp,
tilex,
tiley,
xtiles,
ytiles;
ic_t *ic;
itile_t *tile;
if (x >= img->xsize || y >= img->ysize)
{
fprintf(stderr, "ERROR: Internal image RIP error - %d,%d is outside of %dx%d\n",
x, y, img->xsize, img->ysize);
return (NULL);
}
if (img->tiles == NULL)
{
xtiles = (img->xsize + TILE_SIZE - 1) / TILE_SIZE;
ytiles = (img->ysize + TILE_SIZE - 1) / TILE_SIZE;
fprintf(stderr, "DEBUG: Creating tile array (%dx%d)\n", xtiles, ytiles);
#ifdef DEBUG
fprintf(stderr, "get_tile: Creating tile array (%dx%d)\n", xtiles, ytiles);
#endif /* DEBUG */
img->tiles = calloc(sizeof(itile_t *), ytiles);
tile = calloc(sizeof(itile_t), xtiles * ytiles);
@@ -625,18 +607,20 @@ get_tile(image_t *img, /* I - Image */
{
if (img->num_ics < img->max_ics)
{
#ifdef DEBUG
fputs("get_tile: Allocating new cache tile...\n", stderr);
#endif /* DEBUG */
ic = calloc(sizeof(ic_t) + bpp * TILE_SIZE * TILE_SIZE, 1);
ic->pixels = ((ib_t *)ic) + sizeof(ic_t);
img->num_ics ++;
fprintf(stderr, "DEBUG: Allocated cache tile %d (%08lx)...\n",
img->num_ics, ic);
}
else
{
fprintf(stderr, "DEBUG: Flushing old cache tile (%08lx)...\n",
img->first);
#ifdef DEBUG
fputs("get_tile: Flushing old cache tile...\n", stderr);
#endif /* DEBUG */
flush_tile(img);
ic = img->first;
@@ -647,8 +631,10 @@ get_tile(image_t *img, /* I - Image */
if (tile->pos >= 0)
{
fprintf(stderr, "DEBUG: Loading cache tile from file position %d...\n",
#ifdef DEBUG
fprintf(stderr, "get_tile: loading cache tile from file position %d...\n",
tile->pos);
#endif /* DEBUG */
if (ftell(img->cachefile) != tile->pos)
if (fseek(img->cachefile, tile->pos, SEEK_SET))
@@ -658,7 +644,9 @@ get_tile(image_t *img, /* I - Image */
}
else
{
fputs("DEBUG: Clearing cache tile...\n", stderr);
#ifdef DEBUG
fputs("get_tile: Clearing cache tile...\n", stderr);
#endif /* DEBUG */
memset(ic->pixels, 0, bpp * TILE_SIZE * TILE_SIZE);
}
@@ -689,13 +677,17 @@ get_tile(image_t *img, /* I - Image */
*/
static void
flush_tile(image_t *img) /* I - Image */
flush_tile(image_t *img)
{
int bpp; /* Bytes per pixel */
itile_t *tile; /* Pointer to tile */
int bpp;
itile_t *tile;
#ifdef DEBUG
fprintf(stderr, "flush_tile(%08x)...\n", img);
#endif /* DEBUG */
bpp = ImageGetDepth(img);
tile = img->first->tile;
@@ -709,13 +701,14 @@ flush_tile(image_t *img) /* I - Image */
{
cupsTempFile(img->cachename, sizeof(img->cachename));
fprintf(stderr, "DEBUG: Creating swap file \"%s\"...\n", img->cachename);
#ifdef DEBUG
fprintf(stderr, "flush_tile: Creating cache file %s...\n", img->cachename);
#endif /* DEBUG */
if ((img->cachefile = fopen(img->cachename, "wb+")) == NULL)
{
perror("ERROR: Unable to create image swap file");
tile->ic = NULL;
tile->dirty = 0;
fprintf(stderr, "flush_tile: Unable to create swap file - %s\n",
strerror(errno));
return;
}
}
@@ -724,32 +717,22 @@ flush_tile(image_t *img) /* I - Image */
{
if (ftell(img->cachefile) != tile->pos)
if (fseek(img->cachefile, tile->pos, SEEK_SET))
{
perror("ERROR: Unable to seek in swap file");
tile->ic = NULL;
tile->dirty = 0;
return;
}
perror("flush_tile:");
}
else
{
if (fseek(img->cachefile, 0, SEEK_END))
{
perror("ERROR: Unable to append to swap file");
tile->ic = NULL;
tile->dirty = 0;
return;
}
perror("flush_tile:");
tile->pos = ftell(img->cachefile);
}
#ifdef DEBUG
fprintf(stderr, "flush_tile: Wrote tile cache at position %d...\n",
tile->pos);
#endif /* DEBUG */
if (fwrite(tile->ic->pixels, bpp, TILE_SIZE * TILE_SIZE, img->cachefile) < 1)
perror("ERROR: Unable to write tile to swap file");
else
fprintf(stderr, "DEBUG: Wrote tile at position %d...\n", tile->pos);
fwrite(tile->ic->pixels, bpp, TILE_SIZE * TILE_SIZE, img->cachefile);
tile->ic = NULL;
tile->dirty = 0;
}
+22 -24
Ver Arquivo
@@ -153,7 +153,7 @@ typedef struct
*/
extern image_t *ImageOpen(char *filename, int primary, int secondary,
int saturation, int hue, const ib_t *lut);
int saturation, int hue, ib_t *lut);
extern void ImageClose(image_t *img);
extern void ImageSetMaxTiles(image_t *img, int max_tiles);
extern void ImageSetProfile(float d, float g, float matrix[3][3]);
@@ -161,51 +161,49 @@ extern void ImageSetProfile(float d, float g, float matrix[3][3]);
#define ImageGetDepth(img) ((img)->colorspace < 0 ? -(img)->colorspace : (img)->colorspace)
extern int ImageGetCol(image_t *img, int x, int y, int height, ib_t *pixels);
extern int ImageGetRow(image_t *img, int x, int y, int width, ib_t *pixels);
extern int ImagePutCol(image_t *img, int x, int y, int height, const ib_t *pixels);
extern int ImagePutRow(image_t *img, int x, int y, int width, const ib_t *pixels);
extern int ImagePutCol(image_t *img, int x, int y, int height, ib_t *pixels);
extern int ImagePutRow(image_t *img, int x, int y, int width, ib_t *pixels);
/*
* File formats...
*/
extern int ImageReadGIF(image_t *img, FILE *fp, int primary, int secondary,
int saturation, int hue, const ib_t *lut);
int saturation, int hue, ib_t *lut);
extern int ImageReadJPEG(image_t *img, FILE *fp, int primary, int secondary,
int saturation, int hue, const ib_t *lut);
int saturation, int hue, ib_t *lut);
extern int ImageReadPNG(image_t *img, FILE *fp, int primary, int secondary,
int saturation, int hue, const ib_t *lut);
int saturation, int hue, ib_t *lut);
extern int ImageReadPNM(image_t *img, FILE *fp, int primary, int secondary,
int saturation, int hue, const ib_t *lut);
int saturation, int hue, ib_t *lut);
extern int ImageReadPhotoCD(image_t *img, FILE *fp, int primary,
int secondary, int saturation, int hue,
const ib_t *lut);
int secondary, int saturation, int hue, ib_t *lut);
extern int ImageReadSGI(image_t *img, FILE *fp, int primary, int secondary,
int saturation, int hue, const ib_t *lut);
int saturation, int hue, ib_t *lut);
extern int ImageReadSunRaster(image_t *img, FILE *fp, int primary,
int secondary, int saturation, int hue,
const ib_t *lut);
int secondary, int saturation, int hue, ib_t *lut);
extern int ImageReadTIFF(image_t *img, FILE *fp, int primary, int secondary,
int saturation, int hue, const ib_t *lut);
int saturation, int hue, ib_t *lut);
/*
* Colorspace conversions...
*/
extern void ImageWhiteToWhite(const ib_t *in, ib_t *out, int count);
extern void ImageWhiteToRGB(const ib_t *in, ib_t *out, int count);
extern void ImageWhiteToBlack(const ib_t *in, ib_t *out, int count);
extern void ImageWhiteToCMY(const ib_t *in, ib_t *out, int count);
extern void ImageWhiteToCMYK(const ib_t *in, ib_t *out, int count);
extern void ImageWhiteToWhite(ib_t *in, ib_t *out, int count);
extern void ImageWhiteToRGB(ib_t *in, ib_t *out, int count);
extern void ImageWhiteToBlack(ib_t *in, ib_t *out, int count);
extern void ImageWhiteToCMY(ib_t *in, ib_t *out, int count);
extern void ImageWhiteToCMYK(ib_t *in, ib_t *out, int count);
extern void ImageRGBToWhite(const ib_t *in, ib_t *out, int count);
extern void ImageRGBToRGB(const ib_t *in, ib_t *out, int count);
extern void ImageRGBToBlack(const ib_t *in, ib_t *out, int count);
extern void ImageRGBToCMY(const ib_t *in, ib_t *out, int count);
extern void ImageRGBToCMYK(const ib_t *in, ib_t *out, int count);
extern void ImageRGBToWhite(ib_t *in, ib_t *out, int count);
extern void ImageRGBToRGB(ib_t *in, ib_t *out, int count);
extern void ImageRGBToBlack(ib_t *in, ib_t *out, int count);
extern void ImageRGBToCMY(ib_t *in, ib_t *out, int count);
extern void ImageRGBToCMYK(ib_t *in, ib_t *out, int count);
extern void ImageRGBAdjust(ib_t *pixels, int count, int saturation, int hue);
extern void ImageLut(ib_t *pixels, int count, const ib_t *lut);
extern void ImageLut(ib_t *pixels, int count, ib_t *lut);
/*
* Image scaling operations...
+2 -15
Ver Arquivo
@@ -296,7 +296,7 @@ main(int argc, /* I - Number of command-line arguments */
resolution = "";
/*
* Choose the appropriate colorspace...
* Choose the appropriate colorspace and color profile...
*/
switch (header.cupsColorSpace)
@@ -388,25 +388,12 @@ main(int argc, /* I - Number of command-line arguments */
if (ppd != NULL)
{
fprintf(stderr, "DEBUG: Searching for profile \"%s/%s\"...\n",
resolution, media_type);
for (i = 0, profile = ppd->profiles; i < ppd->num_profiles; i ++, profile ++)
{
fprintf(stderr, "DEBUG: \"%s/%s\" = ", profile->resolution,
profile->media_type);
if ((strcmp(profile->resolution, resolution) == 0 ||
profile->resolution[0] == '-') &&
(strcmp(profile->media_type, media_type) == 0 ||
profile->media_type[0] == '-'))
{
fputs("MATCH!\n", stderr);
break;
}
else
fputs("no.\n", stderr);
}
/*
* If we found a color profile, use it!
@@ -609,7 +596,7 @@ main(int argc, /* I - Number of command-line arguments */
fprintf(stderr, "DEBUG: cupsColorSpace = %d\n", header.cupsColorSpace);
fprintf(stderr, "DEBUG: img->colorspace = %d\n", img->colorspace);
row = malloc(2 * header.cupsBytesPerLine);
row = malloc(header.cupsBytesPerLine);
ras = cupsRasterOpen(1, CUPS_RASTER_WRITE);
blank = img->colorspace < 0 ? 0 : ~0;
+4 -5
Ver Arquivo
@@ -721,7 +721,7 @@ ReadClient(client_t *con) /* I - Client to read from */
LogRequest(con, HTTP_OK);
}
if (httpPrintf(HTTP(con), "\r\n") < 0)
if (send(con->http.fd, "\r\n", 2, 0) < 0)
{
CloseClient(con);
return (0);
@@ -922,7 +922,7 @@ int /* O - 1 if successful, 0 otherwise */
SendError(client_t *con, /* I - Connection */
http_status_t code) /* I - Error code */
{
char message[1024]; /* Message for user */
char message[1024]; /* Text version of error code */
/*
@@ -969,8 +969,7 @@ SendError(client_t *con, /* I - Connection */
sprintf(message, "<HTML><HEAD><TITLE>%d %s</TITLE></HEAD>"
"<BODY><H1>%s</H1>%s</BODY></HTML>\n",
code, httpStatus(code), httpStatus(code),
con->language ? con->language->messages[code] :
httpStatus(code));
con->language ? con->language->messages[code] : httpStatus(code));
if (httpPrintf(HTTP(con), "Content-Type: text/html\r\n") < 0)
return (0);
@@ -978,7 +977,7 @@ SendError(client_t *con, /* I - Connection */
return (0);
if (httpPrintf(HTTP(con), "\r\n") < 0)
return (0);
if (httpPrintf(HTTP(con), "%s", message) < 0)
if (send(con->http.fd, message, strlen(message), 0) < 0)
return (0);
}
else if (httpPrintf(HTTP(con), "\r\n") < 0)
+1 -9
Ver Arquivo
@@ -138,7 +138,6 @@ ReadConfiguration(void)
int status; /* Return status */
char directory[1024];/* Configuration directory */
struct rlimit limit; /* Runtime limit */
char *language; /* Language string */
/*
@@ -190,14 +189,7 @@ ReadConfiguration(void)
strcpy(DocumentRoot, CUPS_DATADIR "/doc");
strcpy(AccessLog, "logs/access_log");
strcpy(ErrorLog, "logs/error_log");
if ((language = DEFAULT_LANGUAGE) == NULL)
language = "en";
else if (strcmp(language, "C") == 0 || strcmp(language, "POSIX") == 0)
language = "en";
strcpy(DefaultLanguage, language);
strcpy(DefaultLanguage, DEFAULT_LANGUAGE);
strcpy(DefaultCharset, DEFAULT_CHARSET);
strcpy(RIPCache, "8m");
if (getenv("TMPDIR") == NULL)
+1 -1
Ver Arquivo
@@ -49,7 +49,7 @@ VAR char ConfigurationFile[256] VALUE(CUPS_SERVERROOT "/conf/cupsd.conf"),
/* Root directory for scheduler */
DocumentRoot[1024] VALUE(CUPS_DATADIR "/doc"),
/* Root directory for documents */
SystemGroup[32],
SystemGroup[32] VALUE(DEFAULT_GROUP),
/* System group name */
AccessLog[1024] VALUE("logs/access_log"),
/* Access log filename */
+7 -6
Ver Arquivo
@@ -81,34 +81,35 @@
#define DEFAULT_TIMEOUT 300 /* Timeout during requests/updates */
#define DEFAULT_KEEPALIVE 60 /* Timeout between requests */
#define DEFAULT_INTERVAL 30 /* Interval between browse updates */
#ifdef WIN32 /* Fix for broken Linux setlocale() */
# define DEFAULT_LANGUAGE setlocale(LC_ALL,"")
#define DEFAULT_LANGUAGE setlocale(LC_ALL,NULL)
/* Default language encoding */
#else
# define DEFAULT_LANGUAGE getenv("LANG")
/* Default language encoding */
#endif /* !WIN32 */
#define DEFAULT_CHARSET "iso-8859-1"
/* Default charset */
#ifdef __sgi
# define DEFAULT_UID 9 /* Default user ID */
# define DEFAULT_GID 0 /* Default group ID */
# define DEFAULT_GROUP "sys" /* Default system group */
#elif defined(__hpux)
# define DEFAULT_UID 9 /* Default user ID */
# define DEFAULT_GID 0 /* Default group ID */
# define DEFAULT_GROUP "sys" /* Default system group */
#elif defined(__sun)
# define DEFAULT_UID 71 /* Default user ID */
# define DEFAULT_GID 0 /* Default group ID */
# define DEFAULT_GROUP "sys" /* Default system group */
#elif defined(__linux)
# define DEFAULT_UID 4 /* Default user ID */
# define DEFAULT_GID 0 /* Default group ID */
# define DEFAULT_GROUP "sys" /* Default system group */
#elif defined(__osf__)
# define DEFAULT_UID 8 /* Default user ID */
# define DEFAULT_GID 0 /* Default group ID */
# define DEFAULT_GROUP "system"/* Default system group */
#else
# define DEFAULT_UID 9 /* Default user ID */
# define DEFAULT_GID 0 /* Default group ID */
# define DEFAULT_GROUP "sys" /* Default system group */
#endif /* __sgi */