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
28 arquivos alterados com 303 adições e 415 exclusões
+7 -7
Ver Arquivo
@@ -1,4 +1,4 @@
README - CUPS v1.0b9 - 09/03/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
-8
Ver Arquivo
@@ -336,14 +336,6 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
}
}
/*
* If we are chunking the output from stdin, make sure we end up with
* a 0-length chunk at the end...
*/
if (fp == stdin)
httpWrite(http, buffer, 0);
fputs("INFO: Print file sent; checking status...\n", stderr);
/*
+1 -1
Ver Arquivo
@@ -28,7 +28,7 @@
* Version of software...
*/
#define CUPS_SVERSION "CUPS v1.0b9"
#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
+16 -43
Ver Arquivo
@@ -329,10 +329,7 @@ httpReconnect(http_t *http) /* I - HTTP data */
*/
if ((http->fd = socket(AF_INET, SOCK_STREAM, 0)) < 0)
{
http->error = errno;
return (-1);
}
#ifdef FD_CLOEXEC
fcntl(http->fd, F_SETFD, FD_CLOEXEC); /* Close this socket when starting *
@@ -354,8 +351,6 @@ httpReconnect(http_t *http) /* I - HTTP data */
if (connect(http->fd, (struct sockaddr *)&(http->hostaddr),
sizeof(http->hostaddr)) < 0)
{
http->error = errno;
#ifdef WIN32
closesocket(http->fd);
#else
@@ -364,8 +359,6 @@ httpReconnect(http_t *http) /* I - HTTP data */
return (-1);
}
else
http->error = 0;
return (0);
}
@@ -692,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
@@ -731,23 +719,13 @@ httpRead(http_t *http, /* I - HTTP data */
if (bytes > 0)
http->data_remaining -= bytes;
else if (bytes < 0)
http->error = errno;
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);
@@ -776,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)
{
@@ -813,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)
{
/*
@@ -850,6 +825,7 @@ httpGets(char *line, /* I - Line to read into */
*bufptr, /* Pointer into input buffer */
*bufend; /* Pointer to end of buffer */
int bytes; /* Number of bytes read */
int lasterror; /* Last error received */
DEBUG_printf(("httpGets(%08x, %d, %08x)\n", line, length, http));
@@ -861,7 +837,8 @@ httpGets(char *line, /* I - Line to read into */
* Pre-scan the buffer and see if there is a newline in there...
*/
errno = 0;
lasterror = 0;
errno = 0;
do
{
@@ -886,9 +863,10 @@ httpGets(char *line, /* I - Line to read into */
* Nope, can't get a line this time...
*/
if (errno != http->error)
if (errno != lasterror && errno != ECONNRESET &&
errno != ECONNABORTED && errno != ENETRESET)
{
http->error = errno;
lasterror = errno;
continue;
}
@@ -897,12 +875,7 @@ httpGets(char *line, /* I - Line to read into */
return (NULL);
}
else if (bytes == 0)
{
if (http->blocking)
http->error = EPIPE;
return (NULL);
}
/*
* Yup, update the amount used and the end pointer...
@@ -1185,7 +1158,7 @@ httpUpdate(http_t *http) /* I - HTTP data */
* See if there was an error...
*/
if (http->error)
if (errno)
return (HTTP_ERROR);
/*
-2
Ver Arquivo
@@ -221,7 +221,6 @@ typedef struct
{
int fd; /* File descriptor for this socket */
int blocking; /* To block or not to block */
int error; /* Last error on read */
time_t activity; /* Time since last read/write */
http_state_t state; /* State of client */
http_status_t status; /* Status of last request */
@@ -252,7 +251,6 @@ extern int httpCheck(http_t *http);
extern void httpClose(http_t *http);
extern http_t *httpConnect(const char *host, int port);
extern int httpDelete(http_t *http, const char *uri);
# define httpError(http) ((http)->error)
extern void httpFlush(http_t *http);
extern int httpGet(http_t *http, const char *uri);
extern char *httpGets(char *line, int length, http_t *http);
+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 */
+10 -8
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 */
@@ -89,7 +89,9 @@ ImageReadTIFF(image_t *img, /* IO - Image */
* Open the TIFF file and get the required parameters...
*/
lseek(fileno(fp), 0, SEEK_SET); /* Work around "feature" in some stdio's */
#ifdef __hpux
lseek(fileno(fp), 0, SEEK_SET); /* Work around "feature" in HP-UX stdio */
#endif /* __hpux */
if ((tif = TIFFFdOpen(fileno(fp), "", "r")) == NULL)
{
+115 -131
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 */
@@ -178,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);
}
@@ -229,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
@@ -286,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 */
}
@@ -299,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;
}
@@ -319,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)
@@ -386,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)
@@ -439,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)
@@ -513,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)
@@ -573,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);
@@ -624,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;
@@ -646,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))
@@ -657,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);
}
@@ -688,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;
@@ -708,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;
}
}
@@ -723,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;
+5 -6
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)
@@ -1455,8 +1454,8 @@ pipe_command(client_t *con, /* I - Client connection */
* Child comes here... Close stdin if necessary and dup the pipe to stdout.
*/
setgid(Group);
setuid(User);
setgid(Group);
if (infile)
{
+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 */
+14 -38
Ver Arquivo
@@ -427,8 +427,7 @@ add_class(client_t *con, /* I - Client connection */
* Class doesn't exist; see if we have a printer of the same name...
*/
if ((pclass = FindPrinter(resource + 9)) != NULL &&
!(pclass->type & CUPS_PRINTER_REMOTE))
if (FindPrinter(resource + 9) != NULL)
{
/*
* Yes, return an error...
@@ -437,25 +436,14 @@ add_class(client_t *con, /* I - Client connection */
send_ipp_error(con, IPP_NOT_POSSIBLE);
return;
}
/*
* If we found a printer but didn't error out, then rename the printer to
* printer@host...
*/
if (pclass != NULL)
else
{
strcat(pclass->name, "@");
strcat(pclass->name, pclass->hostname);
SetPrinterAttrs(pclass);
SortPrinters();
/*
* No, add the pclass...
*/
pclass = AddClass(resource + 9);
}
/*
* No, add the pclass...
*/
pclass = AddClass(resource + 9);
}
else if (pclass->type & CUPS_PRINTER_REMOTE)
{
@@ -638,8 +626,7 @@ add_printer(client_t *con, /* I - Client connection */
* Printer doesn't exist; see if we have a class of the same name...
*/
if ((printer = FindClass(resource + 10)) != NULL &&
!(printer->type & CUPS_PRINTER_REMOTE))
if (FindClass(resource + 10) != NULL)
{
/*
* Yes, return an error...
@@ -648,25 +635,14 @@ add_printer(client_t *con, /* I - Client connection */
send_ipp_error(con, IPP_NOT_POSSIBLE);
return;
}
/*
* If we found a class but didn't error out, then rename the class to
* class@host...
*/
if (printer != NULL)
else
{
strcat(printer->name, "@");
strcat(printer->name, printer->hostname);
SetPrinterAttrs(printer);
SortPrinters();
/*
* No, add the printer...
*/
printer = AddPrinter(resource + 10);
}
/*
* No, add the printer...
*/
printer = AddPrinter(resource + 10);
}
else if (printer->type & CUPS_PRINTER_REMOTE)
{
+5 -7
Ver Arquivo
@@ -640,8 +640,7 @@ StartJob(int id, /* I - Job ID */
{
current->procs[i] = pid;
LogMessage(LOG_DEBUG, "Started %s (PID %d) for job %d.", command, pid,
current->id);
DEBUG_printf(("StartJob: started %s - pid = %d.\n", command, pid));
}
}
@@ -689,8 +688,7 @@ StartJob(int id, /* I - Job ID */
{
current->procs[i] = pid;
LogMessage(LOG_DEBUG, "Started %s (PID %d) for job %d.", command, pid,
current->id);
DEBUG_printf(("StartJob: started %s - pid = %d.\n", command, pid));
}
}
else
@@ -801,7 +799,7 @@ UpdateJob(job_t *job) /* I - Job to check */
loglevel = LOG_WARN;
message = buffer + 8;
}
else if (strncmp(buffer, "INFO:", 5) == 0)
if (strncmp(buffer, "INFO:", 5) == 0)
{
loglevel = LOG_INFO;
message = buffer + 5;
@@ -851,7 +849,7 @@ UpdateJob(job_t *job) /* I - Job to check */
LogMessage(loglevel, "%s", message);
if ((loglevel >= LOG_INFO && !job->state) ||
loglevel < LOG_INFO)
loglevel == LOG_ERROR)
strncpy(job->printer->state_message, message,
sizeof(job->printer->state_message) - 1);
}
@@ -938,8 +936,8 @@ start_process(char *command, /* I - Full path to command */
* Change user to something "safe"...
*/
setgid(Group);
setuid(User);
setgid(Group);
/*
* Execute the command; if for some reason this doesn't work,
-3
Ver Arquivo
@@ -355,9 +355,6 @@ sigchld_handler(int sig) /* I - Signal number */
{
DEBUG_printf(("sigcld_handler: pid = %d, status = %d\n", pid, status));
if (status)
LogMessage(LOG_ERROR, "PID %d crashed with status %d!", pid, status);
for (job = Jobs; job != NULL; job = job->next)
if (job->state == IPP_JOB_PROCESSING)
{