Load cups into easysw/current.

git-svn-id: svn+ssh://src.apple.com/svn/cups/easysw/current@103 a1ca3aef-8c08-0410-bb20-df032aa958be
Esse commit está contido em:
jlovell
2006-03-27 23:11:24 +00:00
commit 80ca45929e
53 arquivos alterados com 4104 adições e 5040 exclusões
+25 -2
Ver Arquivo
@@ -1,9 +1,32 @@
CHANGES.txt - 2006-03-20
CHANGES.txt - 2006-03-24
------------------------
CHANGES IN CUPS V1.2rc1
- Documentation updates (STR #1497)
- Documentation updates (STR #1497, STR #1498)
- The scheduler now redirects browsers to https: URLs
when encryption is required.
- The scheduler would crash when printing with a banner
(STR #1500)
- cups-driverd did not use the LanguageEncoding attribute
in PPD files to convert the NickName to UTF-8 (STR
#1503)
- The lpadmin command could not set the
printer-error-policy attribute (STR #1504)
- The web interface did not show the time and date in the
correct format for the locale (STR #1505)
- CUPS no longer accepts print jobs if a printer does not
support the file format (STR #1501)
- Cleaned up the PostScript filter (pstops) so that it
properly supports %%IncludeFeature and page scaling
(STR #1453)
- Fixed the cupsFileRewind() and cupsFileSeek() functions
to work properly with uncompressed files.
- Added cupsFileGetLine(), cupsFileStderr(),
cupsFileStdin(), and cupsFileStdout() functions to the
CUPS library.
- Added a new cupstestdsc program to test the DSC
conformance of PostScript files.
- Added KDE/GNOME icons and a Manage Printers menu item.
- Added --enable-image and --enable-pdftops configure
options to control whether the image and PDF filters
+2 -2
Ver Arquivo
@@ -1,5 +1,5 @@
INSTALL - CUPS v1.2b2 - 2006-03-09
----------------------------------
INSTALL - CUPS v1.2rc1 - 2006-03-24
-----------------------------------
This file describes how to compile and install CUPS from source
code. For more information on CUPS see the file called
+4 -3
Ver Arquivo
@@ -1,5 +1,5 @@
#
# "$Id: Makedefs.in 5314 2006-03-20 19:06:50Z mike $"
# "$Id: Makedefs.in 5341 2006-03-24 19:51:21Z mike $"
#
# Common makefile definitions for the Common UNIX Printing System (CUPS).
#
@@ -129,7 +129,8 @@ DSOFLAGS = @DSOFLAGS@
DSOLIBS = @DSOLIBS@ $(COMMONLIBS)
IMGLIBS = @IMGLIBS@ -lm
IMGFILTERS = @IMGFILTERS@
LDFLAGS = -L../cups -L../filter $(RC_CFLAGS) @LDFLAGS@ $(OPTIM)
LDFLAGS = -L../cups -L../filter $(RC_CFLAGS) $(ARCHFLAGS) \
@LDFLAGS@ $(OPTIM)
LINKCUPS = @LINKCUPS@ $(SSLLIBS)
LINKCUPSIMAGE = @LINKCUPSIMAGE@
LIBS = $(LINKCUPS) $(COMMONLIBS)
@@ -259,5 +260,5 @@ DBUSDIR = @DBUSDIR@
#
# End of "$Id: Makedefs.in 5314 2006-03-20 19:06:50Z mike $"
# End of "$Id: Makedefs.in 5341 2006-03-24 19:51:21Z mike $"
#
+6 -4
Ver Arquivo
@@ -1,5 +1,5 @@
README - CUPS v1.2b2 - 2006-03-09
---------------------------------
README - CUPS v1.2rc1 - 2006-03-24
----------------------------------
Looking for compile instructions? Read the file "INSTALL.txt"
instead...
@@ -26,8 +26,8 @@ INTRODUCTION
of GPL Ghostscript for CUPS called ESP Ghostscript is
available separately to support printing of PostScript files
within the CUPS driver framework. Sample drivers for Dymo,
EPSON, HP, and OKIDATA printers are included that use these
filters.
EPSON, HP, OKIDATA, and Zebra printers are included that use
these filters.
Drivers for thousands of printers are provided with our ESP
Print Pro software, available at:
@@ -108,9 +108,11 @@ SETTING UP PRINTER QUEUES FROM THE COMMAND-LINE
EPSON 9-pin Series epson9.ppd
EPSON 24-pin Series epson24.ppd
HP DeskJet Series deskjet.ppd
HP New DeskJet Series deskjet2.ppd
HP LaserJet Series laserjet.ppd
OKIDATA 9-Pin Series okidata9.ppd
OKIDATA 24-Pin Series okidat24.ppd
Zebra CPCL Label Printer zebracpl.ppd
Zebra EPL1 Label Printer zebraep1.ppd
Zebra EPL2 Label Printer zebraep2.ppd
Zebra ZPL Label Printer zebra.ppd
+8 -2
Ver Arquivo
@@ -1,5 +1,5 @@
/*
* "$Id: var.c 4869 2005-12-06 02:43:40Z mike $"
* "$Id: var.c 5331 2006-03-23 21:21:19Z mike $"
*
* CGI form variable and array functions.
*
@@ -239,6 +239,12 @@ cgiInitialize(void)
cupsSetPasswordCB(cgi_passwd);
/*
* Set the locale so that times, etc. are formatted properly...
*/
setlocale(LC_ALL, "");
#ifdef DEBUG
/*
* Disable output buffering to find bugs...
@@ -1020,5 +1026,5 @@ cgi_unlink_file(void)
/*
* End of "$Id: var.c 4869 2005-12-06 02:43:40Z mike $".
* End of "$Id: var.c 5331 2006-03-23 21:21:19Z mike $".
*/
+9 -6
Ver Arquivo
@@ -17,8 +17,9 @@ dir.o: dir.h string.h ../config.h debug.h
emit.o: ppd.h array.h file.h string.h ../config.h
encode.o: cups.h ipp.h http.h md5.h ppd.h array.h file.h language.h
encode.o: ipp-private.h string.h ../config.h debug.h
file.o: http-private.h ../config.h http.h md5.h ipp-private.h ipp.h string.h
file.o: ../cups/debug.h file.h
file.o: http-private.h ../config.h http.h md5.h ipp-private.h ipp.h globals.h
file.o: string.h cups.h ppd.h array.h file.h language.h i18n.h transcode.h
file.o: debug.h
getputfile.o: cups.h ipp.h http.h md5.h ppd.h array.h file.h language.h
getputfile.o: string.h ../config.h debug.h
globals.o: http-private.h ../config.h http.h md5.h ipp-private.h ipp.h
@@ -98,8 +99,9 @@ dir.32.o: dir.c dir.h string.h ../config.h debug.h
emit.32.o: emit.c ppd.h array.h file.h string.h ../config.h
encode.32.o: encode.c cups.h ipp.h http.h md5.h ppd.h array.h file.h language.h
encode.32.o: encode.c ipp-private.h string.h ../config.h debug.h
file.32.o: file.c http-private.h ../config.h http.h md5.h ipp-private.h ipp.h string.h
file.32.o: file.c ../cups/debug.h file.h
file.32.o: file.c http-private.h ../config.h http.h md5.h ipp-private.h ipp.h globals.h
file.32.o: file.c string.h cups.h ppd.h array.h file.h language.h i18n.h transcode.h
file.32.o: file.c debug.h
getputfile.32.o: getputfile.c cups.h ipp.h http.h md5.h ppd.h array.h file.h language.h
getputfile.32.o: getputfile.c string.h ../config.h debug.h
globals.32.o: globals.c http-private.h ../config.h http.h md5.h ipp-private.h ipp.h
@@ -179,8 +181,9 @@ dir.64.o: dir.c dir.h string.h ../config.h debug.h
emit.64.o: emit.c ppd.h array.h file.h string.h ../config.h
encode.64.o: encode.c cups.h ipp.h http.h md5.h ppd.h array.h file.h language.h
encode.64.o: encode.c ipp-private.h string.h ../config.h debug.h
file.64.o: file.c http-private.h ../config.h http.h md5.h ipp-private.h ipp.h string.h
file.64.o: file.c ../cups/debug.h file.h
file.64.o: file.c http-private.h ../config.h http.h md5.h ipp-private.h ipp.h globals.h
file.64.o: file.c string.h cups.h ppd.h array.h file.h language.h i18n.h transcode.h
file.64.o: file.c debug.h
getputfile.64.o: getputfile.c cups.h ipp.h http.h md5.h ppd.h array.h file.h language.h
getputfile.64.o: getputfile.c string.h ../config.h debug.h
globals.64.o: globals.c http-private.h ../config.h http.h md5.h ipp-private.h ipp.h
+4 -2
Ver Arquivo
@@ -1,5 +1,5 @@
/*
* "$Id: encode.c 5230 2006-03-05 17:01:51Z mike $"
* "$Id: encode.c 5332 2006-03-23 21:29:42Z mike $"
*
* Option encoding routines for the Common UNIX Printing System (CUPS).
*
@@ -114,11 +114,13 @@ static const _ipp_option_t ipp_options[] =
{ "ppi-default", IPP_TAG_INTEGER, IPP_TAG_PRINTER },
{ "prettyprint", IPP_TAG_BOOLEAN, IPP_TAG_JOB },
{ "prettyprint-default", IPP_TAG_BOOLEAN, IPP_TAG_PRINTER },
{ "printer-error-policy", IPP_TAG_NAME, IPP_TAG_PRINTER },
{ "printer-info", IPP_TAG_TEXT, IPP_TAG_PRINTER },
{ "printer-is-accepting-jobs",IPP_TAG_BOOLEAN, IPP_TAG_PRINTER },
{ "printer-is-shared", IPP_TAG_BOOLEAN, IPP_TAG_PRINTER },
{ "printer-make-and-model", IPP_TAG_TEXT, IPP_TAG_PRINTER },
{ "printer-more-info", IPP_TAG_URI, IPP_TAG_PRINTER },
{ "printer-op-policy", IPP_TAG_NAME, IPP_TAG_PRINTER },
{ "printer-resolution", IPP_TAG_RESOLUTION, IPP_TAG_JOB },
{ "printer-state", IPP_TAG_ENUM, IPP_TAG_PRINTER },
{ "printer-state-change-time",IPP_TAG_INTEGER, IPP_TAG_PRINTER },
@@ -552,5 +554,5 @@ compare_ipp_options(_ipp_option_t *a, /* I - First option */
/*
* End of "$Id: encode.c 5230 2006-03-05 17:01:51Z mike $".
* End of "$Id: encode.c 5332 2006-03-23 21:29:42Z mike $".
*/
+275 -19
Ver Arquivo
@@ -1,5 +1,5 @@
/*
* "$Id: file.c 5186 2006-02-26 18:56:05Z mike $"
* "$Id: file.c 5324 2006-03-23 16:47:46Z mike $"
*
* File functions for the Common UNIX Printing System (CUPS).
*
@@ -35,9 +35,12 @@
* cupsFileFlush() - Flush pending output.
* cupsFileGetChar() - Get a single character from a file.
* cupsFileGetConf() - Get a line from a configuration file...
* cupsFileGetLine() - Get a CR and/or LF-terminated line that may
* contain binary data.
* cupsFileGets() - Get a CR and/or LF-terminated line.
* cupsFileLock() - Temporarily lock access to a file.
* cupsFileNumber() - Return the file descriptor associated with a CUPS file.
* cupsFileNumber() - Return the file descriptor associated with a CUPS
* file.
* cupsFileOpen() - Open a CUPS file.
* cupsFileOpenFd() - Open a CUPS file using a file descriptor.
* cupsFilePeekChar() - Peek at the next character from a file.
@@ -47,6 +50,9 @@
* cupsFileRead() - Read from a file.
* cupsFileRewind() - Rewind a file.
* cupsFileSeek() - Seek in a file.
* cupsFileStderr() - Return a CUPS file associated with stderr.
* cupsFileStdin() - Return a CUPS file associated with stdin.
* cupsFileStdout() - Return a CUPS file associated with stdout.
* cupsFileTell() - Return the current file position.
* cupsFileUnlock() - Unlock access to a file.
* cupsFileWrite() - Write to a file.
@@ -63,14 +69,13 @@
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include "http-private.h"
#include "string.h"
#include <errno.h>
#include <cups/debug.h>
#include <sys/types.h>
#include <fcntl.h>
#include "http-private.h"
#include "globals.h"
#include "debug.h"
#include "file.h"
#ifdef HAVE_LIBZ
# include <zlib.h>
#endif /* HAVE_LIBZ */
@@ -99,6 +104,7 @@ struct _cups_file_s /**** CUPS file structure... ****/
int fd; /* File descriptor */
char mode, /* Mode ('r' or 'w') */
compressed, /* Compression used? */
is_stdio, /* stdin/out/err? */
eof, /* End of file? */
buf[4096], /* Buffer */
*ptr, /* Pointer into buffer */
@@ -135,6 +141,7 @@ cupsFileClose(cups_file_t *fp) /* I - CUPS file */
int fd; /* File descriptor */
char mode; /* Open mode */
int status; /* Return status */
int is_stdio; /* Is a stdio file? */
DEBUG_printf(("cupsFileClose(fp=%p)\n", fp));
@@ -226,8 +233,9 @@ cupsFileClose(cups_file_t *fp) /* I - CUPS file */
* Save the file descriptor we used and free memory...
*/
fd = fp->fd;
mode = fp->mode;
fd = fp->fd;
mode = fp->mode;
is_stdio = fp->is_stdio;
free(fp);
@@ -240,7 +248,7 @@ cupsFileClose(cups_file_t *fp) /* I - CUPS file */
if (closesocket(fd) < 0)
status = -1;
}
else
else if (!is_stdio)
{
if (close(fd) < 0)
status = -1;
@@ -257,7 +265,7 @@ cupsFileClose(cups_file_t *fp) /* I - CUPS file */
int /* O - CUPS_FILE_NONE or CUPS_FILE_GZIP */
cupsFileCompression(cups_file_t *fp) /* I - CUPS file */
{
return (fp->compressed);
return (fp ? fp->compressed : CUPS_FILE_NONE);
}
@@ -268,7 +276,7 @@ cupsFileCompression(cups_file_t *fp) /* I - CUPS file */
int /* O - 1 on EOF, 0 otherwise */
cupsFileEOF(cups_file_t *fp) /* I - CUPS file */
{
return (fp->eof);
return (fp ? fp->eof : 1);
}
@@ -560,6 +568,76 @@ cupsFileGetConf(cups_file_t *fp, /* I - CUPS file */
}
/*
* 'cupsFileGetLine()' - Get a CR and/or LF-terminated line that may
* contain binary data.
*
* This function differs from cupsFileGets() in that the trailing CR and LF
* are preserved, as is any binary data on the line. The buffer is nul-
* terminated, however you should use the returned length to determine
* the number of bytes on the line.
*/
size_t /* O - Number of bytes on line or 0 on EOF */
cupsFileGetLine(cups_file_t *fp, /* I - File to read from */
char *buf, /* I - Buffer */
size_t buflen) /* I - Size of buffer */
{
int ch; /* Character from file */
char *ptr, /* Current position in line buffer */
*end; /* End of line buffer */
/*
* Range check input...
*/
if (!fp || (fp->mode != 'r' && fp->mode != 's') || !buf || buflen < 3)
return (0);
/*
* Now loop until we have a valid line...
*/
for (ptr = buf, end = buf + buflen - 2; ptr < end ;)
{
if (fp->ptr >= fp->end)
if (cups_fill(fp) <= 0)
break;
*ptr++ = ch = *(fp->ptr)++;
if (ch == '\r')
{
/*
* Check for CR LF...
*/
if (fp->ptr >= fp->end)
if (cups_fill(fp) <= 0)
break;
if (*(fp->ptr) == '\n')
*ptr++ = *(fp->ptr)++;
break;
}
else if (ch == '\n')
{
/*
* Line feed ends a line...
*/
break;
}
}
*ptr = '\0';
return (ptr - buf);
}
/*
* 'cupsFileGets()' - Get a CR and/or LF-terminated line.
*/
@@ -1139,7 +1217,51 @@ cupsFileRead(cups_file_t *fp, /* I - CUPS file */
off_t /* O - New file position or -1 */
cupsFileRewind(cups_file_t *fp) /* I - CUPS file */
{
return (cupsFileSeek(fp, 0L));
/*
* Range check input...
*/
if (!fp || fp->mode != 'r')
return (-1);
/*
* Handle special cases...
*/
if (fp->pos == 0)
{
/*
* No seeking necessary...
*/
if (fp->ptr)
{
fp->ptr = fp->buf;
fp->eof = 0;
}
return (0);
}
/*
* Otherwise, seek in the file and cleanup any compression buffers...
*/
#ifdef HAVE_LIBZ
if (fp->compressed)
{
inflateEnd(&fp->stream);
fp->compressed = 0;
}
#endif /* HAVE_LIBZ */
lseek(fp->fd, 0, SEEK_SET);
fp->pos = 0;
fp->ptr = NULL;
fp->end = NULL;
return (0);
}
@@ -1165,6 +1287,13 @@ cupsFileSeek(cups_file_t *fp, /* I - CUPS file */
if (!fp || pos < 0 || fp->mode != 'r')
return (-1);
/*
* Handle special cases...
*/
if (pos == 0)
return (cupsFileRewind(fp));
if (fp->pos == pos)
{
/*
@@ -1180,20 +1309,40 @@ cupsFileSeek(cups_file_t *fp, /* I - CUPS file */
return (pos);
}
#ifdef HAVE_LIBZ
if (!fp->compressed && !fp->ptr)
{
/*
* Preload a buffer to determine whether the file is compressed...
*/
if (cups_fill(fp) < 0)
return (-1);
}
#endif /* HAVE_LIBZ */
/*
* Figure out the number of bytes in the current buffer, and then
* see if we are outside of it...
*/
bytes = fp->end - fp->buf;
if (fp->ptr)
bytes = fp->end - fp->buf;
else
bytes = 0;
fp->eof = 0;
DEBUG_printf((" bytes=" CUPS_LLFMT "\n", CUPS_LLCAST bytes));
if (pos < fp->pos)
{
/*
* Need to seek backwards...
*/
DEBUG_puts(" SEEK BACKWARDS");
#ifdef HAVE_LIBZ
if (fp->compressed)
{
@@ -1210,14 +1359,17 @@ cupsFileSeek(cups_file_t *fp, /* I - CUPS file */
if (bytes <= 0)
return (-1);
fp->ptr = fp->buf + pos - fp->pos;
}
else
#endif /* HAVE_LIBZ */
{
fp->pos = lseek(fp->fd, pos, SEEK_SET);
DEBUG_printf((" lseek() returned %ld...\n", (long)fp->pos));
fp->ptr = NULL;
fp->end = NULL;
DEBUG_printf((" lseek() returned %ld...\n", (long)fp->pos));
}
}
else if (pos >= (fp->pos + bytes))
@@ -1226,23 +1378,30 @@ cupsFileSeek(cups_file_t *fp, /* I - CUPS file */
* Need to seek forwards...
*/
DEBUG_puts(" SEEK FORWARDS");
#ifdef HAVE_LIBZ
if (fp->compressed || !fp->ptr)
if (fp->compressed)
{
while ((bytes = cups_fill(fp)) > 0)
{
if (pos >= fp->pos && pos < (fp->pos + bytes))
break;
}
if (bytes <= 0)
return (-1);
fp->ptr = fp->buf + pos - fp->pos;
}
else
#endif /* HAVE_LIBZ */
{
fp->pos = lseek(fp->fd, pos, SEEK_SET);
DEBUG_printf((" lseek() returned " CUPS_LLFMT "...\n", fp->pos));
fp->ptr = NULL;
fp->end = NULL;
DEBUG_printf((" lseek() returned " CUPS_LLFMT "...\n", fp->pos));
}
}
else
@@ -1252,14 +1411,111 @@ cupsFileSeek(cups_file_t *fp, /* I - CUPS file */
* range...
*/
DEBUG_puts(" SEEK INSIDE BUFFER");
fp->ptr = fp->buf + pos - fp->pos;
DEBUG_puts((" seek inside buffer..."));
}
return (fp->pos);
}
/*
* 'cupsFileStderr()' - Return a CUPS file associated with stderr.
*/
cups_file_t *
cupsFileStderr(void)
{
_cups_globals_t *cg = _cupsGlobals(); /* Pointer to library globals... */
/*
* Open file descriptor 2 as needed...
*/
if (!cg->stdio_files[2])
{
/*
* Flush any pending output on the stdio file...
*/
fflush(stderr);
/*
* Open file descriptor 2...
*/
if ((cg->stdio_files[2] = cupsFileOpenFd(2, "w")) != NULL)
cg->stdio_files[2]->is_stdio = 1;
}
return (cg->stdio_files[2]);
}
/*
* 'cupsFileStdin()' - Return a CUPS file associated with stdin.
*/
cups_file_t *
cupsFileStdin(void)
{
_cups_globals_t *cg = _cupsGlobals(); /* Pointer to library globals... */
/*
* Open file descriptor 0 as needed...
*/
if (!cg->stdio_files[0])
{
/*
* Open file descriptor 0...
*/
if ((cg->stdio_files[0] = cupsFileOpenFd(0, "r")) != NULL)
cg->stdio_files[0]->is_stdio = 1;
}
return (cg->stdio_files[0]);
}
/*
* 'cupsFileStdout()' - Return a CUPS file associated with stdout.
*/
cups_file_t *
cupsFileStdout(void)
{
_cups_globals_t *cg = _cupsGlobals(); /* Pointer to library globals... */
/*
* Open file descriptor 1 as needed...
*/
if (!cg->stdio_files[1])
{
/*
* Flush any pending output on the stdio file...
*/
fflush(stdout);
/*
* Open file descriptor 1...
*/
if ((cg->stdio_files[1] = cupsFileOpenFd(1, "w")) != NULL)
cg->stdio_files[1]->is_stdio = 1;
}
return (cg->stdio_files[1]);
}
/*
* 'cupsFileTell()' - Return the current file position.
*/
@@ -1267,7 +1523,7 @@ cupsFileSeek(cups_file_t *fp, /* I - CUPS file */
off_t /* O - File position */
cupsFileTell(cups_file_t *fp) /* I - CUPS file */
{
return (fp->pos);
return (fp ? fp->pos : 0);
}
@@ -1824,5 +2080,5 @@ cups_write(cups_file_t *fp, /* I - CUPS file */
/*
* End of "$Id: file.c 5186 2006-02-26 18:56:05Z mike $".
* End of "$Id: file.c 5324 2006-03-23 16:47:46Z mike $".
*/
+7 -2
Ver Arquivo
@@ -1,5 +1,5 @@
/*
* "$Id: file.h 5057 2006-02-02 20:38:29Z mike $"
* "$Id: file.h 5319 2006-03-21 15:28:29Z mike $"
*
* Public file definitions for the Common UNIX Printing System (CUPS).
*
@@ -81,6 +81,8 @@ extern int cupsFileFlush(cups_file_t *fp);
extern int cupsFileGetChar(cups_file_t *fp);
extern char *cupsFileGetConf(cups_file_t *fp, char *buf, size_t buflen,
char **value, int *linenum);
extern size_t cupsFileGetLine(cups_file_t *fp, char *buf,
size_t buflen);
extern char *cupsFileGets(cups_file_t *fp, char *buf, size_t buflen);
extern int cupsFileLock(cups_file_t *fp, int block);
extern int cupsFileNumber(cups_file_t *fp);
@@ -93,6 +95,9 @@ extern int cupsFilePuts(cups_file_t *fp, const char *s);
extern ssize_t cupsFileRead(cups_file_t *fp, char *buf, size_t bytes);
extern off_t cupsFileRewind(cups_file_t *fp);
extern off_t cupsFileSeek(cups_file_t *fp, off_t pos);
extern cups_file_t *cupsFileStderr(void);
extern cups_file_t *cupsFileStdin(void);
extern cups_file_t *cupsFileStdout(void);
extern off_t cupsFileTell(cups_file_t *fp);
extern int cupsFileUnlock(cups_file_t *fp);
extern ssize_t cupsFileWrite(cups_file_t *fp, const char *buf, size_t bytes);
@@ -104,5 +109,5 @@ extern ssize_t cupsFileWrite(cups_file_t *fp, const char *buf, size_t bytes);
#endif /* !_CUPS_FILE_H_ */
/*
* End of "$Id: file.h 5057 2006-02-02 20:38:29Z mike $".
* End of "$Id: file.h 5319 2006-03-21 15:28:29Z mike $".
*/
+7 -4
Ver Arquivo
@@ -1,5 +1,5 @@
/*
* "$Id: globals.c 5294 2006-03-15 21:09:32Z mike $"
* "$Id: globals.c 5319 2006-03-21 15:28:29Z mike $"
*
* Global variable access routines for the Common UNIX Printing System (CUPS).
*
@@ -152,13 +152,16 @@ globals_init()
static void
globals_destructor(void *value) /* I - Data to free */
{
int i; /* Looping var */
_cups_globals_t *cg; /* Global data */
cg = (_cups_globals_t *)value;
if (cg->http)
httpClose(cg->http);
httpClose(cg->http);
for (i = 0; i < 3; i ++)
cupsFileClose(cg->stdio_files[i]);
_cupsStrFlush(cg);
_cupsLangFlush(cg);
@@ -212,5 +215,5 @@ _cupsGlobals(void)
/*
* End of "$Id: globals.c 5294 2006-03-15 21:09:32Z mike $".
* End of "$Id: globals.c 5319 2006-03-21 15:28:29Z mike $".
*/
+5 -2
Ver Arquivo
@@ -1,5 +1,5 @@
/*
* "$Id: globals.h 5294 2006-03-15 21:09:32Z mike $"
* "$Id: globals.h 5319 2006-03-21 15:28:29Z mike $"
*
* Global variable definitions for the Common UNIX Printing System (CUPS).
*
@@ -72,6 +72,9 @@ typedef struct _cups_globals_s /**** CUPS global state data ****/
/* Number of server settings */
cups_option_t *cupsd_settings;/* Server settings */
/* file.c */
cups_file_t *stdio_files[3];/* stdin, stdout, stderr */
/* http.c */
char http_date[256]; /* Date+time buffer */
@@ -159,5 +162,5 @@ extern void _cupsStrFlush(_cups_globals_t *cg);
#endif /* !_CUPS_GLOBALS_H_ */
/*
* End of "$Id: globals.h 5294 2006-03-15 21:09:32Z mike $".
* End of "$Id: globals.h 5319 2006-03-21 15:28:29Z mike $".
*/
+27 -4
Ver Arquivo
@@ -1,5 +1,5 @@
/*
* "$Id: ipp.c 5231 2006-03-05 17:22:27Z mike $"
* "$Id: ipp.c 5329 2006-03-23 20:37:36Z mike $"
*
* Internet Printing Protocol support functions for the Common UNIX
* Printing System (CUPS).
@@ -2404,8 +2404,8 @@ ippWriteIO(void *dst, /* I - Destination */
*/
ipp_attribute_t * /* O - New attribute */
_ippAddAttr(ipp_t *ipp, /* I - IPP message */
int num_values) /* I - Number of values */
_ippAddAttr(ipp_t *ipp, /* I - IPP message */
int num_values) /* I - Number of values */
{
ipp_attribute_t *attr; /* New attribute */
@@ -2797,6 +2797,29 @@ ipp_write_file(int *fd, /* I - File descriptor */
}
#ifdef __linux
/*
* End of "$Id: ipp.c 5231 2006-03-05 17:22:27Z mike $".
* The following symbol definitions are provided only for KDE
* compatibility during the CUPS 1.2 testing period and will be
* removed in a future release of CUPS. These are PRIVATE APIs
* from CUPS 1.1.x that the KDE developers chose to use...
*/
ipp_attribute_t * /* O - New attribute */
_ipp_add(ipp_t *ipp, /* I - IPP message */
int num_values) /* I - Number of values */
{
return (_ippAddAttr(ipp, num_values));
}
void
_ipp_free(ipp_attribute_t *attr) /* I - Attribute to free */
{
_ippFreeAttr(attr);
}
#endif /* __linux */
/*
* End of "$Id: ipp.c 5329 2006-03-23 20:37:36Z mike $".
*/
+1
Ver Arquivo
@@ -28,3 +28,4 @@ _cups_strlcat
_cups_strlcpy
_ippAddAttr
_ippFreeAttr
_ppdGetEncoding
+30 -31
Ver Arquivo
@@ -1,5 +1,5 @@
/*
* "$Id: ppd.c 5302 2006-03-18 00:49:17Z mike $"
* "$Id: ppd.c 5333 2006-03-24 00:52:21Z mike $"
*
* PPD file routines for the Common UNIX Printing System (CUPS).
*
@@ -36,6 +36,8 @@
*
* ppdClose() - Free all memory used by the PPD file.
* ppdErrorString() - Returns the text assocated with a status.
* _ppdGetEncoding() - Get the CUPS encoding value for the given
* LanguageEncoding.
* ppdLastError() - Return the status from the last ppdOpen*().
* ppdOpen() - Read a PPD file into memory.
* ppdOpen2() - Read a PPD file into memory.
@@ -54,8 +56,6 @@
* ppd_free_option() - Free a single option.
* ppd_get_coption() - Get a custom option record.
* ppd_get_cparam() - Get a custom parameter record.
* ppd_get_encoding() - Get the CUPS encoding value for the given
* LanguageEncoding.
* ppd_get_group() - Find or create the named group as needed.
* ppd_get_option() - Find or create the named option as needed.
* ppd_read() - Read a line from a PPD file, skipping comment
@@ -112,7 +112,6 @@ static ppd_coption_t *ppd_get_coption(ppd_file_t *ppd, const char *name);
static ppd_cparam_t *ppd_get_cparam(ppd_coption_t *opt,
const char *param,
const char *text);
static cups_encoding_t ppd_get_encoding(const char *name);
static ppd_group_t *ppd_get_group(ppd_file_t *ppd, const char *name,
const char *text, _cups_globals_t *cg,
cups_encoding_t encoding);
@@ -336,6 +335,31 @@ ppdErrorString(ppd_status_t status) /* I - PPD status */
}
/*
* '_ppdGetEncoding()' - Get the CUPS encoding value for the given
* LanguageEncoding.
*/
cups_encoding_t /* O - CUPS encoding value */
_ppdGetEncoding(const char *name) /* I - LanguageEncoding string */
{
if (!strcasecmp(name, "ISOLatin1"))
return (CUPS_ISO8859_1);
else if (!strcasecmp(name, "ISOLatin2"))
return (CUPS_ISO8859_2);
else if (!strcasecmp(name, "ISOLatin5"))
return (CUPS_ISO8859_5);
else if (!strcasecmp(name, "JIS83-RKSJ"))
return (CUPS_WINDOWS_932);
else if (!strcasecmp(name, "MacStandard"))
return (CUPS_MAC_ROMAN);
else if (!strcasecmp(name, "WindowsANSI"))
return (CUPS_WINDOWS_1252);
else
return (CUPS_UTF8);
}
/*
* 'ppdLastError()' - Return the status from the last ppdOpen*().
*
@@ -721,7 +745,7 @@ ppdOpen2(cups_file_t *fp) /* I - File to read from */
*/
ppd->lang_encoding = strdup("UTF-8");
encoding = ppd_get_encoding(string);
encoding = _ppdGetEncoding(string);
}
else if (!strcmp(keyword, "LanguageVersion"))
ppd->lang_version = string;
@@ -2254,31 +2278,6 @@ ppd_get_cparam(ppd_coption_t *opt, /* I - PPD file */
}
/*
* 'ppd_get_encoding()' - Get the CUPS encoding value for the given
* LanguageEncoding.
*/
static cups_encoding_t /* O - CUPS encoding value */
ppd_get_encoding(const char *name) /* I - LanguageEncoding string */
{
if (!strcasecmp(name, "ISOLatin1"))
return (CUPS_ISO8859_1);
else if (!strcasecmp(name, "ISOLatin2"))
return (CUPS_ISO8859_2);
else if (!strcasecmp(name, "ISOLatin5"))
return (CUPS_ISO8859_5);
else if (!strcasecmp(name, "JIS83-RKSJ"))
return (CUPS_WINDOWS_932);
else if (!strcasecmp(name, "MacStandard"))
return (CUPS_MAC_ROMAN);
else if (!strcasecmp(name, "WindowsANSI"))
return (CUPS_WINDOWS_1252);
else
return (CUPS_UTF8);
}
/*
* 'ppd_get_group()' - Find or create the named group as needed.
*/
@@ -2939,5 +2938,5 @@ ppd_read(cups_file_t *fp, /* I - File to read from */
/*
* End of "$Id: ppd.c 5302 2006-03-18 00:49:17Z mike $".
* End of "$Id: ppd.c 5333 2006-03-24 00:52:21Z mike $".
*/
+4 -2
Ver Arquivo
@@ -1,5 +1,5 @@
/*
* "$Id: testhttp.c 5261 2006-03-09 20:47:49Z mike $"
* "$Id: testhttp.c 5344 2006-03-26 13:57:00Z mike $"
*
* HTTP test program for the Common UNIX Printing System (CUPS).
*
@@ -94,6 +94,8 @@ static uri_test_t uri_tests[] = /* URI test data */
"mailto", "", "", "user@domain.com", 0, 0 },
{ HTTP_URI_OK, "socket://server/",
"socket", "", "server", "/", 9100, 0 },
{ HTTP_URI_OK, "socket://192.168.1.1:9101/",
"socket", "", "192.168.1.1", "/", 9101, 9101 },
{ HTTP_URI_OK, "ipp://username:password@[v1.fe80::200:1234:5678:9abc+eth0]:999/ipp",
"ipp", "username:password", "fe80::200:1234:5678:9abc%eth0", "/ipp", 999, 999 },
{ HTTP_URI_OK, "http://server/admin?DEVICE_URI=usb://HP/Photosmart%25202600%2520series?serial=MY53OK70V10400",
@@ -515,5 +517,5 @@ main(int argc, /* I - Number of command-line arguments */
/*
* End of "$Id: testhttp.c 5261 2006-03-09 20:47:49Z mike $".
* End of "$Id: testhttp.c 5344 2006-03-26 13:57:00Z mike $".
*/
+28
Ver Arquivo
@@ -0,0 +1,28 @@
%!PS-Adobe-3.0
%%BoundingBox: 36 36 576 756
%%Pages: 1
%%LanguageLevel: 2
%%EndComments
%%Page: (1) 1
% Draw a black box around the page
0 setgray
1 setlinewidth
36 36 540 720 rectstroke
% Draw a two inch blue circle in the middle of the page
0 0 1 setrgbcolor
306 396 144 0 360 arc closepath fill
% Draw two half inch yellow circles for eyes
1 1 0 setrgbcolor
252 432 36 0 360 arc closepath fill
360 432 36 0 360 arc closepath fill
% Draw the smile
1 setlinecap
18 setlinewidth
306 396 99 200 340 arc stroke
% Print it!
showpage
%%EOF
+4 -1
Ver Arquivo
@@ -1,5 +1,5 @@
#
# "$Id: Makefile 5308 2006-03-18 13:18:18Z mike $"
# "$Id: Makefile 5328 2006-03-23 20:23:19Z mike $"
#
# Documentation makefile for the Common UNIX Printing System (CUPS).
#
@@ -98,6 +98,7 @@ WEBIMAGES = \
images/printer-idle.gif \
images/printer-processing.gif \
images/printer-stopped.gif \
images/smiley.jpg \
images/tab-left.gif \
images/tab-right.gif \
images/top-left.gif \
@@ -132,6 +133,7 @@ HELPFILES = \
help/man-cupsd.conf.html \
help/man-cupsd.html \
help/man-cupsenable.html \
help/man-cupstestdsc.html \
help/man-cupstestppd.html \
help/man-filter.html \
help/man-lp.html \
@@ -164,6 +166,7 @@ HELPFILES = \
help/spec-command.html \
help/spec-design.html \
help/spec-ipp.html \
help/spec-postscript.html \
help/spec-ppd.html \
help/spec-raster.html \
help/spec-stp.html \
+19
Ver Arquivo
@@ -94,6 +94,7 @@ library:</p>
<li><a href='#cupsArrayRemove'><tt>cupsArrayRemove()</tt></a> </li>
<li><a href='#cupsArrayRestore'><tt>cupsArrayRestore()</tt></a> </li>
<li><a href='#cupsArraySave'><tt>cupsArraySave()</tt></a> </li>
<li><a href='#cupsArrayUserData'><tt>cupsArrayUserData()</tt></a> </li>
</ul>
<!-- NEW PAGE -->
<h3 class='title'><a name='cupsArrayAdd'>cupsArrayAdd()</a></h3>
@@ -424,6 +425,24 @@ cupsArraySave(
<h4>Returns</h4>
<p>1 on success, 0 on failure</p>
<!-- NEW PAGE -->
<h3 class='title'><a name='cupsArrayUserData'>cupsArrayUserData()</a></h3>
<h4>Description</h4>
<p>Return the user data for an array.</p>
<h4>Syntax</h4>
<pre>
void *
cupsArrayUserData(
<a href='#cups_array_t'>cups_array_t</a> * a);
</pre>
<h4>Arguments</h4>
<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
<thead><tr><th>Name</th><th>Description</th></tr></thead>
<tbody>
<tr><td><tt>a</tt></td><td>Array</td></tr>
</tbody></table></div>
<h4>Returns</h4>
<p>User data</p>
<!-- NEW PAGE -->
<h2 class='title'><a name='TYPES'>Types</a></h2>
<ul>
<li><a href='#cups_array_func_t'><tt>cups_array_func_t</tt></a> </li>
+28 -2
Ver Arquivo
@@ -97,6 +97,7 @@ CUPS 1.1 or higher.</p>
<tr><td><tt>CUPS_PRINTER_CLASS</tt> </td><td>Printer class</td></tr>
<tr><td><tt>CUPS_PRINTER_COLLATE</tt> </td><td>Can collage copies</td></tr>
<tr><td><tt>CUPS_PRINTER_COLOR</tt> </td><td>Can do color printing</td></tr>
<tr><td><tt>CUPS_PRINTER_COMMANDS</tt> <span class='info'>&nbsp;CUPS 1.2&nbsp;</span></td><td>Printer supports maintenance commands </td></tr>
<tr><td><tt>CUPS_PRINTER_COPIES</tt> </td><td>Can do copies</td></tr>
<tr><td><tt>CUPS_PRINTER_COVER</tt> </td><td>Can cover output</td></tr>
<tr><td><tt>CUPS_PRINTER_DEFAULT</tt> </td><td>Default printer on network</td></tr>
@@ -157,6 +158,7 @@ CUPS 1.1 or higher.</p>
<li><a href='#cupsPrintFiles2'><tt>cupsPrintFiles2()</tt></a> <span class='info'>&nbsp;CUPS 1.1.21&nbsp;</span></li>
<li><a href='#cupsPutFd'><tt>cupsPutFd()</tt></a> <span class='info'>&nbsp;CUPS 1.1.20&nbsp;</span></li>
<li><a href='#cupsPutFile'><tt>cupsPutFile()</tt></a> <span class='info'>&nbsp;CUPS 1.1.20&nbsp;</span></li>
<li><a href='#cupsRemoveOption'><tt>cupsRemoveOption()</tt></a> <span class='info'>&nbsp;CUPS 1.2&nbsp;</span></li>
<li><a href='#cupsServer'><tt>cupsServer()</tt></a> </li>
<li><a href='#cupsSetDests'><tt>cupsSetDests()</tt></a> </li>
<li><a href='#cupsSetDests2'><tt>cupsSetDests2()</tt></a> <span class='info'>&nbsp;CUPS 1.1.21&nbsp;</span></li>
@@ -1018,6 +1020,30 @@ cupsPutFile(
<h4>Returns</h4>
<p>HTTP status</p>
<!-- NEW PAGE -->
<h3 class='title'><span class='info'>&nbsp;CUPS 1.2&nbsp;</span><a name='cupsRemoveOption'>cupsRemoveOption()</a></h3>
<h4>Description</h4>
<p>Remove an option from an option array.
</p>
<h4>Syntax</h4>
<pre>
int
cupsRemoveOption(
const char * name,
int num_options,
<a href='#cups_option_t'>cups_option_t</a> ** options);
</pre>
<h4>Arguments</h4>
<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
<thead><tr><th>Name</th><th>Description</th></tr></thead>
<tbody>
<tr><td><tt>name</tt></td><td>Option name</td></tr>
<tr><td><tt>num_options</tt></td><td>Current number of options</td></tr>
<tr><td><tt>options</tt></td><td>Options</td></tr>
</tbody></table></div>
<h4>Returns</h4>
<p>New number of options</p>
<!-- NEW PAGE -->
<h3 class='title'><a name='cupsServer'>cupsServer()</a></h3>
<h4>Description</h4>
<p>Return the hostname/address of the default server.
@@ -1039,7 +1065,7 @@ cupsServer(void);
<p>Save the list of destinations for the default server.
This function saves the destinations to /etc/cups/lpoptions when run
as root and ~/.lpoptions when run as a normal user.</p>
as root and ~/.cups/lpoptions when run as a normal user.</p>
<h4>Syntax</h4>
<pre>
void
@@ -1062,7 +1088,7 @@ cupsSetDests(
<p>Save the list of destinations for the specified server.
This function saves the destinations to /etc/cups/lpoptions when run
as root and ~/.lpoptions when run as a normal user.
as root and ~/.cups/lpoptions when run as a normal user.
</p>
<h4>Syntax</h4>
+72
Ver Arquivo
@@ -101,6 +101,7 @@ library:</p>
<li><a href='#cupsFileFlush'><tt>cupsFileFlush()</tt></a> </li>
<li><a href='#cupsFileGetChar'><tt>cupsFileGetChar()</tt></a> </li>
<li><a href='#cupsFileGetConf'><tt>cupsFileGetConf()</tt></a> </li>
<li><a href='#cupsFileGetLine'><tt>cupsFileGetLine()</tt></a> </li>
<li><a href='#cupsFileGets'><tt>cupsFileGets()</tt></a> </li>
<li><a href='#cupsFileLock'><tt>cupsFileLock()</tt></a> </li>
<li><a href='#cupsFileNumber'><tt>cupsFileNumber()</tt></a> </li>
@@ -113,6 +114,9 @@ library:</p>
<li><a href='#cupsFileRead'><tt>cupsFileRead()</tt></a> </li>
<li><a href='#cupsFileRewind'><tt>cupsFileRewind()</tt></a> </li>
<li><a href='#cupsFileSeek'><tt>cupsFileSeek()</tt></a> </li>
<li><a href='#cupsFileStderr'><tt>cupsFileStderr()</tt></a> </li>
<li><a href='#cupsFileStdin'><tt>cupsFileStdin()</tt></a> </li>
<li><a href='#cupsFileStdout'><tt>cupsFileStdout()</tt></a> </li>
<li><a href='#cupsFileTell'><tt>cupsFileTell()</tt></a> </li>
<li><a href='#cupsFileUnlock'><tt>cupsFileUnlock()</tt></a> </li>
<li><a href='#cupsFileWrite'><tt>cupsFileWrite()</tt></a> </li>
@@ -338,6 +342,34 @@ cupsFileGetConf(
<h4>Returns</h4>
<p>Line read or NULL on eof/error</p>
<!-- NEW PAGE -->
<h3 class='title'><a name='cupsFileGetLine'>cupsFileGetLine()</a></h3>
<h4>Description</h4>
<p>Get a CR and/or LF-terminated line that may
contain binary data.
This function differs from cupsFileGets() in that the trailing CR and LF
are preserved, as is any binary data on the line. The buffer is nul-
terminated, however you should use the returned length to determine
the number of bytes on the line.</p>
<h4>Syntax</h4>
<pre>
size_t
cupsFileGetLine(
<a href='#cups_file_t'>cups_file_t</a> * fp,
char * buf,
size_t buflen);
</pre>
<h4>Arguments</h4>
<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
<thead><tr><th>Name</th><th>Description</th></tr></thead>
<tbody>
<tr><td><tt>fp</tt></td><td>File to read from</td></tr>
<tr><td><tt>buf</tt></td><td>Buffer</td></tr>
<tr><td><tt>buflen</tt></td><td>Size of buffer</td></tr>
</tbody></table></div>
<h4>Returns</h4>
<p>Number of bytes on line or 0 on EOF</p>
<!-- NEW PAGE -->
<h3 class='title'><a name='cupsFileGets'>cupsFileGets()</a></h3>
<h4>Description</h4>
<p>Get a CR and/or LF-terminated line.</p>
@@ -578,6 +610,46 @@ cupsFileSeek(
<h4>Returns</h4>
<p>New file position or -1</p>
<!-- NEW PAGE -->
<h3 class='title'><a name='cupsFileStderr'>cupsFileStderr()</a></h3>
<h4>Description</h4>
<p>Just reposition the current pointer, since we have the right
range...</p>
<h4>Syntax</h4>
<pre>
<a href='#cups_file_t'>cups_file_t</a> *
cupsFileStderr(void);
</pre>
<h4>Arguments</h4>
<p>None.</p>
<h4>Returns</h4>
<p>Return a CUPS file associated with stderr.</p>
<!-- NEW PAGE -->
<h3 class='title'><a name='cupsFileStdin'>cupsFileStdin()</a></h3>
<h4>Description</h4>
<p>Open file descriptor 2...</p>
<h4>Syntax</h4>
<pre>
<a href='#cups_file_t'>cups_file_t</a> *
cupsFileStdin(void);
</pre>
<h4>Arguments</h4>
<p>None.</p>
<h4>Returns</h4>
<p>Return a CUPS file associated with stdin.</p>
<!-- NEW PAGE -->
<h3 class='title'><a name='cupsFileStdout'>cupsFileStdout()</a></h3>
<h4>Description</h4>
<p>Open file descriptor 0...</p>
<h4>Syntax</h4>
<pre>
<a href='#cups_file_t'>cups_file_t</a> *
cupsFileStdout(void);
</pre>
<h4>Arguments</h4>
<p>None.</p>
<h4>Returns</h4>
<p>Return a CUPS file associated with stdout.</p>
<!-- NEW PAGE -->
<h3 class='title'><a name='cupsFileTell'>cupsFileTell()</a></h3>
<h4>Description</h4>
<p>Return the current file position.</p>
+40 -7
Ver Arquivo
@@ -191,6 +191,7 @@ require CUPS 1.1 or higher.</p>
<tr><td><tt>HTTP_CONTINUE</tt> </td><td>Everything OK, keep going...</td></tr>
<tr><td><tt>HTTP_CREATED</tt> </td><td>PUT command was successful</td></tr>
<tr><td><tt>HTTP_ERROR</tt> </td><td>An error response from httpXxxx()</td></tr>
<tr><td><tt>HTTP_EXPECTATION_FAILED</tt> </td><td>The expectation given in an Expect header field was not met</td></tr>
<tr><td><tt>HTTP_FORBIDDEN</tt> </td><td>Forbidden to access this URI</td></tr>
<tr><td><tt>HTTP_GATEWAY_TIMEOUT</tt> </td><td>Gateway connection timed out</td></tr>
<tr><td><tt>HTTP_GONE</tt> </td><td>Server has gone away</td></tr>
@@ -211,6 +212,7 @@ require CUPS 1.1 or higher.</p>
<tr><td><tt>HTTP_PAYMENT_REQUIRED</tt> </td><td>Payment required</td></tr>
<tr><td><tt>HTTP_PRECONDITION</tt> </td><td>Precondition failed</td></tr>
<tr><td><tt>HTTP_PROXY_AUTHENTICATION</tt> </td><td>Proxy Authentication is Required</td></tr>
<tr><td><tt>HTTP_REQUESTED_RANGE</tt> </td><td>The requested range is not satisfiable</td></tr>
<tr><td><tt>HTTP_REQUEST_TIMEOUT</tt> </td><td>Request timed out</td></tr>
<tr><td><tt>HTTP_REQUEST_TOO_LARGE</tt> </td><td>Request entity too large</td></tr>
<tr><td><tt>HTTP_RESET_CONTENT</tt> </td><td>Content was reset/recreated</td></tr>
@@ -368,7 +370,7 @@ require CUPS 1.1 or higher.</p>
<li><a href='#httpFlushWrite'><tt>httpFlushWrite()</tt></a> <span class='info'>&nbsp;CUPS 1.2&nbsp;</span></li>
<li><a href='#httpGet'><tt>httpGet()</tt></a> </li>
<li><a href='#httpGetBlocking'><tt>httpGetBlocking()</tt></a> <span class='info'>&nbsp;CUPS 1.2&nbsp;</span></li>
<li><a href='#httpGetCookie'><tt>httpGetCookie()</tt></a> </li>
<li><a href='#httpGetCookie'><tt>httpGetCookie()</tt></a> <span class='info'>&nbsp;CUPS 1.1.19&nbsp;</span></li>
<li><a href='#httpGetDateString'><tt>httpGetDateString()</tt></a> <span class='info'>&nbsp;DEPRECATED&nbsp;</span></li>
<li><a href='#httpGetDateString2'><tt>httpGetDateString2()</tt></a> <span class='info'>&nbsp;CUPS 1.2&nbsp;</span></li>
<li><a href='#httpGetDateTime'><tt>httpGetDateTime()</tt></a> </li>
@@ -397,6 +399,7 @@ require CUPS 1.1 or higher.</p>
<li><a href='#httpSeparate2'><tt>httpSeparate2()</tt></a> <span class='info'>&nbsp;CUPS 1.1.21&nbsp;</span></li>
<li><a href='#httpSeparateURI'><tt>httpSeparateURI()</tt></a> <span class='info'>&nbsp;CUPS 1.2&nbsp;</span></li>
<li><a href='#httpSetCookie'><tt>httpSetCookie()</tt></a> <span class='info'>&nbsp;CUPS 1.1.19&nbsp;</span></li>
<li><a href='#httpSetExpect'><tt>httpSetExpect()</tt></a> <span class='info'>&nbsp;CUPS 1.2&nbsp;</span></li>
<li><a href='#httpSetField'><tt>httpSetField()</tt></a> </li>
<li><a href='#httpSetLength'><tt>httpSetLength()</tt></a> <span class='info'>&nbsp;CUPS 1.2&nbsp;</span></li>
<li><a href='#httpStatus'><tt>httpStatus()</tt></a> </li>
@@ -1165,9 +1168,11 @@ httpGetBlocking(
<h4>Returns</h4>
<p>1 if blocking, 0 if non-blocking</p>
<!-- NEW PAGE -->
<h3 class='title'><a name='httpGetCookie'>httpGetCookie()</a></h3>
<h3 class='title'><span class='info'>&nbsp;CUPS 1.1.19&nbsp;</span><a name='httpGetCookie'>httpGetCookie()</a></h3>
<h4>Description</h4>
<p>Get any cookie data from the response.</p>
<p>Get any cookie data from the response.
</p>
<h4>Syntax</h4>
<pre>
const char *
@@ -1308,16 +1313,19 @@ httpGetHostByName(
<!-- NEW PAGE -->
<h3 class='title'><span class='info'>&nbsp;CUPS 1.2&nbsp;</span><a name='httpGetHostname'>httpGetHostname()</a></h3>
<h4>Description</h4>
<p>Get the FQDN for the local system.
<p>Get the FQDN for the connection or local system.
This function uses both gethostname() and gethostbyname() to
get the local hostname with domain.
When &quot;http&quot; points to a connected socket, return the hostname or
address that was used in the call to httpConnect() or httpConnectEncrypt().
Otherwise, return the FQDN for the local system using both gethostname()
and gethostbyname() to get the local hostname with domain.
</p>
<h4>Syntax</h4>
<pre>
const char *
httpGetHostname(
<a href='#http_t'>http_t</a> * http,
char * s,
int slen);
</pre>
@@ -1325,11 +1333,12 @@ httpGetHostname(
<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
<thead><tr><th>Name</th><th>Description</th></tr></thead>
<tbody>
<tr><td><tt>http</tt></td><td>HTTP connection or NULL</td></tr>
<tr><td><tt>s</tt></td><td>String buffer for name</td></tr>
<tr><td><tt>slen</tt></td><td>Size of buffer</td></tr>
</tbody></table></div>
<h4>Returns</h4>
<p>FQDN for this system</p>
<p>FQDN for connection or system</p>
<!-- NEW PAGE -->
<h3 class='title'><span class='info'>&nbsp;DEPRECATED&nbsp;</span><a name='httpGetLength'>httpGetLength()</a></h3>
<h4>Description</h4>
@@ -1846,6 +1855,30 @@ httpSetCookie(
<h4>Returns</h4>
<p>Nothing.</p>
<!-- NEW PAGE -->
<h3 class='title'><span class='info'>&nbsp;CUPS 1.2&nbsp;</span><a name='httpSetExpect'>httpSetExpect()</a></h3>
<h4>Description</h4>
<p>Set the Expect: header in a request.
Currently only HTTP_CONTINUE is supported for the &quot;expect&quot; argument.
</p>
<h4>Syntax</h4>
<pre>
void
httpSetExpect(
<a href='#http_t'>http_t</a> * http,
http_status_t expect);
</pre>
<h4>Arguments</h4>
<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
<thead><tr><th>Name</th><th>Description</th></tr></thead>
<tbody>
<tr><td><tt>http</tt></td><td>HTTP connection</td></tr>
<tr><td><tt>expect</tt></td><td>HTTP status to expect (HTTP_CONTINUE)</td></tr>
</tbody></table></div>
<h4>Returns</h4>
<p>Nothing.</p>
<!-- NEW PAGE -->
<h3 class='title'><a name='httpSetField'>httpSetField()</a></h3>
<h4>Description</h4>
<p>Set the value of an HTTP header.</p>
+79 -3
Ver Arquivo
@@ -185,6 +185,7 @@ library:</p>
<li><a href='#ppdEmitFd'><tt>ppdEmitFd()</tt></a> </li>
<li><a href='#ppdEmitJCL'><tt>ppdEmitJCL()</tt></a> </li>
<li><a href='#ppdEmitJCLEnd'><tt>ppdEmitJCLEnd()</tt></a> <span class='info'>&nbsp;CUPS 1.2&nbsp;</span></li>
<li><a href='#ppdEmitString'><tt>ppdEmitString()</tt></a> <span class='info'>&nbsp;CUPS 1.2&nbsp;</span></li>
<li><a href='#ppdErrorString'><tt>ppdErrorString()</tt></a> <span class='info'>&nbsp;CUPS 1.1.19&nbsp;</span></li>
<li><a href='#ppdFindAttr'><tt>ppdFindAttr()</tt></a> <span class='info'>&nbsp;CUPS 1.1.19&nbsp;</span></li>
<li><a href='#ppdFindChoice'><tt>ppdFindChoice()</tt></a> </li>
@@ -342,8 +343,8 @@ ppdEmitAfterOrder(
<tr><td><tt>ppd</tt></td><td>PPD file record</td></tr>
<tr><td><tt>fp</tt></td><td>File to write to</td></tr>
<tr><td><tt>section</tt></td><td>Section to write</td></tr>
<tr><td><tt>limit</tt></td><td>Non-zero to use min_order, 0 to include all</td></tr>
<tr><td><tt>min_order</tt></td><td>Lowest order dependency to include</td></tr>
<tr><td><tt>limit</tt></td><td>Non-zero to use min_order</td></tr>
<tr><td><tt>min_order</tt></td><td>Lowest OrderDependency</td></tr>
</tbody></table></div>
<h4>Returns</h4>
<p>0 on success, -1 on failure</p>
@@ -418,6 +419,38 @@ ppdEmitJCLEnd(
<h4>Returns</h4>
<p>0 on success, -1 on failure</p>
<!-- NEW PAGE -->
<h3 class='title'><span class='info'>&nbsp;CUPS 1.2&nbsp;</span><a name='ppdEmitString'>ppdEmitString()</a></h3>
<h4>Description</h4>
<p>Get a string containing the code for marked options.
When &quot;min_order&quot; is greater than zero, this function only includes options
whose OrderDependency value is greater than or equal to &quot;min_order&quot;.
Otherwise, all options in the specified section are included in the
returned string.
The return string is allocated on the heap and should be freed using
free() when you are done with it.
</p>
<h4>Syntax</h4>
<pre>
char *
ppdEmitString(
<a href='#ppd_file_t'>ppd_file_t</a> * ppd,
<a href='#ppd_section_t'>ppd_section_t</a> section,
float min_order);
</pre>
<h4>Arguments</h4>
<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
<thead><tr><th>Name</th><th>Description</th></tr></thead>
<tbody>
<tr><td><tt>ppd</tt></td><td>PPD file record</td></tr>
<tr><td><tt>section</tt></td><td>Section to write</td></tr>
<tr><td><tt>min_order</tt></td><td>Lowest OrderDependency</td></tr>
</tbody></table></div>
<h4>Returns</h4>
<p>String containing option code</p>
<!-- NEW PAGE -->
<h3 class='title'><span class='info'>&nbsp;CUPS 1.1.19&nbsp;</span><a name='ppdErrorString'>ppdErrorString()</a></h3>
<h4>Description</h4>
<p>Returns the text assocated with a status.
@@ -923,7 +956,8 @@ struct ppd_coption_s
<pre>
struct ppd_cparam_s
{
<a href='#ppd_cpvalue_t'>ppd_cpvalue_t</a> minimum, maximum, current;
<a href='#ppd_cpvalue_t'>ppd_cpvalue_t</a> current;
<a href='#ppd_cplimit_t'>ppd_cplimit_t</a> minimum, maximum;
char name[PPD_MAX_NAME];
int order;
char text[PPD_MAX_TEXT];
@@ -935,6 +969,7 @@ struct ppd_cparam_s
<thead><tr><th>Name</th><th>Description</th></tr></thead>
<tbody>
<tr><td><tt>current</tt> </td><td>Current value</td></tr>
<tr><td><tt>maximum</tt> </td><td>Maximum value</td></tr>
<tr><td><tt>name[PPD_MAX_NAME]</tt> </td><td>Parameter name</td></tr>
<tr><td><tt>order</tt> </td><td>Order (0 to N)</td></tr>
<tr><td><tt>text[PPD_MAX_TEXT]</tt> </td><td>Human-readable text</td></tr>
@@ -1196,6 +1231,7 @@ struct ppd_size_s
<li><a href='#ppd_const_t'><tt>ppd_const_t</tt></a> </li>
<li><a href='#ppd_coption_t'><tt>ppd_coption_t</tt></a> <span class='info'>&nbsp;CUPS 1.2&nbsp;</span></li>
<li><a href='#ppd_cparam_t'><tt>ppd_cparam_t</tt></a> <span class='info'>&nbsp;CUPS 1.2&nbsp;</span></li>
<li><a href='#ppd_cplimit_t'><tt>ppd_cplimit_t</tt></a> <span class='info'>&nbsp;CUPS 1.2&nbsp;</span></li>
<li><a href='#ppd_cptype_t'><tt>ppd_cptype_t</tt></a> <span class='info'>&nbsp;CUPS 1.2&nbsp;</span></li>
<li><a href='#ppd_cpvalue_t'><tt>ppd_cpvalue_t</tt></a> <span class='info'>&nbsp;CUPS 1.2&nbsp;</span></li>
<li><a href='#ppd_emul_t'><tt>ppd_emul_t</tt></a> </li>
@@ -1248,6 +1284,14 @@ typedef struct <a href='#ppd_coption_s'>ppd_coption_s</a> ppd_coption_t;
typedef struct <a href='#ppd_cparam_s'>ppd_cparam_s</a> ppd_cparam_t;
</pre>
<!-- NEW PAGE -->
<h3 class='title'><span class='info'>&nbsp;CUPS 1.2&nbsp;</span><a name='ppd_cplimit_t'>ppd_cplimit_t</a></h3>
<h4>Description</h4>
<p>Custom Parameter Limit </p>
<h4>Definition</h4>
<pre>
typedef union <a href='#ppd_cplimit_u'>ppd_cplimit_u</a> ppd_cplimit_t;
</pre>
<!-- NEW PAGE -->
<h3 class='title'><span class='info'>&nbsp;CUPS 1.2&nbsp;</span><a name='ppd_cptype_t'>ppd_cptype_t</a></h3>
<h4>Description</h4>
<p>Custom Parameter Type </p>
@@ -1330,9 +1374,41 @@ typedef enum <a href='#ppd_ui_e'>ppd_ui_e</a> ppd_ui_t;
<!-- NEW PAGE -->
<h2 class='title'><a name='UNIONS'>Unions</a></h2>
<ul>
<li><a href='#ppd_cplimit_u'><tt>ppd_cplimit_u</tt></a> <span class='info'>&nbsp;CUPS 1.2&nbsp;</span></li>
<li><a href='#ppd_cpvalue_u'><tt>ppd_cpvalue_u</tt></a> <span class='info'>&nbsp;CUPS 1.2&nbsp;</span></li>
</ul>
<!-- NEW PAGE -->
<h3 class='title'><span class='info'>&nbsp;CUPS 1.2&nbsp;</span><a name='ppd_cplimit_u'>ppd_cplimit_u</a></h3>
<h4>Description</h4>
<p>Custom Parameter Limit </p>
<h4>Definition</h4>
<pre>
union ppd_cplimit_u
{
float custom_curve;
int custom_int;
float custom_invcurve;
int custom_passcode;
int custom_password;
float custom_points;
float custom_real;
int custom_string;
};
</pre>
<h4>Members</h4>
<div class='table'><table align='center' border='1' width='80%'>
<thead><tr><th>Name</th><th>Description</th></tr></thead>
<tbody>
<tr><td><tt>custom_curve</tt> </td><td>Gamma value</td></tr>
<tr><td><tt>custom_int</tt> </td><td>Integer value</td></tr>
<tr><td><tt>custom_invcurve</tt> </td><td>Gamma value</td></tr>
<tr><td><tt>custom_passcode</tt> </td><td>Passcode length</td></tr>
<tr><td><tt>custom_password</tt> </td><td>Password length</td></tr>
<tr><td><tt>custom_points</tt> </td><td>Measurement value</td></tr>
<tr><td><tt>custom_real</tt> </td><td>Real value</td></tr>
<tr><td><tt>custom_string</tt> </td><td>String length</td></tr>
</tbody></table></div>
<!-- NEW PAGE -->
<h3 class='title'><span class='info'>&nbsp;CUPS 1.2&nbsp;</span><a name='ppd_cpvalue_u'>ppd_cpvalue_u</a></h3>
<h4>Description</h4>
<p>Custom Parameter Value </p>
+1 -1
Ver Arquivo
@@ -1883,7 +1883,7 @@ are still pending or active then the new job will be
rejected.</P>
<P>Setting the maximum size to 0 disables this functionality. The
default setting is 0.</P>
default setting is 500.</P>
<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.1.7</SPAN><A NAME="MaxJobsPerPrinter">MaxJobsPerPrinter</A></H2>
+120
Ver Arquivo
@@ -0,0 +1,120 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<!-- SECTION: Specifications -->
<head>
<title>Generating PostScript for CUPS</title>
<meta name='keywords' content='Programming, PostScript, Document Structuring Conventions'>
<link rel='stylesheet' type='text/css' href='../cups.css'>
</head>
<body>
<!--
"$Id$"
CUPS PostScript file specification for the Common UNIX Printing System (CUPS).
Copyright 2006 by Easy Software Products.
These coded instructions, statements, and computer programs are the
property of Easy Software Products and are protected by Federal
copyright law. Distribution and use rights are outlined in the file
"LICENSE.txt" which should have been included with this file. If this
file is missing or damaged please contact Easy Software Products
at:
Attn: CUPS Licensing Information
Easy Software Products
44141 Airport View Drive, Suite 204
Hollywood, Maryland 20636 USA
Voice: (301) 373-9600
EMail: cups-info@cups.org
WWW: http://www.cups.org
-->
<h2 class='title'><a name='INTRODUCTION'>Introduction</a></h2>
<p>This document describes how to generate PostScript output for
CUPS and is largely based on the <a
href="http://partners.adobe.com/public/developer/en/ps/5001.DSC_Spec.pdf">
Adobe TechNote #5001: PostScript Language Document Structuring
Conventions Specification Version 3.0</a>. While CUPS can
generally print any PostScript file, following the rules in the
Adobe TechNote and this document will ensure that your PostScript
output will work reliably.</p>
<blockquote><b>Note:</b> While PostScript is currently the
defacto-standard print job file format/language for UNIX-based
applications, it is slowly being phased out in favor of Adobe's
Portable Document Format ("PDF") which offers many advantages
over PostScript. MacOS X uses PDF as the primary print job file
format, and we expect Linux to soon follow. Both PostScript and
PDF are complex formats, and we highly recommend using high-level
toolkits whenever possible.</blockquote>
<h3>Anatomy of a PostScript File</h3>
<p>PostScript files are ASCII text files starting with a header
line (<tt>%!PS-Adobe-3.0</tt>) followed by a combination of
comment lines starting with two percent signs (<tt>%%</tt>) and
PostScript code lines. The lines themselves should not exceed 255
characters to conform to the DSC. The following short PostScript
file produces a box with a smiley face in it:</p>
<pre class="command">
%!PS-Adobe-3.0
%%BoundingBox: 36 36 576 756
%%Pages: 1
%%LanguageLevel: 2
%%EndComments
%%Page: (1) 1
% Draw a black box around the page
0 setgray
1 setlinewidth
36 36 540 720 rectstroke
% Draw a two inch blue circle in the middle of the page
0 0 1 setrgbcolor
306 396 144 0 360 arc closepath fill
% Draw two half inch yellow circles for eyes
1 1 0 setrgbcolor
252 432 36 0 360 arc closepath fill
360 432 36 0 360 arc closepath fill
% Draw the smile
1 setlinecap
18 setlinewidth
306 396 99 200 340 arc stroke
% Print it!
showpage
%%EOF
</pre>
<div class="figure"><table summary="Sample PostScript File Output">
<caption>Figure 1: <a name="FIGURE_1">Sample PostScript File Output</a></caption>
<tr><td align="center"><img src="../images/smiley.jpg"
width="445" height="570" alt="Sample PostScript File Output"></td></tr>
</table></div>
<h2>Embedding Printer Options</h2>
<h2>Embedding Fonts and Text</h2>
<h2>Embedding Images</h2>
<blockquote><b>Note:</b> While some printers support arbitrary
binary data in PostScript files, we do not recommend this
practice because it does not work with all printers or
interfaces. In most cases, the Base-85 encoding and compression
filters can be used to embed images with very little, if any,
increase in data size.</blockquote>
</body>
</html>
Arquivo binário não exibido.

Depois

Largura:  |  Altura:  |  Tamanho: 14 KiB

+2154 -1475
Ver Arquivo
Diferenças do arquivo suprimidas por serem muito extensas Carregar Diff
+4 -4
Ver Arquivo
@@ -1,5 +1,5 @@
#
# "$Id: Makefile 5308 2006-03-18 13:18:18Z mike $"
# "$Id: Makefile 5335 2006-03-24 02:56:20Z mike $"
#
# Locale file makefile for the Common UNIX Printing System (CUPS).
#
@@ -79,7 +79,7 @@ uninstall:
pot:
echo Updating cups.pot...
cd ..; xgettext -o locale/cups.pot -j --keyword=_ --no-wrap \
--copyright-holder="Easy Software Products" \
--no-location --copyright-holder="Easy Software Products" \
--msgid-bugs-address="http://www.cups.org/str.php" \
*/*.c
(cat cups.header; \
@@ -89,7 +89,7 @@ pot:
mv cups.pot.N cups.pot
for loc in $(LANGUAGES) ; do \
echo Merging changes into cups_$$loc.po... ; \
msgmerge -o cups_$$loc.po cups_$$loc.po cups.pot ; \
msgmerge -o cups_$$loc.po --no-location cups_$$loc.po cups.pot ; \
done
@@ -108,5 +108,5 @@ translate.o: ../cups/http.h ../cups/i18n.h ../cups/language.h ../cups/string.h
#
# End of "$Id: Makefile 5308 2006-03-18 13:18:18Z mike $".
# End of "$Id: Makefile 5335 2006-03-24 02:56:20Z mike $".
#
+102 -1088
Ver Arquivo
Diferenças do arquivo suprimidas por serem muito extensas Carregar Diff
+174 -1117
Ver Arquivo
Diferenças do arquivo suprimidas por serem muito extensas Carregar Diff
+107 -1088
Ver Arquivo
Diferenças do arquivo suprimidas por serem muito extensas Carregar Diff
+3 -2
Ver Arquivo
@@ -1,5 +1,5 @@
#
# "$Id: Makefile 5229 2006-03-05 16:48:12Z mike $"
# "$Id: Makefile 5317 2006-03-21 02:35:37Z mike $"
#
# Man page makefile for the Common UNIX Printing System (CUPS).
#
@@ -31,6 +31,7 @@ include ../Makedefs
MAN1 = cancel.$(MAN1EXT) \
cups-config.$(MAN1EXT) \
cupstestdsc.$(MAN1EXT) \
cupstestppd.$(MAN1EXT) \
lp.$(MAN1EXT) \
lpoptions.$(MAN1EXT) \
@@ -180,5 +181,5 @@ mantohtml: mantohtml.o
#
# End of "$Id: Makefile 5229 2006-03-05 16:48:12Z mike $".
# End of "$Id: Makefile 5317 2006-03-21 02:35:37Z mike $".
#
+5 -3
Ver Arquivo
@@ -1,5 +1,5 @@
.\"
.\" "$Id: cupsaddsmb.man.in 5099 2006-02-13 02:46:10Z mike $"
.\" "$Id: cupsaddsmb.man.in 5327 2006-03-23 19:53:24Z mike $"
.\"
.\" cupsaddsmb man page for the Common UNIX Printing System (CUPS).
.\"
@@ -21,7 +21,7 @@
.\" EMail: cups-info@cups.org
.\" WWW: http://www.cups.org
.\"
.TH cupsaddsmb 8 "Common UNIX Printing System" "12 February 2006" "Easy Software Products"
.TH cupsaddsmb 8 "Common UNIX Printing System" "23 March 2006" "Easy Software Products"
.SH NAME
cupsaddsmb \- export printers to samba for windows clients
.SH SYNOPSIS
@@ -68,9 +68,11 @@ Exports all known printers. Otherwise only the named printers are
exported.
.TP 5
-h cups-server[:port]
.br
Specifies a different CUPS server to use.
.TP 5
-v
.br
Specifies that verbose information should be shown. This is
useful for debugging SAMBA configuration problems.
.SH SAMBA CONFIGURATION
@@ -188,5 +190,5 @@ http://www.cups.org/windows/
.SH COPYRIGHT
Copyright 1997-2006 by Easy Software Products, All Rights Reserved.
.\"
.\" End of "$Id: cupsaddsmb.man.in 5099 2006-02-13 02:46:10Z mike $".
.\" End of "$Id: cupsaddsmb.man.in 5327 2006-03-23 19:53:24Z mike $".
.\"
+11 -19
Ver Arquivo
@@ -1,5 +1,5 @@
.\"
.\" "$Id: cupsd.conf.man.in 5099 2006-02-13 02:46:10Z mike $"
.\" "$Id: cupsd.conf.man.in 5327 2006-03-23 19:53:24Z mike $"
.\"
.\" cupsd.conf man page for the Common UNIX Printing System (CUPS).
.\"
@@ -21,7 +21,7 @@
.\" EMail: cups-info@cups.org
.\" WWW: http://www.cups.org
.\"
.TH cupsd.conf 5 "Common UNIX Printing System" "12 February 2006" "Easy Software Products"
.TH cupsd.conf 5 "Common UNIX Printing System" "23 March 2006" "Easy Software Products"
.SH NAME
cupsd.conf \- server configuration file for cups
.SH DESCRIPTION
@@ -332,6 +332,14 @@ Include filename
.br
Includes the named file.
.TP 5
JobRetryInterval seconds
.br
Specifies the interval between retries of jobs in seconds.
.TP 5
JobRetryLimit count
.br
Specifies the number of retries that are done for jobs.
.TP 5
KeepAlive Yes
.TP 5
KeepAlive No
@@ -342,22 +350,6 @@ KeepAliveTimeout seconds
.br
Specifies the amount of time that connections are kept alive.
.TP 5
JobRetryInterval seconds
.br
Specifies the interval between retries of jobs in seconds.
.TP 5
JobRetryLimit count
.br
Specifies the number of retries that are done for jobs.
.TP 5
KeepAlive
.br
Specifies whether or not to support HTTP Keep-Alive.
.TP 5
KeepAliveTimeout
.br
Specifies the connection timeout for HTTP Keep-Alive.
.TP 5
<Limit operations> ... </Limit>
.br
Specifies the IPP operations that are being limited inside a policy.
@@ -615,5 +607,5 @@ http://localhost:631/help
.SH COPYRIGHT
Copyright 1997-2006 by Easy Software Products, All Rights Reserved.
.\"
.\" End of "$Id: cupsd.conf.man.in 5099 2006-02-13 02:46:10Z mike $".
.\" End of "$Id: cupsd.conf.man.in 5327 2006-03-23 19:53:24Z mike $".
.\"
+59
Ver Arquivo
@@ -0,0 +1,59 @@
.\"
.\" "$Id: cupstestdsc.man 5099 2006-02-13 02:46:10Z mike $"
.\"
.\" cupstestdsc man page for the Common UNIX Printing System (CUPS).
.\"
.\" Copyright 2006 by Easy Software Products.
.\"
.\" These coded instructions, statements, and computer programs are the
.\" property of Easy Software Products and are protected by Federal
.\" copyright law. Distribution and use rights are outlined in the file
.\" "LICENSE.txt" which should have been included with this file. If this
.\" file is missing or damaged please contact Easy Software Products
.\" at:
.\"
.\" Attn: CUPS Licensing Information
.\" Easy Software Products
.\" 44141 Airport View Drive, Suite 204
.\" Hollywood, Maryland 20636 USA
.\"
.\" Voice: (301) 373-9600
.\" EMail: cups-info@cups.org
.\" WWW: http://www.cups.org
.\"
.TH cupstestdsc 1 "Common UNIX Printing System" "20 March 2006" "Easy Software Products"
.SH NAME
cupstestdsc \- test conformance of postscript files
.SH SYNOPSIS
.B cupstestdsc
[ -h ] filename.ps [ ...
.I filenameN.ps
]
.br
.B cupstestdsc
[ -h ] -
.SH DESCRIPTION
\fIcupstestdsc\fR tests the conformance of PostScript files to
the Adobe PostScript Language Document Structuring Conventions
Specification version 3.0. The results of testing and any other
output are sent to the standard output. The second form of the
command reads PostScript from the standard input.
.SH LIMITATIONS
\fIcupstestdsc\fR only validates the DSC comments in a PostScript
file and does not attempt to validate the PostScript code itself.
Developers must ensure that the PostScript they generate follows
the rules defined by Adobe. Specifically, all pages must be
independent of each other, code outside page descriptions may not
affect the graphics state (current font, color, transform matrix,
etc.), and device-specific commands such as setpagedevice should
not be used.
.SH SEE ALSO
http://localhost:631/help
.br
Adobe PostScript Language Document Structuring Conventions
Specification, Version 3.0.
.SH COPYRIGHT
Copyright 2006 by Easy Software Products, All Rights Reserved.
.\"
.\" End of "$Id$".
.\"
+7 -10
Ver Arquivo
@@ -1,5 +1,5 @@
.\"
.\" "$Id: filter.man 5099 2006-02-13 02:46:10Z mike $"
.\" "$Id: filter.man 5327 2006-03-23 19:53:24Z mike $"
.\"
.\" filter man page for the Common UNIX Printing System (CUPS).
.\"
@@ -21,7 +21,7 @@
.\" EMail: cups-info@cups.org
.\" WWW: http://www.cups.org
.\"
.TH filter 7 "Common UNIX Printing System" "12 February 2006" "Easy Software Products"
.TH filter 7 "Common UNIX Printing System" "23 March 2006" "Easy Software Products"
.SH NAME
filter \- cups file conversion filter interface
.SH SYNOPSIS
@@ -129,7 +129,7 @@ message to the current \fIErrorLog\fR using the "warning" log level.
.SH ENVIRONMENT VARIABLES
The following environment variables are defined by the CUPS
server when executing the backend:
server when executing the filter:
.TP 5
CHARSET
@@ -162,10 +162,7 @@ The root directory of the server.
.TP 5
DEVICE_URI
.br
The device-uri associated with the printer; this is provided for
shell scripts which may not be able to get the passed argv[0]
string and for backends that require any authentication
information which is not included in argv[0].
The device-uri associated with the printer.
.TP 5
FINAL_CONTENT_TYPE
@@ -182,7 +179,7 @@ The default language locale (typically C or en).
PATH
.br
The standard execution path for external programs that may be run by
the backend.
the filter.
.TP 5
PPD
@@ -214,7 +211,7 @@ The timezone of the server.
.TP 5
USER
.br
The user executing the backend, typically root; consult the
The user executing the filter, typically "lp" or "root"; consult the
\fIcupsd.conf(5)\fR file for the current setting.
.SH COMPATIBILITY
@@ -229,5 +226,5 @@ http://localhost:631/help
.SH COPYRIGHT
Copyright 1997-2006 by Easy Software Products, All Rights Reserved.
.\"
.\" End of "$Id: filter.man 5099 2006-02-13 02:46:10Z mike $".
.\" End of "$Id: filter.man 5327 2006-03-23 19:53:24Z mike $".
.\"
+5 -5
Ver Arquivo
@@ -1,5 +1,5 @@
.\"
.\" "$Id: lp.man 5099 2006-02-13 02:46:10Z mike $"
.\" "$Id: lp.man 5327 2006-03-23 19:53:24Z mike $"
.\"
.\" lp man page for the Common UNIX Printing System (CUPS).
.\"
@@ -21,7 +21,7 @@
.\" EMail: cups-info@cups.org
.\" WWW: http://www.cups.org
.\"
.TH lp 1 "Common UNIX Printing System" "12 February 2006" "Easy Software Products"
.TH lp 1 "Common UNIX Printing System" "23 March 2006" "Easy Software Products"
.SH NAME
lp - print files
.SH SYNOPSIS
@@ -34,7 +34,7 @@ lp - print files
.I hostname[:port]
] [ -m ] [ -n
.I num-copies
[ -o
] [ -o
.I option[=value]
] [ -q
.I priority
@@ -57,7 +57,7 @@ lp - print files
.I job-id
] [ -n
.I num-copies
[ -o
] [ -o
.I option[=value]
] [ -q
.I priority
@@ -248,5 +248,5 @@ http://localhost:631/help
.SH COPYRIGHT
Copyright 1997-2006 by Easy Software Products, All Rights Reserved.
.\"
.\" End of "$Id: lp.man 5099 2006-02-13 02:46:10Z mike $".
.\" End of "$Id: lp.man 5327 2006-03-23 19:53:24Z mike $".
.\"
+6 -3
Ver Arquivo
@@ -1,5 +1,5 @@
.\"
.\" "$Id: lpadmin.man 5099 2006-02-13 02:46:10Z mike $"
.\" "$Id: lpadmin.man 5327 2006-03-23 19:53:24Z mike $"
.\"
.\" lpadmin man page for the Common UNIX Printing System (CUPS).
.\"
@@ -21,7 +21,7 @@
.\" EMail: cups-info@cups.org
.\" WWW: http://www.cups.org
.\"
.TH lpadmin 8 "Common UNIX Printing System" "12 February 2006" "Easy Software Products"
.TH lpadmin 8 "Common UNIX Printing System" "23 March 2006" "Easy Software Products"
.SH NAME
lpadmin \- configure cups printers and classes
.SH SYNOPSIS
@@ -129,8 +129,11 @@ Removes the named \fIprinter\fR from \fIclass\fR. If the
resulting class becomes empty it is removed.
.TP 5
-u allow:user,user,@group
.TP 5
-u deny:user,user,@group
.TP 5
-u allow:all
.TP 5
-u deny:none
.br
Sets user-level access control on a printer. Names starting with
@@ -179,5 +182,5 @@ http://localhost:631/help
.SH COPYRIGHT
Copyright 1997-2006 by Easy Software Products, All Rights Reserved.
.\"
.\" End of "$Id: lpadmin.man 5099 2006-02-13 02:46:10Z mike $".
.\" End of "$Id: lpadmin.man 5327 2006-03-23 19:53:24Z mike $".
.\"
+4 -4
Ver Arquivo
@@ -1,5 +1,5 @@
.\"
.\" "$Id: lpstat.man 5099 2006-02-13 02:46:10Z mike $"
.\" "$Id: lpstat.man 5327 2006-03-23 19:53:24Z mike $"
.\"
.\" lpstat man page for the Common UNIX Printing System (CUPS).
.\"
@@ -21,7 +21,7 @@
.\" EMail: cups-info@cups.org
.\" WWW: http://www.cups.org
.\"
.TH lpstat 1 "Common UNIX Printing System" "12 February 2006" "Easy Software Products"
.TH lpstat 1 "Common UNIX Printing System" "23 March 2006" "Easy Software Products"
.SH NAME
lpstat \- print cups status information
.SH SYNOPSIS
@@ -36,7 +36,7 @@ lpstat \- print cups status information
.I destination(s)
] ] [ -c [
.I class(es)
] [ -d ] [ -o [
] ] [ -d ] [ -o [
.I destination(s)
] ] [ -p [
.I printer(s)
@@ -144,5 +144,5 @@ http://localhost:631/help
.SH COPYRIGHT
Copyright 1997-2006 by Easy Software Products, All Rights Reserved.
.\"
.\" End of "$Id: lpstat.man 5099 2006-02-13 02:46:10Z mike $".
.\" End of "$Id: lpstat.man 5327 2006-03-23 19:53:24Z mike $".
.\"
+5 -2
Ver Arquivo
@@ -1,5 +1,5 @@
#
# "$Id: cups.list.in 5311 2006-03-19 13:21:42Z mike $"
# "$Id: cups.list.in 5328 2006-03-23 20:23:19Z mike $"
#
# ESP Package Manager (EPM) file list for the Common UNIX Printing
# System (CUPS).
@@ -257,6 +257,7 @@ l 0755 root sys /usr/etc/lpc $SBINDIR/lpc
# User commands
d 0755 root sys $BINDIR -
f 0755 root sys $BINDIR/cancel systemv/cancel
f 0755 root sys $BINDIR/cupstestdsc systemv/cupstestdsc
f 0755 root sys $BINDIR/cupstestppd systemv/cupstestppd
f 0755 root sys $BINDIR/lp systemv/lp
f 0755 root sys $BINDIR/lpoptions systemv/lpoptions
@@ -448,6 +449,7 @@ f 0644 root sys $DOCDIR/help doc/help/man-*.html
f 0644 root sys $DOCDIR/help doc/help/ref-*.html
d 0755 root sys $DOCDIR/images -
f 0644 root sys $DOCDIR/images doc/images/*.gif
f 0644 root sys $DOCDIR/images doc/images/*.jpg
f 0644 root sys $DOCDIR/images doc/images/*.png
f 0644 root sys $DOCDIR/robots.txt doc/robots.txt
@@ -473,6 +475,7 @@ d 0755 root sys $MANDIR/man5 -
d 0755 root sys $MANDIR/man7 -
f 0644 root sys $MANDIR/man1/cancel.$MAN1EXT man/cancel.$MAN1EXT
f 0644 root sys $MANDIR/man1/cupstestdsc.$MAN1EXT man/cupstestdsc.$MAN1EXT
f 0644 root sys $MANDIR/man1/cupstestppd.$MAN1EXT man/cupstestppd.$MAN1EXT
f 0644 root sys $MANDIR/man1/lpoptions.$MAN1EXT man/lpoptions.$MAN1EXT
f 0644 root sys $MANDIR/man1/lppasswd.$MAN1EXT man/lppasswd.$MAN1EXT
@@ -516,5 +519,5 @@ f 0644 root sys $AMANDIR/man$MAN8DIR/cups-lpd.$MAN8EXT man/cups-lpd.$MAN8EXT
i 0755 root sys cups init/cups.sh
#
# End of "$Id: cups.list.in 5311 2006-03-19 13:21:42Z mike $".
# End of "$Id: cups.list.in 5328 2006-03-23 20:23:19Z mike $".
#
+4 -2
Ver Arquivo
@@ -1,5 +1,5 @@
#
# "$Id: cups.spec.in 5310 2006-03-19 03:23:34Z mike $"
# "$Id: cups.spec.in 5317 2006-03-21 02:35:37Z mike $"
#
# RPM "spec" file for the Common UNIX Printing System (CUPS).
#
@@ -215,6 +215,7 @@ rm -rf $RPM_BUILD_ROOT
#/sbin/rc.d/rc5.d/*
/usr/bin/cancel
/usr/bin/cupstestdsc
/usr/bin/cupstestppd
/usr/bin/lp*
%dir /usr/lib/cups
@@ -264,6 +265,7 @@ rm -rf $RPM_BUILD_ROOT
%dir /usr/share/man/man1
/usr/share/man/man1/cancel.1.gz
/usr/share/man/man1/cupstestdsc.1.gz
/usr/share/man/man1/cupstestppd.1.gz
/usr/share/man/man1/lp.1.gz
/usr/share/man/man1/lpoptions.1.gz
@@ -358,5 +360,5 @@ rm -rf $RPM_BUILD_ROOT
#
# End of "$Id: cups.spec.in 5310 2006-03-19 03:23:34Z mike $".
# End of "$Id: cups.spec.in 5317 2006-03-21 02:35:37Z mike $".
#
+6 -10
Ver Arquivo
@@ -62,7 +62,6 @@
*PageSize w288h216/Label - 4 x 3": "<</PageSize[288 216]/ImagingBBox null>>setpagedevice"
*PageSize w288h288/Label - 4 x 4": "<</PageSize[288 288]/ImagingBBox null>>setpagedevice"
*PageSize w288h360/Label - 4 x 5": "<</PageSize[288 360]/ImagingBBox null>>setpagedevice"
*PageSize w288h360/Label - 4 x 5": "<</PageSize[288 360]/ImagingBBox null>>setpagedevice"
*PageSize w288h432/Label - 4 x 6": "<</PageSize[288 432]/ImagingBBox null>>setpagedevice"
*CloseUI: *PageSize
@@ -78,7 +77,6 @@
*PageRegion w288h216/Label - 4 x 3": "<</PageSize[288 216]/ImagingBBox null>>setpagedevice"
*PageRegion w288h288/Label - 4 x 4": "<</PageSize[288 288]/ImagingBBox null>>setpagedevice"
*PageRegion w288h360/Label - 4 x 5": "<</PageSize[288 360]/ImagingBBox null>>setpagedevice"
*PageRegion w288h360/Label - 4 x 5": "<</PageSize[288 360]/ImagingBBox null>>setpagedevice"
*PageRegion w288h432/Label - 4 x 6": "<</PageSize[288 432]/ImagingBBox null>>setpagedevice"
*CloseUI: *PageRegion
@@ -88,12 +86,11 @@
*ImageableArea w144h144/Label - 2 x 2": "0 0 144 144"
*ImageableArea w144h216/Label - 2 x 3": "0 0 144 216"
*ImageableArea w209h72/Label - 2.9 x 1": "0 0 209 72"
*ImageableArea w288h144/Label - 4 x 2": "0 0 280.8 144"
*ImageableArea w288h216/Label - 4 x 3": "0 0 280.8 216"
*ImageableArea w288h288/Label - 4 x 4": "0 0 280.8 288"
*ImageableArea w288h360/Label - 4 x 5": "0 0 280.8 360"
*ImageableArea w288h360/Label - 4 x 5": "0 0 280.8 360"
*ImageableArea w288h432/Label - 4 x 6": "0 0 280.8 432"
*ImageableArea w288h144/Label - 4 x 2": "0 0 287 144"
*ImageableArea w288h216/Label - 4 x 3": "0 0 287 216"
*ImageableArea w288h288/Label - 4 x 4": "0 0 287 288"
*ImageableArea w288h360/Label - 4 x 5": "0 0 287 360"
*ImageableArea w288h432/Label - 4 x 6": "0 0 287 432"
*DefaultPaperDimension: w288h360
*PaperDimension w144h72/Label - 2 x 1": "144 72"
@@ -105,12 +102,11 @@
*PaperDimension w288h216/Label - 4 x 3": "288 216"
*PaperDimension w288h288/Label - 4 x 4": "288 288"
*PaperDimension w288h360/Label - 4 x 5": "288 360"
*PaperDimension w288h360/Label - 4 x 5": "288 360"
*PaperDimension w288h432/Label - 4 x 6": "288 432"
*MaxMediaWidth: "288"
*MaxMediaHeight: "3600"
*HWMargins: 0 0 0 0
*HWMargins: 0 0 1 0
*CustomPageSize True: "pop pop pop <</PageSize[5 -2 roll]/ImagingBBox null>>setpagedevice"
*ParamCustomPageSize Width: 1 points 36 288
*ParamCustomPageSize Height: 2 points 36 3600
+5 -5
Ver Arquivo
@@ -1,5 +1,5 @@
/*
* "$Id: auth.c 5305 2006-03-18 03:05:12Z mike $"
* "$Id: auth.c 5336 2006-03-24 16:37:29Z mike $"
*
* Authorization routines for the Common UNIX Printing System (CUPS).
*
@@ -390,7 +390,7 @@ cupsdAuthorize(cupsd_client_t *con) /* I - Client connection */
*/
authorization += 5;
while (isspace(*authorization))
while (isspace(*authorization & 255))
authorization ++;
if ((localuser = cupsdFindCert(authorization)) != NULL)
@@ -414,7 +414,7 @@ cupsdAuthorize(cupsd_client_t *con) /* I - Client connection */
authorization += 5;
while (isspace(*authorization))
while (isspace(*authorization & 255))
authorization ++;
userlen = sizeof(username);
@@ -580,7 +580,7 @@ cupsdAuthorize(cupsd_client_t *con) /* I - Client connection */
cupsdLogMessage(CUPSD_LOG_ERROR,
"cupsdAuthorize: Unknown username \"%s\"!",
username);
return (HTTP_UNAUTHORIZED);
return;
}
# ifdef HAVE_SHADOW_H
@@ -2164,5 +2164,5 @@ to64(char *s, /* O - Output string */
/*
* End of "$Id: auth.c 5305 2006-03-18 03:05:12Z mike $".
* End of "$Id: auth.c 5336 2006-03-24 16:37:29Z mike $".
*/
+33 -13
Ver Arquivo
@@ -1,5 +1,5 @@
/*
* "$Id: client.c 5305 2006-03-18 03:05:12Z mike $"
* "$Id: client.c 5335 2006-03-24 02:56:20Z mike $"
*
* Client routines for the Common UNIX Printing System (CUPS) scheduler.
*
@@ -66,7 +66,9 @@
static int check_if_modified(cupsd_client_t *con,
struct stat *filestats);
#ifdef HAVE_SSL
static int encrypt_client(cupsd_client_t *con);
#endif /* HAVE_SSL */
#ifdef HAVE_CDSASSL
static CFArrayRef get_cdsa_server_certs(void);
#endif /* HAVE_CDSASSL */
@@ -1986,18 +1988,35 @@ cupsdSendError(cupsd_client_t *con, /* I - Connection */
* Send a human-readable error message.
*/
char message[1024]; /* Message for user */
char message[4096], /* Message for user */
urltext[1024], /* URL redirection text */
redirect[1024]; /* Redirection link */
const char *text; /* Status-specific text */
redirect[0] = '\0';
if (code == HTTP_UNAUTHORIZED)
text = _cupsLangString(con->language,
_("Enter your username and password or the "
"root username and password to access this "
"page."));
else if (code == HTTP_UPGRADE_REQUIRED)
text = _cupsLangString(con->language,
_("You must use a https: URL to access this "
"page."));
{
text = urltext;
snprintf(urltext, sizeof(urltext),
_cupsLangString(con->language,
_("You must access this page using the URL "
"<A HREF=\"https://%s:%d%s\">"
"https://%s:%d%s</A>.")),
con->servername, con->serverport, con->uri,
con->servername, con->serverport, con->uri);
snprintf(redirect, sizeof(redirect),
"<META HTTP-EQUIV=\"Refresh\" CONTENT=\"3;https://%s:%d%s\">\n",
con->servername, con->serverport, con->uri);
}
else
text = "";
@@ -2011,13 +2030,14 @@ cupsdSendError(cupsd_client_t *con, /* I - Connection */
"\t<TITLE>%d %s</TITLE>\n"
"\t<LINK REL=\"STYLESHEET\" TYPE=\"text/css\" "
"HREF=\"/cups.css\">\n"
"%s"
"</HEAD>\n"
"<BODY>\n"
"<H1>%d %s</H1>\n"
"<P>%s</P>\n"
"</BODY>\n"
"</HTML>\n",
code, httpStatus(code), code, httpStatus(code), text);
code, httpStatus(code), redirect, code, httpStatus(code), text);
if (httpPrintf(HTTP(con), "Content-Type: text/html; charset=utf-8\r\n") < 0)
return (0);
@@ -2465,6 +2485,7 @@ check_if_modified(
}
#ifdef HAVE_SSL
/*
* 'encrypt_client()' - Enable encryption for the client...
*/
@@ -2472,7 +2493,7 @@ check_if_modified(
static int /* O - 1 on success, 0 on error */
encrypt_client(cupsd_client_t *con) /* I - Client to encrypt */
{
#ifdef HAVE_LIBSSL
# ifdef HAVE_LIBSSL
SSL_CTX *context; /* Context for encryption */
SSL *conn; /* Connection for encryption */
unsigned long error; /* Error code */
@@ -2513,7 +2534,7 @@ encrypt_client(cupsd_client_t *con) /* I - Client to encrypt */
con->http.tls = conn;
return (1);
#elif defined(HAVE_GNUTLS)
# elif defined(HAVE_GNUTLS)
http_tls_t *conn; /* TLS session object */
int error; /* Error code */
gnutls_certificate_server_credentials *credentials;
@@ -2590,7 +2611,7 @@ encrypt_client(cupsd_client_t *con) /* I - Client to encrypt */
con->http.tls = conn;
return (1);
#elif defined(HAVE_CDSASSL)
# elif defined(HAVE_CDSASSL)
OSStatus error; /* Error info */
SSLContextRef conn; /* New connection */
CFArrayRef certificatesArray; /* Array containing certificates */
@@ -2676,10 +2697,9 @@ encrypt_client(cupsd_client_t *con) /* I - Client to encrypt */
con->http.tls = conn;
return (1);
#else
return (0);
#endif /* HAVE_LIBSSL */
# endif /* HAVE_LIBSSL */
}
#endif /* HAVE_SSL */
#ifdef HAVE_CDSASSL
@@ -3767,5 +3787,5 @@ send_file(cupsd_client_t *con, /* I - Client connection */
/*
* End of "$Id: client.c 5305 2006-03-18 03:05:12Z mike $".
* End of "$Id: client.c 5335 2006-03-24 02:56:20Z mike $".
*/
+32 -19
Ver Arquivo
@@ -1,5 +1,5 @@
/*
* "$Id: cups-driverd.c 5130 2006-02-17 20:25:33Z mike $"
* "$Id: cups-driverd.c 5333 2006-03-24 00:52:21Z mike $"
*
* PPD/driver support for the Common UNIX Printing System (CUPS).
*
@@ -43,6 +43,14 @@
#include "util.h"
#include <cups/dir.h>
#include <cups/transcode.h>
/*
* Private PPD functions...
*/
extern cups_encoding_t _ppdGetEncoding(const char *name);
/*
@@ -641,7 +649,8 @@ load_ppds(const char *d, /* I - Actual directory */
line[256], /* Line from backend */
*ptr, /* Pointer into name */
name[128], /* Name of PPD file */
language[64], /* PPD language version */
lang_version[64], /* PPD LanguageVersion */
lang_encoding[64], /* PPD LanguageEncoding */
country[64], /* Country code */
manufacturer[256], /* Manufacturer */
make_model[256], /* Make and Model */
@@ -771,11 +780,12 @@ load_ppds(const char *d, /* I - Actual directory */
* Now read until we get the NickName field...
*/
model_name[0] = '\0';
nick_name[0] = '\0';
manufacturer[0] = '\0';
device_id[0] = '\0';
strcpy(language, "en");
model_name[0] = '\0';
nick_name[0] = '\0';
manufacturer[0] = '\0';
device_id[0] = '\0';
lang_encoding[0] = '\0';
strcpy(lang_version, "en");
while (cupsFileGets(fp, line, sizeof(line)) != NULL)
{
@@ -783,8 +793,10 @@ load_ppds(const char *d, /* I - Actual directory */
sscanf(line, "%*[^\"]\"%255[^\"]", manufacturer);
else if (!strncmp(line, "*ModelName:", 11))
sscanf(line, "%*[^\"]\"%127[^\"]", model_name);
else if (!strncmp(line, "*LanguageEncoding:", 18))
sscanf(line, "%*[^:]:%63s", lang_encoding);
else if (!strncmp(line, "*LanguageVersion:", 17))
sscanf(line, "%*[^:]:%63s", language);
sscanf(line, "%*[^:]:%63s", lang_version);
else if (!strncmp(line, "*NickName:", 10))
sscanf(line, "%*[^\"]\"%255[^\"]", nick_name);
else if (!strncmp(line, "*1284DeviceId:", 14))
@@ -812,7 +824,8 @@ load_ppds(const char *d, /* I - Actual directory */
*/
if (nick_name[0])
strcpy(make_model, nick_name);
cupsCharsetToUTF8((cups_utf8_t *)make_model, nick_name,
sizeof(make_model), _ppdGetEncoding(lang_encoding));
else
strcpy(make_model, model_name);
@@ -883,12 +896,12 @@ load_ppds(const char *d, /* I - Actual directory */
strcpy(manufacturer, "LHAG");
/*
* Fix the language as needed...
* Fix the lang_version as needed...
*/
if ((ptr = strchr(language, '-')) != NULL)
if ((ptr = strchr(lang_version, '-')) != NULL)
*ptr++ = '\0';
else if ((ptr = strchr(language, '_')) != NULL)
else if ((ptr = strchr(lang_version, '_')) != NULL)
*ptr++ = '\0';
if (ptr)
@@ -910,7 +923,7 @@ load_ppds(const char *d, /* I - Actual directory */
}
for (i = 0; i < (int)(sizeof(languages) / sizeof(languages[0])); i ++)
if (!strcasecmp(languages[i].version, language))
if (!strcasecmp(languages[i].version, lang_version))
break;
if (i < (int)(sizeof(languages) / sizeof(languages[0])))
@@ -919,8 +932,8 @@ load_ppds(const char *d, /* I - Actual directory */
* Found a known language...
*/
snprintf(language, sizeof(language), "%s%s", languages[i].language,
country);
snprintf(lang_version, sizeof(lang_version), "%s%s",
languages[i].language, country);
}
else
{
@@ -928,7 +941,7 @@ load_ppds(const char *d, /* I - Actual directory */
* Unknown language; use "xx"...
*/
strcpy(language, "xx");
strcpy(lang_version, "xx");
}
/*
@@ -945,7 +958,7 @@ load_ppds(const char *d, /* I - Actual directory */
fprintf(stderr, "DEBUG: [cups-driverd] Adding ppd \"%s\"...\n", name);
if (!add_ppd(name, language, manufacturer, make_model, device_id,
if (!add_ppd(name, lang_version, manufacturer, make_model, device_id,
dent->fileinfo.st_mtime, dent->fileinfo.st_size))
{
cupsDirClose(dir);
@@ -970,7 +983,7 @@ load_ppds(const char *d, /* I - Actual directory */
strlcpy(ppd->record.make, manufacturer, sizeof(ppd->record.make));
strlcpy(ppd->record.make_and_model, make_model,
sizeof(ppd->record.make_and_model));
strlcpy(ppd->record.natural_language, language,
strlcpy(ppd->record.natural_language, lang_version,
sizeof(ppd->record.natural_language));
strlcpy(ppd->record.device_id, device_id, sizeof(ppd->record.device_id));
}
@@ -1100,5 +1113,5 @@ load_drivers(void)
/*
* End of "$Id: cups-driverd.c 5130 2006-02-17 20:25:33Z mike $".
* End of "$Id: cups-driverd.c 5333 2006-03-24 00:52:21Z mike $".
*/
+4 -3
Ver Arquivo
@@ -1,5 +1,5 @@
/*
* "$Id: dirsvc.c 5305 2006-03-18 03:05:12Z mike $"
* "$Id: dirsvc.c 5330 2006-03-23 21:07:20Z mike $"
*
* Directory services routines for the Common UNIX Printing System (CUPS).
*
@@ -77,8 +77,9 @@ static void send_cups_browse(cupsd_printer_t *p);
#ifdef HAVE_LDAP
static void send_ldap_browse(cupsd_printer_t *p);
#endif /* HAVE_LDAP */
#ifdef HAVE_LIBSLP
static void send_slp_browse(cupsd_printer_t *p);
#endif /* HAVE_LIBSLP */
#ifdef HAVE_OPENLDAP
static const char * const ldap_attrs[] =/* CUPS LDAP attributes */
@@ -3115,5 +3116,5 @@ slp_url_callback(
/*
* End of "$Id: dirsvc.c 5305 2006-03-18 03:05:12Z mike $".
* End of "$Id: dirsvc.c 5330 2006-03-23 21:07:20Z mike $".
*/
+49 -22
Ver Arquivo
@@ -1,5 +1,5 @@
/*
* "$Id: ipp.c 5284 2006-03-13 13:34:24Z mike $"
* "$Id: ipp.c 5334 2006-03-24 01:20:03Z mike $"
*
* IPP routines for the Common UNIX Printing System (CUPS) scheduler.
*
@@ -126,7 +126,8 @@ static void add_class(cupsd_client_t *con, ipp_attribute_t *uri);
static int add_file(cupsd_client_t *con, cupsd_job_t *job,
mime_type_t *filetype, int compression);
static cupsd_job_t *add_job(cupsd_client_t *con, ipp_attribute_t *uri,
cupsd_printer_t **dprinter);
cupsd_printer_t **dprinter,
mime_type_t *filetype);
static void add_job_state_reasons(cupsd_client_t *con, cupsd_job_t *job);
static void add_job_subscriptions(cupsd_client_t *con, cupsd_job_t *job);
static void add_job_uuid(cupsd_client_t *con, cupsd_job_t *job);
@@ -1131,7 +1132,8 @@ add_file(cupsd_client_t *con, /* I - Connection to client */
static cupsd_job_t * /* O - Job object */
add_job(cupsd_client_t *con, /* I - Client connection */
ipp_attribute_t *uri, /* I - printer-uri */
cupsd_printer_t **dprinter) /* I - Destination printer */
cupsd_printer_t **dprinter, /* I - Destination printer */
mime_type_t *filetype) /* I - First print file type, if any */
{
http_status_t status; /* Policy status */
ipp_attribute_t *attr; /* Current attribute */
@@ -1219,9 +1221,29 @@ add_job(cupsd_client_t *con, /* I - Client connection */
}
/*
* Validate job template attributes; for now just copies and page-ranges...
* Validate job template attributes; for now just document-format,
* copies, and page-ranges...
*/
if (filetype && printer->filetypes &&
!cupsArrayFind(printer->filetypes, filetype))
{
char mimetype[MIME_MAX_SUPER + MIME_MAX_TYPE + 2];
/* MIME media type string */
snprintf(mimetype, sizeof(mimetype), "%s/%s", filetype->super,
filetype->type);
send_ipp_status(con, IPP_DOCUMENT_FORMAT,
_("Unsupported format \'%s\'!"), mimetype);
ippAddString(con->response, IPP_TAG_UNSUPPORTED_GROUP, IPP_TAG_MIMETYPE,
"document-format", NULL, mimetype);
return (NULL);
}
if ((attr = ippFindAttribute(con->request, "copies",
IPP_TAG_INTEGER)) != NULL)
{
@@ -1693,10 +1715,7 @@ add_job_state_reasons(
switch (job ? job->state_value : IPP_JOB_CANCELLED)
{
case IPP_JOB_PENDING :
if (job->dtype & CUPS_PRINTER_CLASS)
dest = cupsdFindClass(job->dest);
else
dest = cupsdFindPrinter(job->dest);
dest = cupsdFindDest(job->dest);
if (dest && dest->state == IPP_PRINTER_STOPPED)
ippAddString(con->response, IPP_TAG_JOB, IPP_TAG_KEYWORD,
@@ -3495,7 +3514,7 @@ copy_banner(cupsd_client_t *con, /* I - Client connection */
* Try the localized banner file under the subdirectory...
*/
strlcpy(attrname, con->request->attrs->next->values[0].string.text,
strlcpy(attrname, job->attrs->attrs->next->values[0].string.text,
sizeof(attrname));
if (strlen(attrname) > 2 && attrname[2] == '-')
{
@@ -4434,7 +4453,7 @@ create_job(cupsd_client_t *con, /* I - Client connection */
* Create the job object...
*/
if ((job = add_job(con, uri, NULL)) == NULL)
if ((job = add_job(con, uri, NULL, NULL)) == NULL)
return;
/*
@@ -6824,7 +6843,7 @@ print_job(cupsd_client_t *con, /* I - Client connection */
}
cupsdLogMessage(CUPSD_LOG_DEBUG, "print_job: request file type is %s/%s.",
filetype->super, filetype->type);
filetype->super, filetype->type);
/*
* Read any embedded job ticket info from PS files...
@@ -6838,7 +6857,7 @@ print_job(cupsd_client_t *con, /* I - Client connection */
* Create the job object...
*/
if ((job = add_job(con, uri, &printer)) == NULL)
if ((job = add_job(con, uri, &printer, filetype)) == NULL)
return;
/*
@@ -7846,6 +7865,22 @@ send_document(cupsd_client_t *con, /* I - Client connection */
return;
}
printer = cupsdFindDest(job->dest);
if (printer->filetypes && !cupsArrayFind(printer->filetypes, filetype))
{
snprintf(mimetype, sizeof(mimetype), "%s/%s", filetype->super,
filetype->type);
send_ipp_status(con, IPP_DOCUMENT_FORMAT,
_("Unsupported format \'%s\'!"), mimetype);
ippAddString(con->response, IPP_TAG_UNSUPPORTED_GROUP, IPP_TAG_MIMETYPE,
"document-format", NULL, mimetype);
return;
}
cupsdLogMessage(CUPSD_LOG_DEBUG,
"send_document: request file type is %s/%s.",
filetype->super, filetype->type);
@@ -7859,11 +7894,6 @@ send_document(cupsd_client_t *con, /* I - Client connection */
if (add_file(con, job, filetype, compression))
return;
if (job->dtype & CUPS_PRINTER_CLASS)
printer = cupsdFindClass(job->dest);
else
printer = cupsdFindPrinter(job->dest);
if (stat(con->filename, &fileinfo))
kbytes = 0;
else
@@ -9099,10 +9129,7 @@ validate_user(cupsd_job_t *job, /* I - Job */
* Check the username against the owner...
*/
if (job->dtype & CUPS_PRINTER_CLASS)
printer = cupsdFindClass(job->dest);
else
printer = cupsdFindPrinter(job->dest);
printer = cupsdFindDest(job->dest);
return (cupsdCheckPolicy(printer ? printer->op_policy_ptr : DefaultPolicyPtr,
con, owner) == HTTP_OK);
@@ -9110,5 +9137,5 @@ validate_user(cupsd_job_t *job, /* I - Job */
/*
* End of "$Id: ipp.c 5284 2006-03-13 13:34:24Z mike $".
* End of "$Id: ipp.c 5334 2006-03-24 01:20:03Z mike $".
*/
+24 -25
Ver Arquivo
@@ -1,5 +1,5 @@
/*
* "$Id: printers.c 5305 2006-03-18 03:05:12Z mike $"
* "$Id: printers.c 5330 2006-03-23 21:07:20Z mike $"
*
* Printer routines for the Common UNIX Printing System (CUPS).
*
@@ -721,6 +721,8 @@ cupsdDeletePrinter(
cupsdClearString(&p->op_policy);
cupsdClearString(&p->error_policy);
cupsArrayDelete(p->filetypes);
if (p->browse_attrs)
free(p->browse_attrs);
@@ -2882,8 +2884,7 @@ add_printer_formats(cupsd_printer_t *p) /* I - Printer */
int i; /* Looping var */
mime_type_t *type; /* Current MIME type */
cups_array_t *filters; /* Filters */
int num_types; /* Number of supported types */
const char **types; /* Array of supported type names */
ipp_attribute_t *attr; /* document-format-supported attribute */
char mimetype[MIME_MAX_SUPER + MIME_MAX_TYPE + 2];
/* MIME type name */
@@ -2893,6 +2894,9 @@ add_printer_formats(cupsd_printer_t *p) /* I - Printer */
* types...
*/
cupsArrayDelete(p->filetypes);
p->filetypes = NULL;
if (p->raw)
{
ippAddStrings(p->attrs, IPP_TAG_PRINTER,
@@ -2906,20 +2910,12 @@ add_printer_formats(cupsd_printer_t *p) /* I - Printer */
* are filters for them...
*/
if ((types = calloc(NumMimeTypes, sizeof(char *))) == NULL)
{
cupsdLogMessage(CUPSD_LOG_EMERG,
"Unable to allocate memory for \"%s\" MIME type list!",
p->name);
return;
}
cupsdLogMessage(CUPSD_LOG_DEBUG2, "add_printer_formats: %d types, %d filters",
mimeNumTypes(MimeDatabase), mimeNumFilters(MimeDatabase));
types[0] = _cupsStrAlloc("application/octet-stream");
p->filetypes = cupsArrayNew(NULL, NULL);
for (num_types = 1, type = mimeFirstType(MimeDatabase);
for (type = mimeFirstType(MimeDatabase);
type;
type = mimeNextType(MimeDatabase))
{
@@ -2936,8 +2932,7 @@ add_printer_formats(cupsd_printer_t *p) /* I - Printer */
p->name, mimetype, cupsArrayCount(filters));
cupsArrayDelete(filters);
types[num_types] = _cupsStrAlloc(mimetype);
num_types ++;
cupsArrayAdd(p->filetypes, type);
}
else
cupsdLogMessage(CUPSD_LOG_DEBUG2,
@@ -2947,23 +2942,27 @@ add_printer_formats(cupsd_printer_t *p) /* I - Printer */
cupsdLogMessage(CUPSD_LOG_DEBUG2,
"add_printer_formats: %s: %d supported types",
p->name, num_types);
p->name, cupsArrayCount(p->filetypes) + 1);
/*
* Add the file formats that can be filtered...
*/
ippAddStrings(p->attrs, IPP_TAG_PRINTER, IPP_TAG_MIMETYPE,
"document-format-supported", num_types, NULL, types);
/*
* Free the temporary data...
*/
attr = ippAddStrings(p->attrs, IPP_TAG_PRINTER, IPP_TAG_MIMETYPE,
"document-format-supported",
cupsArrayCount(p->filetypes) + 1, NULL, NULL);
for (i = 0; i < num_types; i ++)
_cupsStrFree(types[i]);
attr->values[0].string.text = _cupsStrAlloc("application/octet-stream");
free(types);
for (i = 1, type = (mime_type_t *)cupsArrayFirst(p->filetypes);
type;
i ++, type = (mime_type_t *)cupsArrayNext(p->filetypes))
{
snprintf(mimetype, sizeof(mimetype), "%s/%s", type->super, type->type);
attr->values[i].string.text = _cupsStrAlloc(mimetype);
}
}
@@ -3274,5 +3273,5 @@ write_irix_state(cupsd_printer_t *p) /* I - Printer to update */
/*
* End of "$Id: printers.c 5305 2006-03-18 03:05:12Z mike $".
* End of "$Id: printers.c 5330 2006-03-23 21:07:20Z mike $".
*/
+3 -2
Ver Arquivo
@@ -1,5 +1,5 @@
/*
* "$Id: printers.h 5305 2006-03-18 03:05:12Z mike $"
* "$Id: printers.h 5330 2006-03-23 21:07:20Z mike $"
*
* Printer definitions for the Common UNIX Printing System (CUPS) scheduler.
*
@@ -67,6 +67,7 @@ typedef struct cupsd_printer_s
char *port_monitor; /* Port monitor */
int raw; /* Raw queue? */
mime_type_t *filetype; /* Pseudo-filetype for printer */
cups_array_t *filetypes; /* Supported file types */
void *job; /* Current job in queue */
ipp_t *attrs; /* Attributes supported by this printer */
int num_printers, /* Number of printers in class */
@@ -145,5 +146,5 @@ extern char *cupsdSanitizeURI(const char *uri, char *buffer,
/*
* End of "$Id: printers.h 5305 2006-03-18 03:05:12Z mike $".
* End of "$Id: printers.h 5330 2006-03-23 21:07:20Z mike $".
*/
+2 -2
Ver Arquivo
@@ -100,8 +100,8 @@ phpcups.so: $(OBJS) ../../Makedefs
else \
DSOFLAGS="$(DSOFLAGS)"; \
fi; \
echo $(DSO) $$DSOFLAGS -o $@ $(OBJS) -L../../cups $(LIBS); \
$(DSO) $$DSOFLAGS -o $@ $(OBJS) -L../../cups $(LIBS)
echo $(DSO) $$DSOFLAGS $(ARCHFLAGS) -o $@ $(OBJS) -L../../cups $(LIBS); \
$(DSO) $$DSOFLAGS $(ARCHFLAGS) -o $@ $(OBJS) -L../../cups $(LIBS)
#
+20 -7
Ver Arquivo
@@ -3,34 +3,47 @@
accept.o: ../cups/string.h ../config.h ../cups/cups.h ../cups/ipp.h
accept.o: ../cups/http.h ../cups/md5.h ../cups/ppd.h ../cups/array.h
accept.o: ../cups/file.h ../cups/language.h ../cups/i18n.h
accept.o: ../cups/transcode.h
cancel.o: ../cups/string.h ../config.h ../cups/cups.h ../cups/ipp.h
cancel.o: ../cups/http.h ../cups/md5.h ../cups/ppd.h ../cups/array.h
cancel.o: ../cups/file.h ../cups/language.h ../cups/i18n.h
cancel.o: ../cups/transcode.h
cupsaddsmb.o: ../cups/string.h ../config.h ../cups/adminutil.h ../cups/cups.h
cupsaddsmb.o: ../cups/ipp.h ../cups/http.h ../cups/md5.h ../cups/ppd.h
cupsaddsmb.o: ../cups/array.h ../cups/file.h ../cups/language.h
cupsaddsmb.o: ../cups/i18n.h ../cups/debug.h
cupsaddsmb.o: ../cups/i18n.h ../cups/transcode.h ../cups/debug.h
cupstestdsc.o: ../cups/string.h ../config.h ../cups/cups.h ../cups/ipp.h
cupstestdsc.o: ../cups/http.h ../cups/md5.h ../cups/ppd.h ../cups/array.h
cupstestdsc.o: ../cups/file.h ../cups/language.h ../cups/file.h
cupstestdsc.o: ../cups/i18n.h ../cups/transcode.h
cupstestppd.o: ../cups/string.h ../config.h ../cups/cups.h ../cups/ipp.h
cupstestppd.o: ../cups/http.h ../cups/md5.h ../cups/ppd.h ../cups/array.h
cupstestppd.o: ../cups/file.h ../cups/language.h ../cups/i18n.h
cupstestppd.o: ../cups/transcode.h
lp.o: ../cups/string.h ../config.h ../cups/cups.h ../cups/ipp.h
lp.o: ../cups/http.h ../cups/md5.h ../cups/ppd.h ../cups/array.h
lp.o: ../cups/file.h ../cups/language.h ../cups/i18n.h
lp.o: ../cups/file.h ../cups/language.h ../cups/i18n.h ../cups/transcode.h
lpadmin.o: ../cups/string.h ../config.h ../cups/cups.h ../cups/ipp.h
lpadmin.o: ../cups/http.h ../cups/md5.h ../cups/ppd.h ../cups/array.h
lpadmin.o: ../cups/file.h ../cups/language.h ../cups/i18n.h ../cups/debug.h
lpadmin.o: ../cups/file.h ../cups/language.h ../cups/i18n.h
lpadmin.o: ../cups/transcode.h ../cups/debug.h
lpinfo.o: ../cups/string.h ../config.h ../cups/cups.h ../cups/ipp.h
lpinfo.o: ../cups/http.h ../cups/md5.h ../cups/ppd.h ../cups/array.h
lpinfo.o: ../cups/file.h ../cups/language.h ../cups/i18n.h ../cups/debug.h
lpinfo.o: ../cups/file.h ../cups/language.h ../cups/i18n.h
lpinfo.o: ../cups/transcode.h ../cups/debug.h
lpmove.o: ../cups/string.h ../config.h ../cups/cups.h ../cups/ipp.h
lpmove.o: ../cups/http.h ../cups/md5.h ../cups/ppd.h ../cups/array.h
lpmove.o: ../cups/file.h ../cups/language.h ../cups/i18n.h ../cups/debug.h
lpmove.o: ../cups/file.h ../cups/language.h ../cups/i18n.h
lpmove.o: ../cups/transcode.h ../cups/debug.h
lpoptions.o: ../cups/string.h ../config.h ../cups/cups.h ../cups/ipp.h
lpoptions.o: ../cups/http.h ../cups/md5.h ../cups/ppd.h ../cups/array.h
lpoptions.o: ../cups/file.h ../cups/language.h ../cups/i18n.h
lpoptions.o: ../cups/transcode.h
lppasswd.o: ../cups/string.h ../config.h ../cups/cups.h ../cups/ipp.h
lppasswd.o: ../cups/http.h ../cups/md5.h ../cups/ppd.h ../cups/array.h
lppasswd.o: ../cups/file.h ../cups/language.h ../cups/i18n.h ../cups/md5.h
lppasswd.o: ../cups/file.h ../cups/language.h ../cups/i18n.h
lppasswd.o: ../cups/transcode.h ../cups/md5.h
lpstat.o: ../cups/string.h ../config.h ../cups/cups.h ../cups/ipp.h
lpstat.o: ../cups/http.h ../cups/md5.h ../cups/ppd.h ../cups/array.h
lpstat.o: ../cups/file.h ../cups/language.h ../cups/i18n.h ../cups/debug.h
lpstat.o: ../cups/file.h ../cups/language.h ../cups/i18n.h
lpstat.o: ../cups/transcode.h ../cups/debug.h
+17 -6
Ver Arquivo
@@ -1,5 +1,5 @@
#
# "$Id: Makefile 5229 2006-03-05 16:48:12Z mike $"
# "$Id: Makefile 5317 2006-03-21 02:35:37Z mike $"
#
# System V commands makefile for the Common UNIX Printing System (CUPS).
#
@@ -24,10 +24,10 @@
include ../Makedefs
TARGETS = accept cancel cupsaddsmb cupstestppd lp lpadmin lpinfo \
lpmove lpoptions lppasswd lpstat
OBJS = accept.o cancel.o cupsaddsmb.o cupstestppd.o lp.o \
lpadmin.o lpinfo.o lpmove.o lpoptions.o lppasswd.o \
TARGETS = accept cancel cupsaddsmb cupstestdsc cupstestppd \
lp lpadmin lpinfo lpmove lpoptions lppasswd lpstat
OBJS = accept.o cancel.o cupsaddsmb.o cupstestdsc.o cupstestppd.o \
lp.o lpadmin.o lpinfo.o lpmove.o lpoptions.o lppasswd.o \
lpstat.o
@@ -69,6 +69,7 @@ install: all
$(INSTALL_BIN) lpmove $(SBINDIR)
$(INSTALL_DIR) -m 755 $(BINDIR)
$(INSTALL_BIN) cancel $(BINDIR)
$(INSTALL_BIN) cupstestdsc $(BINDIR)
$(INSTALL_BIN) cupstestppd $(BINDIR)
$(RM) $(SBINDIR)/cupsdisable
$(LN) accept $(SBINDIR)/cupsdisable
@@ -86,6 +87,7 @@ install: all
uninstall:
$(RM) $(BINDIR)/cancel
$(RM) $(BINDIR)/cupstestdsc
$(RM) $(BINDIR)/cupstestppd
$(RM) $(BINDIR)/lp
$(RM) $(BINDIR)/lpoptions
@@ -134,6 +136,15 @@ cupsaddsmb: cupsaddsmb.o ../cups/$(LIBCUPS)
$(CC) $(LDFLAGS) -o cupsaddsmb cupsaddsmb.o $(LIBS)
#
# cupstestdsc
#
cupstestdsc: cupstestdsc.o ../cups/$(LIBCUPS)
echo Linking $@...
$(CC) $(LDFLAGS) -o $@ cupstestdsc.o $(LIBS)
#
# cupstestppd
#
@@ -214,5 +225,5 @@ include Dependencies
#
# End of "$Id: Makefile 5229 2006-03-05 16:48:12Z mike $".
# End of "$Id: Makefile 5317 2006-03-21 02:35:37Z mike $".
#
+447
Ver Arquivo
@@ -0,0 +1,447 @@
/*
* "$Id: cupstestdsc.c 5320 2006-03-21 19:03:25Z mike $"
*
* DSC test program for the Common UNIX Printing System (CUPS).
*
* Copyright 2006 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
* copyright law. Distribution and use rights are outlined in the file
* "LICENSE.txt" which should have been included with this file. If this
* file is missing or damaged please contact Easy Software Products
* at:
*
* Attn: CUPS Licensing Information
* Easy Software Products
* 44141 Airport View Drive, Suite 204
* Hollywood, Maryland 20636 USA
*
* Voice: (301) 373-9600
* EMail: cups-info@cups.org
* WWW: http://www.cups.org
*
* PostScript is a trademark of Adobe Systems, Inc.
*
* This file is subject to the Apple OS-Developed Software exception.
*
* Contents:
*
*/
/*
* Include necessary headers...
*/
#include <cups/string.h>
#include <cups/cups.h>
#include <cups/file.h>
#include <cups/i18n.h>
#include <errno.h>
#include <stdlib.h>
/*
* Local functions...
*/
static int check_file(const char *filename);
static void usage(void);
/*
* 'main()' - Main entry for test program.
*/
int /* O - Exit status */
main(int argc, /* I - Number of command-line args */
char *argv[]) /* I - Command-line arguments */
{
int i; /* Looping var */
int status; /* Status of tests */
int num_files; /* Number of files tested */
/*
* Collect command-line arguments...
*/
for (i = 1, num_files = 0, status = 0; i < argc; i ++)
if (argv[i][0] == '-')
{
if (argv[i][1])
{
/*
* Currently the only supported option is "-h" (help)...
*/
usage();
}
else
{
num_files ++;
status += check_file("(stdin)");
}
}
else
{
num_files ++;
status += check_file(argv[i]);
}
if (!num_files)
usage();
return (status);
}
/*
* 'check()' - Main entry for test program.
*/
static int /* O - 0 on success, 1 on failure */
check_file(const char *filename) /* I - File to read from */
{
int i; /* Looping var */
cups_file_t *fp; /* File */
char line[1024]; /* Line from file */
int ch; /* Current character */
size_t bytes; /* Length of line */
int status; /* Status of test */
int linenum; /* Line number */
int binary; /* File contains binary data? */
float version; /* DSC version */
int lbrt[4]; /* Bounding box */
char page_label[256]; /* Page label string */
int page_number; /* Page number */
int level; /* Embedded document level */
int saw_bounding_box, /* %%BoundingBox seen? */
saw_pages, /* %%Pages seen? */
saw_end_comments, /* %%EndComments seen? */
saw_begin_prolog, /* %%BeginProlog seen? */
saw_end_prolog, /* %%EndProlog seen? */
saw_begin_setup, /* %%BeginSetup seen? */
saw_end_setup, /* %%EndSetup seen? */
saw_page, /* %%Page seen? */
saw_trailer, /* %%Trailer seen? */
saw_eof, /* %%EOF seen? */
saw_long_line; /* Saw long lines? */
/*
* Open the file...
*/
if (!strcmp(filename, "(stdin)"))
fp = cupsFileStdin();
else
fp = cupsFileOpen(filename, "r");
if (!fp)
{
perror(filename);
return (1);
}
/*
* Scan the file...
*/
binary = 0;
level = 0;
linenum = 0;
saw_begin_prolog = 0;
saw_begin_setup = 0;
saw_bounding_box = 0;
saw_end_comments = 0;
saw_end_prolog = 0;
saw_end_setup = 0;
saw_eof = 0;
saw_long_line = 0;
saw_page = 0;
saw_pages = 0;
saw_trailer = 0;
status = 0;
version = 0.0f;
_cupsLangPrintf(stdout, "%s: ", filename);
fflush(stdout);
while ((bytes = cupsFileGetLine(fp, line, sizeof(line))) > 0)
{
linenum ++;
if (bytes > 255)
{
if (!saw_long_line)
{
if (!status)
_cupsLangPuts(stdout, _("FAIL\n"));
status ++;
_cupsLangPrintf(stdout,
_(" Line %d is longer than 255 characters (%d)!\n"
" REF: Page 25, Line Length\n"),
linenum, (int)bytes);
}
saw_long_line ++;
}
if (linenum == 1)
{
if (strncmp(line, "%!PS-Adobe-", 11))
{
if (!status)
_cupsLangPuts(stdout, _("FAIL\n"));
status ++;
_cupsLangPuts(stdout,
_(" Missing %!PS-Adobe-3.0 on first line!\n"
" REF: Page 17, 3.1 Conforming Documents\n"));
cupsFileClose(fp);
return (1);
}
else
version = atof(line + 11);
}
else if (level > 0)
{
if (!strncmp(line, "%%BeginDocument:", 16))
level ++;
else if (!strncmp(line, "%%EndDocument", 13))
level --;
}
else if (saw_trailer)
{
if (!strncmp(line, "%%Pages:", 8))
{
if (atoi(line + 8) <= 0)
{
if (!status)
_cupsLangPuts(stdout, _("FAIL\n"));
status ++;
_cupsLangPrintf(stdout,
_(" Bad %%%%Pages: on line %d!\n"
" REF: Page 43, %%%%Pages:\n"),
linenum);
}
else
saw_pages = 1;
}
else if (!strncmp(line, "%%BoundingBox:", 14))
{
if (sscanf(line + 14, "%d%d%d%d", lbrt + 0, lbrt + 1, lbrt + 2,
lbrt + 3) != 4)
{
if (!status)
_cupsLangPuts(stdout, _("FAIL\n"));
status ++;
_cupsLangPrintf(stdout, _(" Bad %%%%BoundingBox: on line %d!\n"
" REF: Page 39, %%%%BoundingBox:\n"),
linenum);
}
else
saw_bounding_box = 1;
}
}
else if (!saw_end_comments)
{
if (!strncmp(line, "%%EndComments", 13))
saw_end_comments = 1;
else if (line[0] != '%')
saw_end_comments = -1;
else if (!strncmp(line, "%%Pages:", 8))
{
if (strstr(line + 8, "(atend)"))
saw_pages = -1;
else if (atoi(line + 8) <= 0)
{
if (!status)
_cupsLangPuts(stdout, _("FAIL\n"));
status ++;
_cupsLangPrintf(stdout, _(" Bad %%%%Pages: on line %d!\n"
" REF: Page 43, %%%%Pages:\n"),
linenum);
}
else
saw_pages = 1;
}
else if (!strncmp(line, "%%BoundingBox:", 14))
{
if (strstr(line, "(atend)"))
saw_bounding_box = -1;
else if (sscanf(line + 14, "%d%d%d%d", lbrt + 0, lbrt + 1, lbrt + 2,
lbrt + 3) != 4)
{
if (!status)
_cupsLangPuts(stdout, _("FAIL\n"));
status ++;
_cupsLangPrintf(stdout, _(" Bad %%%%BoundingBox: on line %d!\n"
" REF: Page 39, %%%%BoundingBox:\n"),
linenum);
}
else
saw_bounding_box = 1;
}
}
else if (saw_begin_prolog && !saw_end_prolog)
{
if (!strncmp(line, "%%EndProlog", 11))
saw_end_prolog = 1;
}
else if (saw_begin_setup && !saw_end_setup)
{
if (!strncmp(line, "%%EndSetup", 10))
saw_end_setup = 1;
}
else if (saw_end_comments)
{
if (!strncmp(line, "%%Page:", 7))
{
if (sscanf(line + 7, "%255s%d", page_label, &page_number) != 2)
{
if (!status)
_cupsLangPuts(stdout, _("FAIL\n"));
status ++;
_cupsLangPrintf(stdout, _(" Bad %%%%Page: on line %d!\n"
" REF: Page 53, %%%%Page:\n"),
linenum);
}
else
saw_page = 1;
}
else if (!strncmp(line, "%%BeginProlog", 13))
saw_begin_prolog = 1;
else if (!strncmp(line, "%%BeginSetup", 12))
saw_begin_setup = 1;
else if (!strncmp(line, "%%BeginDocument:", 16))
level ++;
else if (!strncmp(line, "%%EndDocument", 13))
level --;
else if (!strncmp(line, "%%Trailer", 9))
saw_trailer = 1;
}
for (i = 0; !binary && i < bytes; i ++)
{
ch = line[i];
if ((ch < ' ' || (ch & 0x80)) && ch != '\n' && ch != '\r' && ch != '\t')
binary = 1;
}
}
if (saw_bounding_box <= 0)
{
if (!status)
_cupsLangPuts(stdout, _("FAIL\n"));
status ++;
_cupsLangPuts(stdout, _(" Missing or bad %%BoundingBox: comment!\n"
" REF: Page 39, %%BoundingBox:\n"));
}
if (saw_pages <= 0)
{
if (!status)
_cupsLangPuts(stdout, _("FAIL\n"));
status ++;
_cupsLangPuts(stdout, _(" Missing or bad %%Pages: comment!\n"
" REF: Page 43, %%Pages:\n"));
}
if (!saw_end_comments)
{
if (!status)
_cupsLangPuts(stdout, _("FAIL\n"));
status ++;
_cupsLangPuts(stdout, _(" Missing %%EndComments comment!\n"
" REF: Page 41, %%EndComments\n"));
}
if (!saw_page)
{
if (!status)
_cupsLangPuts(stdout, _("FAIL\n"));
status ++;
_cupsLangPuts(stdout, _(" Missing or bad %%Page: comments!\n"
" REF: Page 53, %%Page:\n"));
}
if (level < 0)
{
if (!status)
_cupsLangPuts(stdout, _("FAIL\n"));
status ++;
_cupsLangPuts(stdout, _(" Too many %%EndDocument comments!\n"));
}
else if (level > 0)
{
if (!status)
_cupsLangPuts(stdout, _("FAIL\n"));
status ++;
_cupsLangPuts(stdout, _(" Too many %%BeginDocument comments!\n"));
}
if (saw_long_line > 1)
_cupsLangPrintf(stderr,
_(" Saw %d lines that exceeded 255 characters!\n"),
saw_long_line);
if (!status)
_cupsLangPuts(stdout, _("PASS\n"));
if (binary)
_cupsLangPuts(stdout, _(" Warning: file contains binary data!\n"));
if (version < 3.0f)
_cupsLangPrintf(stdout,
_(" Warning: obsolete DSC version %.1f in file!\n"),
version);
if (saw_end_comments < 0)
_cupsLangPuts(stdout, _(" Warning: no %%EndComments comment in file!\n"));
cupsFileClose(fp);
return (status);
}
/*
* 'usage()' - Show program usage.
*/
static void
usage(void)
{
_cupsLangPuts(stdout,
_("Usage: cupstestdsc [options] filename.ps [... filename.ps]\n"
" cupstestdsc [options] -\n"
"\n"
"Options:\n"
"\n"
" -h Show program usage\n"
"\n"
" Note: this program only validates the DSC comments, "
"not the PostScript itself.\n"));
exit(1);
}
/*
* End of "$Id: cupstestdsc.c 5320 2006-03-21 19:03:25Z mike $".
*/
+7 -5
Ver Arquivo
@@ -1,5 +1,5 @@
/*
* "$Id: lpstat.c 5199 2006-02-27 22:01:02Z mike $"
* "$Id: lpstat.c 5331 2006-03-23 21:21:19Z mike $"
*
* "lpstat" command for the Common UNIX Printing System (CUPS).
*
@@ -84,9 +84,11 @@ main(int argc, /* I - Number of command-line arguments */
char op; /* Last operation on command-line */
#ifdef LC_TIME
setlocale(LC_TIME, "");
#endif /* LC_TIME */
/*
* Set the locale so that times, etc. are displayed properly.
*/
setlocale(LC_ALL, "");
http = NULL;
num_dests = 0;
@@ -2246,5 +2248,5 @@ show_scheduler(http_t *http) /* I - HTTP connection to server */
/*
* End of "$Id: lpstat.c 5199 2006-02-27 22:01:02Z mike $".
* End of "$Id: lpstat.c 5331 2006-03-23 21:21:19Z mike $".
*/