CHANGES IN CUPS V1.3.10
- - Documentation fixes (STR #2994, STR #2995, STR #3008)
+ - Documentation fixes (STR #2994, STR #2995, STR #3008, STR #3056)
+ - The web interface sometimes incorrectly redirected users to
+ 127.0.0.1 (STR #3022)
+ - cupsPrintFile*() did not send the document filename for single
+ file submissions (STR #3055)
+ - The scheduler did not update the member-names attribute when
+ removing the last printer from a class.
+ - The scheduler did not report PPD Products with parenthesis
+ in them properly (STR #3046)
- The wrong italic fonts were listed in the UTF-8 charset file
for the text filter.
- The backends did not return an OK status for the
-CHANGES.txt - 2008-12-15
+CHANGES.txt - 2009-01-09
------------------------
+CHANGES IN CUPS V1.4b3
+
+ - CUPS now conforms to the draft IPP/2.0 and IPP/2.1 specification.
+ - Fixed build problems (STR #3040, STR #3047)
+ - cupsResolveConflicts() did not resolve using the default option
+ choice in some cases due to the mirror UIConstraints that are
+ present in most PPD files.
+ - The scheduler did not honor MIME type priorities.
+ - The commandtops filter incorrectly used the JCLBegin code to end
+ its jobs.
+ - The default BrowseLocalProtocols value was not set properly.
+ - Since the commandtops filter does not actually support ReportLevels
+ all on its own, don't list that printer command by default for PS
+ printers.
+ - The scheduler did not give filters a chance to log errors or update
+ printer attributes when a job was canceled.
+ - The scheduler did not clear the "connecting-to-device" reason keyword
+ when a job finished.
+
+
CHANGES IN CUPS V1.4b2
- Documentation updates (STR #2983, STR #2998, STR #3021)
#
# Common makefile definitions for the Common UNIX Printing System (CUPS).
#
-# Copyright 2007-2008 by Apple Inc.
+# Copyright 2007-2009 by Apple Inc.
# Copyright 1997-2007 by Easy Software Products, all rights reserved.
#
# These coded instructions, statements, and computer programs are the
LEGACY_BACKENDS = @LEGACY_BACKENDS@
LIBCUPSORDER = @LIBCUPSORDER@
LIBCUPSIMAGEORDER = @LIBCUPSIMAGEORDER@
-LINKCUPS = @LINKCUPS@ $(SSLLIBS)
+LINKCUPS = @LINKCUPS@ $(SSLLIBS) $(DNSSDLIBS)
LINKCUPSIMAGE = @LINKCUPSIMAGE@
LIBS = $(LINKCUPS) $(COMMONLIBS)
OPTIM = @OPTIM@
-README - CUPS v1.4b2 - 2008-12-15
+README - CUPS v1.4b2 - 2009-01-07
---------------------------------
**********************************************************************
LEGAL STUFF
- CUPS is Copyright 2007-2008 by Apple Inc. CUPS, the CUPS logo, and the
+ CUPS is Copyright 2007-2009 by Apple Inc. CUPS, the CUPS logo, and the
Common UNIX Printing System are trademarks of Apple Inc.
The MD5 Digest code is Copyright 1999 Aladdin Enterprises.
#
# Backend makefile for the Common UNIX Printing System (CUPS).
#
-# Copyright 2007-2008 by Apple Inc.
+# Copyright 2007-2009 by Apple Inc.
# Copyright 1997-2007 by Easy Software Products, all rights reserved.
#
# These coded instructions, statements, and computer programs are the
test1284: test1284.o ../cups/libcups.a
echo Linking $@...
$(CC) $(LDFLAGS) -o test1284 test1284.o ../cups/libcups.a \
- $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
+ $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
#
testbackend: testbackend.o ../cups/libcups.a
echo Linking $@...
$(CC) $(LDFLAGS) -o testbackend testbackend.o ../cups/libcups.a \
- $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
+ $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
#
testsupplies: testsupplies.o libbackend.a ../cups/libcups.a
echo Linking $@...
$(CC) $(LDFLAGS) -o testsupplies testsupplies.o libbackend.a \
- ../cups/libcups.a $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
+ ../cups/libcups.a $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) \
+ $(COMMONLIBS) $(LIBZ)
#
*
* IPP backend for the Common UNIX Printing System (CUPS).
*
- * Copyright 2007-2008 by Apple Inc.
+ * Copyright 2007-2009 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
*/
compression = 0;
- version = 1;
+ version = 11;
waitjob = 1;
waitprinter = 1;
contimeout = 7 * 24 * 60 * 60;
else if (!strcasecmp(name, "version"))
{
if (!strcmp(value, "1.0"))
- version = 0;
+ version = 10;
else if (!strcmp(value, "1.1"))
- version = 1;
+ version = 11;
+ else if (!strcmp(value, "2.0"))
+ version = 20;
+ else if (!strcmp(value, "2.1"))
+ version = 21;
else
{
_cupsLangPrintf(stderr,
*/
request = ippNewRequest(IPP_GET_PRINTER_ATTRIBUTES);
- request->request.op.version[1] = version;
+ request->request.op.version[0] = version / 10;
+ request->request.op.version[1] = version % 10;
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri",
NULL, uri);
delay += 5;
}
else if ((ipp_status == IPP_BAD_REQUEST ||
- ipp_status == IPP_VERSION_NOT_SUPPORTED) && version == 1)
+ ipp_status == IPP_VERSION_NOT_SUPPORTED) && version > 10)
{
/*
* Switch to IPP/1.0...
*/
- _cupsLangPuts(stderr,
- _("INFO: Printer does not support IPP/1.1, trying "
- "IPP/1.0...\n"));
- version = 0;
+ _cupsLangPrintf(stderr,
+ _("INFO: Printer does not support IPP/%d.%d, trying "
+ "IPP/1.0...\n"), version / 10, version % 10);
+ version = 10;
httpReconnect(http);
}
else if (ipp_status == IPP_NOT_FOUND)
else
request = ippNewRequest(IPP_PRINT_JOB);
- request->request.op.version[1] = version;
+ request->request.op.version[0] = version / 10;
+ request->request.op.version[1] = version % 10;
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri",
NULL, uri);
"document-format", NULL, final_content_type);
}
- if (copies_sup && version > 0 && send_options)
+ if (copies_sup && version > 10 && send_options)
{
/*
* Only send options if the destination printer supports the copies
sleep(10);
}
else if ((ipp_status == IPP_BAD_REQUEST ||
- ipp_status == IPP_VERSION_NOT_SUPPORTED) && version == 1)
+ ipp_status == IPP_VERSION_NOT_SUPPORTED) && version > 10)
{
/*
* Switch to IPP/1.0...
*/
- _cupsLangPuts(stderr,
- _("INFO: Printer does not support IPP/1.1, trying "
- "IPP/1.0...\n"));
- version = 0;
+ _cupsLangPrintf(stderr,
+ _("INFO: Printer does not support IPP/%d.%d, trying "
+ "IPP/1.0...\n"), version / 10, version % 10);
+ version = 10;
httpReconnect(http);
}
else
*/
request = ippNewRequest(IPP_SEND_DOCUMENT);
-
- request->request.op.version[1] = version;
+ request->request.op.version[0] = version / 10;
+ request->request.op.version[1] = version % 10;
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri",
NULL, uri);
*/
request = ippNewRequest(IPP_GET_JOB_ATTRIBUTES);
- request->request.op.version[1] = version;
+ request->request.op.version[0] = version / 10;
+ request->request.op.version[1] = version % 10;
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri",
NULL, uri);
_cupsLangPuts(stderr, _("INFO: Canceling print job...\n"));
request = ippNewRequest(IPP_CANCEL_JOB);
- request->request.op.version[1] = version;
+ request->request.op.version[0] = version / 10;
+ request->request.op.version[1] = version % 10;
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri",
NULL, uri);
*/
request = ippNewRequest(IPP_GET_PRINTER_ATTRIBUTES);
- request->request.op.version[1] = version;
+ request->request.op.version[0] = version / 10;
+ request->request.op.version[1] = version % 10;
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri",
NULL, uri);
#
# CGI makefile for the Common UNIX Printing System (CUPS).
#
-# Copyright 2007-2008 by Apple Inc.
+# Copyright 2007-2009 by Apple Inc.
# Copyright 1997-2006 by Easy Software Products.
#
# These coded instructions, statements, and computer programs are the
testcgi: testcgi.o ../Makedefs libcupscgi.a ../cups/libcups.a
echo Linking $@...
$(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testcgi.o libcupscgi.a \
- ../cups/libcups.a $(COMMONLIBS) $(SSLLIBS) $(LIBZ) $(LIBGSSAPI)
+ ../cups/libcups.a $(COMMONLIBS) $(SSLLIBS) $(DNSSDLIBS) \
+ $(LIBZ) $(LIBGSSAPI)
echo Testing CGI API...
./testcgi
testhi: testhi.o ../Makedefs libcupscgi.a ../cups/libcups.a
echo Linking $@...
$(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testhi.o libcupscgi.a \
- ../cups/libcups.a $(COMMONLIBS) $(SSLLIBS) $(LIBZ) $(LIBGSSAPI)
+ ../cups/libcups.a $(COMMONLIBS) $(SSLLIBS) $(DNSSDLIBS) \
+ $(LIBZ) $(LIBGSSAPI)
echo Testing help index API...
./testhi
testtemplate: testtemplate.o ../Makedefs libcupscgi.a ../cups/libcups.a
echo Linking $@...
$(CC) $(LDFLAGS) -o $@ testtemplate.o libcupscgi.a ../cups/libcups.a \
- $(COMMONLIBS) $(SSLLIBS) $(LIBZ) $(LIBGSSAPI)
+ $(COMMONLIBS) $(SSLLIBS) $(DNSSDLIBS) $(LIBZ) $(LIBGSSAPI)
#
websearch: websearch.o ../Makedefs libcupscgi.a ../cups/libcups.a
echo Linking $@...
$(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ websearch.o libcupscgi.a \
- ../cups/libcups.a $(COMMONLIBS) $(SSLLIBS) $(LIBZ) $(LIBGSSAPI)
+ ../cups/libcups.a $(COMMONLIBS) $(SSLLIBS) $(DNSSDLIBS) \
+ $(LIBZ) $(LIBGSSAPI)
#
int urlsize, /* I - Size of URL buffer */
const char *newresource) /* I - Replacement resource */
{
- char method[HTTP_MAX_URI],
+ char scheme[HTTP_MAX_URI],
userpass[HTTP_MAX_URI],
hostname[HTTP_MAX_URI],
rawresource[HTTP_MAX_URI],
* Convert the URI to a URL...
*/
- httpSeparateURI(HTTP_URI_CODING_ALL, uri, method, sizeof(method), userpass,
+ httpSeparateURI(HTTP_URI_CODING_ALL, uri, scheme, sizeof(scheme), userpass,
sizeof(userpass), hostname, sizeof(hostname), &port,
rawresource, sizeof(rawresource));
- if (!strcmp(method, "ipp") ||
- !strcmp(method, "http") ||
- !strcmp(method, "https"))
+ if (!strcmp(scheme, "ipp") ||
+ !strcmp(scheme, "http") ||
+ !strcmp(scheme, "https"))
{
if (newresource)
{
* Map local access to a local URI...
*/
- if (!strcasecmp(hostname, "localhost") ||
+ if (!strcasecmp(hostname, "127.0.0.1") ||
+ !strcasecmp(hostname, "[::1]") ||
+ !strcasecmp(hostname, "localhost") ||
!strncasecmp(hostname, "localhost.", 10) ||
!strcasecmp(hostname, server) ||
!strcasecmp(hostname, servername))
Browsing On
BrowseOrder allow,deny
BrowseAllow all
-BrowseLocalProtocols @CUPS_DEFAULT_BROWSE_LOCAL_PROTOCOLS@
+BrowseLocalProtocols @CUPS_BROWSE_LOCAL_PROTOCOLS@
# Default authentication type, when authentication is required...
DefaultAuthType Basic
debug.o: i18n.h transcode.h debug.h
dest.o: debug.h globals.h string.h ../config.h http-private.h http.h
dest.o: versioning.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h
-dest.o: language.h i18n.h transcode.h
+dest.o: language.h i18n.h transcode.h pwgmedia.h
dir.o: dir.h versioning.h string.h ../config.h debug.h
emit.o: ppd.h array.h versioning.h file.h string.h ../config.h debug.h
encode.o: cups.h ipp.h http.h versioning.h ppd.h array.h file.h language.h
localize.o: md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h
localize.o: i18n.h transcode.h ppd-private.h debug.h
mark.o: cups.h ipp.h http.h versioning.h ppd.h array.h file.h language.h
-mark.o: string.h ../config.h debug.h
+mark.o: string.h ../config.h debug.h pwgmedia.h
md5.o: md5.h string.h ../config.h
md5passwd.o: http-private.h ../config.h http.h versioning.h md5.h
md5passwd.o: ipp-private.h ipp.h string.h
ppd.o: ppd-private.h cups.h ipp.h http.h versioning.h ppd.h array.h file.h
ppd.o: language.h globals.h string.h ../config.h http-private.h md5.h
ppd.o: ipp-private.h i18n.h transcode.h debug.h
+pwgmedia.o: pwgmedia.h globals.h string.h ../config.h http-private.h http.h
+pwgmedia.o: versioning.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h
+pwgmedia.o: file.h language.h i18n.h transcode.h debug.h
request.o: globals.h string.h ../config.h http-private.h http.h versioning.h
request.o: md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h
request.o: i18n.h transcode.h debug.h
testlang.o: i18n.h transcode.h language.h array.h versioning.h string.h
testlang.o: ../config.h
testppd.o: ../cups/string.h ../config.h string.h cups.h ipp.h http.h
-testppd.o: versioning.h ppd.h array.h file.h language.h
+testppd.o: versioning.h ppd.h array.h file.h language.h pwgmedia.h
testsnmp.o: string.h ../config.h snmp-private.h http.h versioning.h
# DO NOT DELETE
debug.32.o: debug.c i18n.h transcode.h debug.h
dest.32.o: dest.c debug.h globals.h string.h ../config.h http-private.h http.h
dest.32.o: dest.c versioning.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h
-dest.32.o: dest.c language.h i18n.h transcode.h
+dest.32.o: dest.c language.h i18n.h transcode.h pwgmedia.h
dir.32.o: dir.c dir.h versioning.h string.h ../config.h debug.h
emit.32.o: emit.c ppd.h array.h versioning.h file.h string.h ../config.h debug.h
encode.32.o: encode.c cups.h ipp.h http.h versioning.h ppd.h array.h file.h language.h
localize.32.o: localize.c md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h
localize.32.o: localize.c i18n.h transcode.h ppd-private.h debug.h
mark.32.o: mark.c cups.h ipp.h http.h versioning.h ppd.h array.h file.h language.h
-mark.32.o: mark.c string.h ../config.h debug.h
+mark.32.o: mark.c string.h ../config.h debug.h pwgmedia.h
md5.32.o: md5.c md5.h string.h ../config.h
md5passwd.32.o: md5passwd.c http-private.h ../config.h http.h versioning.h md5.h
md5passwd.32.o: md5passwd.c ipp-private.h ipp.h string.h
ppd.32.o: ppd.c ppd-private.h cups.h ipp.h http.h versioning.h ppd.h array.h file.h
ppd.32.o: ppd.c language.h globals.h string.h ../config.h http-private.h md5.h
ppd.32.o: ppd.c ipp-private.h i18n.h transcode.h debug.h
+pwgmedia.32.o: pwgmedia.c pwgmedia.h globals.h string.h ../config.h http-private.h http.h
+pwgmedia.32.o: pwgmedia.c versioning.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h
+pwgmedia.32.o: pwgmedia.c file.h language.h i18n.h transcode.h debug.h
request.32.o: request.c globals.h string.h ../config.h http-private.h http.h versioning.h
request.32.o: request.c md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h
request.32.o: request.c i18n.h transcode.h debug.h
testlang.32.o: testlang.c i18n.h transcode.h language.h array.h versioning.h string.h
testlang.32.o: testlang.c ../config.h
testppd.32.o: testppd.c ../cups/string.h ../config.h string.h cups.h ipp.h http.h
-testppd.32.o: testppd.c versioning.h ppd.h array.h file.h language.h
+testppd.32.o: testppd.c versioning.h ppd.h array.h file.h language.h pwgmedia.h
testsnmp.32.o: testsnmp.c string.h ../config.h snmp-private.h http.h versioning.h
# DO NOT DELETE
debug.64.o: debug.c i18n.h transcode.h debug.h
dest.64.o: dest.c debug.h globals.h string.h ../config.h http-private.h http.h
dest.64.o: dest.c versioning.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h
-dest.64.o: dest.c language.h i18n.h transcode.h
+dest.64.o: dest.c language.h i18n.h transcode.h pwgmedia.h
dir.64.o: dir.c dir.h versioning.h string.h ../config.h debug.h
emit.64.o: emit.c ppd.h array.h versioning.h file.h string.h ../config.h debug.h
encode.64.o: encode.c cups.h ipp.h http.h versioning.h ppd.h array.h file.h language.h
localize.64.o: localize.c md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h
localize.64.o: localize.c i18n.h transcode.h ppd-private.h debug.h
mark.64.o: mark.c cups.h ipp.h http.h versioning.h ppd.h array.h file.h language.h
-mark.64.o: mark.c string.h ../config.h debug.h
+mark.64.o: mark.c string.h ../config.h debug.h pwgmedia.h
md5.64.o: md5.c md5.h string.h ../config.h
md5passwd.64.o: md5passwd.c http-private.h ../config.h http.h versioning.h md5.h
md5passwd.64.o: md5passwd.c ipp-private.h ipp.h string.h
ppd.64.o: ppd.c ppd-private.h cups.h ipp.h http.h versioning.h ppd.h array.h file.h
ppd.64.o: ppd.c language.h globals.h string.h ../config.h http-private.h md5.h
ppd.64.o: ppd.c ipp-private.h i18n.h transcode.h debug.h
+pwgmedia.64.o: pwgmedia.c pwgmedia.h globals.h string.h ../config.h http-private.h http.h
+pwgmedia.64.o: pwgmedia.c versioning.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h
+pwgmedia.64.o: pwgmedia.c file.h language.h i18n.h transcode.h debug.h
request.64.o: request.c globals.h string.h ../config.h http-private.h http.h versioning.h
request.64.o: request.c md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h
request.64.o: request.c i18n.h transcode.h debug.h
testlang.64.o: testlang.c i18n.h transcode.h language.h array.h versioning.h string.h
testlang.64.o: testlang.c ../config.h
testppd.64.o: testppd.c ../cups/string.h ../config.h string.h cups.h ipp.h http.h
-testppd.64.o: testppd.c versioning.h ppd.h array.h file.h language.h
+testppd.64.o: testppd.c versioning.h ppd.h array.h file.h language.h pwgmedia.h
testsnmp.64.o: testsnmp.c string.h ../config.h snmp-private.h http.h versioning.h
#
# API library Makefile for the Common UNIX Printing System (CUPS).
#
-# Copyright 2007-2008 by Apple Inc.
+# Copyright 2007-2009 by Apple Inc.
# Copyright 1997-2006 by Easy Software Products, all rights reserved.
#
# These coded instructions, statements, and computer programs are the
options.o \
page.o \
ppd.o \
+ pwgmedia.o \
request.o \
sidechannel.o \
snmp.o \
libcups.so.2 libcups.sl.2: $(LIBOBJS)
echo Linking $@...
- $(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS) $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
+ $(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS) $(LIBGSSAPI) \
+ $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
$(RM) `basename $@ .2`
$(LN) $@ `basename $@ .2`
32bit/libcups.so.2: $(LIB32OBJS)
echo Linking 32-bit $@...
-mkdir 32bit
- $(DSO) $(ARCH32FLAGS) $(DSO32FLAGS) -o $@ $(LIB32OBJS) $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
+ $(DSO) $(ARCH32FLAGS) $(DSO32FLAGS) -o $@ $(LIB32OBJS) $(LIBGSSAPI) \
+ $(DNSSDLIBS) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
$(RM) 32bit/libcups.so
$(LN) libcups.so.2 32bit/libcups.so
64bit/libcups.so.2: $(LIB64OBJS)
echo Linking 64-bit $@...
-mkdir 64bit
- $(DSO) $(ARCH64FLAGS) $(DSO64FLAGS) -o $@ $(LIB64OBJS) $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
+ $(DSO) $(ARCH64FLAGS) $(DSO64FLAGS) -o $@ $(LIB64OBJS) $(LIBGSSAPI) \
+ $(DNSSDLIBS) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
$(RM) 64bit/libcups.so
$(LN) libcups.so.2 64bit/libcups.so
-compatibility_version 2.0.0 \
-exported_symbols_list libcups.exp \
-sectorder __TEXT __text $(LIBCUPSORDER) \
- $(LIBOBJS) $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
+ $(LIBOBJS) $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) \
+ $(COMMONLIBS) $(LIBZ)
$(RM) libcups.dylib
$(LN) $@ libcups.dylib
libcups_s.a: $(LIBOBJS) libcups_s.exp
echo Creating $@...
- $(DSO) $(DSOFLAGS) -Wl,-bexport:libcups_s.exp -o libcups_s.o $(LIBOBJS) $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ) -lm
+ $(DSO) $(DSOFLAGS) -Wl,-bexport:libcups_s.exp -o libcups_s.o \
+ $(LIBOBJS) $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) \
+ $(COMMONLIBS) $(LIBZ) -lm
$(RM) $@
$(AR) $(ARFLAGS) $@ libcups_s.o
libcups.la: $(LIBOBJS)
echo Linking $@...
- $(CC) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS:.o=.lo) -rpath $(LIBDIR) \
- -version-info 2:8 $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
+ $(CC) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS:.o=.lo) \
+ -rpath $(LIBDIR) -version-info 2:8 $(LIBGSSAPI) $(SSLLIBS) \
+ $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
#
testadmin: testadmin.o libcups.a
echo Linking $@...
$(CC) $(LDFLAGS) -o $@ testadmin.o libcups.a \
- $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
+ $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
#
testarray: testarray.o libcups.a
echo Linking $@...
$(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testarray.o libcups.a \
- $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
+ $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
echo Running array API tests...
./testarray
testconflicts: testconflicts.o libcups.a
echo Linking $@...
$(CC) $(LDFLAGS) -o $@ testconflicts.o libcups.a \
- $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
+ $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
#
testcups: testcups.o libcups.a
echo Linking $@...
$(CC) $(LDFLAGS) -o $@ testcups.o libcups.a \
- $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
+ $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
#
testfile: testfile.o libcups.a
echo Linking $@...
$(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testfile.o libcups.a \
- $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
+ $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
echo Running file API tests...
./testfile
testhttp: testhttp.o libcups.a
echo Linking $@...
$(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testhttp.o libcups.a \
- $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
+ $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
echo Running HTTP API tests...
./testhttp
testipp: testipp.o libcups.a
echo Linking $@...
$(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testipp.o libcups.a \
- $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
+ $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
echo Running IPP API tests...
./testipp
testi18n: testi18n.o libcups.a
echo Linking $@...
$(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testi18n.o libcups.a \
- $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
+ $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
echo Running internationalization API tests...
./testi18n
testlang: testlang.o libcups.a
echo Linking $@...
$(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testlang.o libcups.a \
- $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
+ $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
echo Running language API tests...
./testlang
testoptions: testoptions.o libcups.a
echo Linking $@...
$(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testoptions.o libcups.a \
- $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
+ $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
echo Running option API tests...
./testoptions
testppd: testppd.o libcups.a
echo Linking $@...
$(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testppd.o libcups.a \
- $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
+ $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
echo Running PPD API tests...
./testppd
testsnmp: testsnmp.o libcups.a
echo Linking $@...
$(CC) $(LDFLAGS) -o $@ testsnmp.o libcups.a \
- $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
+ $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
#
*
* Option marking routines for the Common UNIX Printing System (CUPS).
*
- * Copyright 2007-2008 by Apple Inc.
+ * Copyright 2007-2009 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
for (i = consts->num_constraints, constptr = consts->constraints;
- i > 0;
+ i > 0 && !changed;
i --, constptr ++)
{
- if (constptr->installable ||
- !strcasecmp(constptr->option->keyword, "PageSize") ||
- !strcasecmp(constptr->option->keyword, "PageRegion"))
+ /*
+ * Can't resolve by changing an installable option...
+ */
+
+ if (constptr->installable)
continue;
+ /*
+ * Is this the option we are changing?
+ */
+
if (option && !strcasecmp(constptr->option->keyword, option))
continue;
+ /*
+ * Get the current option choice...
+ */
+
if ((value = cupsGetOption(constptr->option->keyword, num_newopts,
newopts)) == NULL)
{
* Try each choice instead...
*/
- cupsArrayDelete(test);
-
for (j = constptr->option->num_choices,
cptr = constptr->option->choices;
j > 0;
j --, cptr ++)
{
+ cupsArrayDelete(test);
test = NULL;
if (strcasecmp(value, cptr->choice) &&
changed = 1;
break;
}
-
- cupsArrayDelete(test);
}
+
+ cupsArrayDelete(test);
}
}
}
#include "debug.h"
#include "globals.h"
+#include "pwgmedia.h"
#include <stdlib.h>
#include <ctype.h>
#include <sys/stat.h>
appleGetPaperSize(char *name, /* I - Paper size name buffer */
int namesize) /* I - Size of buffer */
{
- CFStringRef defaultPaperID; /* Default paper ID */
+ CFStringRef defaultPaperID; /* Default paper ID */
+ _cups_pwg_media_t *pwgmedia; /* PWG media size */
defaultPaperID = CFPreferencesCopyAppValue(kDefaultPaperIDKey,
!CFStringGetCString(defaultPaperID, name, namesize,
kCFStringEncodingUTF8))
name[0] = '\0';
- else if (!strncmp(name, "na-", 3))
- _cups_strcpy(name, name + 3);
- else if (!strncmp(name, "iso-", 4))
- _cups_strcpy(name, name + 4);
+ else if ((pwgmedia = _cupsPWGMediaByLegacy(name)) != NULL)
+ strlcpy(name, pwgmedia->pwg, namesize);
if (defaultPaperID)
CFRelease(defaultPaperID);
{
bytes = (ssize_t)(fp->end - fp->buf);
+ DEBUG_printf(("cupsFileSeek: bytes=" CUPS_LLFMT "\n", CUPS_LLCAST bytes));
+
if (pos >= fp->bufpos && pos < (fp->bufpos + bytes))
{
/*
fp->eof = 0;
- DEBUG_printf(("cupsFileSeek: bytes=" CUPS_LLFMT "\n", CUPS_LLCAST bytes));
-
if (pos < fp->bufpos)
{
/*
*
* Global variable access routines for the Common UNIX Printing System (CUPS).
*
- * Copyright 2007-2008 by Apple Inc.
+ * Copyright 2007-2009 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
free(buffer);
}
+ cupsArrayDelete(cg->pwg_size_lut);
+ cupsArrayDelete(cg->leg_size_lut);
+
free(value);
}
*
* Global variable definitions for the Common UNIX Printing System (CUPS).
*
- * Copyright 2007-2008 by Apple Inc.
+ * Copyright 2007-2009 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
int ppd_line; /* Current line number */
ppd_conform_t ppd_conform; /* Level of conformance required */
+ /* pwgmedia.c */
+ cups_array_t *pwg_size_lut, /* Lookup table for PWG names */
+ *leg_size_lut; /* Lookup table for legacy names */
+
/* snmp.c */
char snmp_community[255];
/* Default SNMP community name */
* Internet Printing Protocol support functions for the Common UNIX
* Printing System (CUPS).
*
- * Copyright 2007-2008 by Apple Inc.
+ * Copyright 2007-2009 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
* Verify the major version number...
*/
- if (buffer[0] != 1)
+ if (buffer[0] != 1 && buffer[0] != 2)
{
DEBUG_printf(("ippReadIO: version number (%d.%d) is bad.\n",
buffer[0], buffer[1]));
break;
case IPP_TAG_NOVALUE :
+ case IPP_TAG_NOTSETTABLE :
+ case IPP_TAG_DELETEATTR :
+ case IPP_TAG_ADMINDEFINE :
if (attr->value_tag == IPP_TAG_NOVALUE)
{
if (n == 0)
__cupsMessageFree
__cupsMessageLoad
__cupsMessageLookup
+__cupsPWGMediaByName
+__cupsPWGMediaByLegacy
+__cupsPWGMediaBySize
__cupsSetError
__cupsSetLocale
__cupsSNMPClose
_cupsSideChannelDoRequest
_cupsSideChannelRead
_cupsSideChannelWrite
+_cupsSideChannelSNMPGet
+_cupsSideChannelSNMPWalk
_cupsStartDocument
_cupsTempFd
_cupsTempFile
_cupsMessageFree
_cupsMessageLoad
_cupsMessageLookup
+_cupsPWGMediaByName
+_cupsPWGMediaByLegacy
+_cupsPWGMediaBySize
_cupsSetError
_cupsSetLocale
_cupsSNMPClose
/*
- * "$Id: mark.c 7819 2008-08-01 00:27:24Z mike $"
+ * "$Id: mark.c 8210 2009-01-09 02:30:26Z mike $"
*
* Option marking routines for the Common UNIX Printing System (CUPS).
*
- * Copyright 2007-2008 by Apple Inc.
+ * Copyright 2007-2009 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
* debug_marked() - Output the marked array to stdout...
* ppd_defaults() - Set the defaults for this group and all sub-groups.
* ppd_mark_choices() - Mark one or more option choices from a string.
- * ppd_mark_option() - Quick mark an option without checking for
+ * ppd_mark_option() - Quickly mark an option without checking for
+ * conflicts.
+ * ppd_mark_size() - Quickly mark a page size without checking for
* conflicts.
*/
#include "cups.h"
#include "string.h"
#include "debug.h"
+#include "pwgmedia.h"
/*
static void ppd_mark_choices(ppd_file_t *ppd, const char *s);
static void ppd_mark_option(ppd_file_t *ppd, const char *option,
const char *choice);
+static void ppd_mark_size(ppd_file_t *ppd, const char *size);
/*
*/
if (!page_size || !page_size[0])
- ppd_mark_option(ppd, "PageSize", s);
+ ppd_mark_size(ppd, s);
if (cupsGetOption("InputSlot", num_options, options) == NULL)
ppd_mark_option(ppd, "InputSlot", s);
/*
- * End of "$Id: mark.c 7819 2008-08-01 00:27:24Z mike $".
+ * 'ppd_mark_size()' - Quickly mark a page size without checking for conflicts.
+ *
+ * This function is also responsible for mapping PWG/ISO/IPP size names to the
+ * PPD file...
+ */
+
+static void
+ppd_mark_size(ppd_file_t *ppd, /* I - PPD file */
+ const char *size) /* I - Size name */
+{
+ int i; /* Looping var */
+ _cups_pwg_media_t *pwgmedia; /* PWG media information */
+ ppd_size_t *ppdsize; /* Current PPD size */
+ double dw, dl; /* Difference in width and height */
+ double width, /* Width to find */
+ length; /* Length to find */
+ char width_str[256], /* Width in size name */
+ length_str[256],/* Length in size name */
+ units[256], /* Units in size name */
+ custom[256]; /* Custom size */
+ struct lconv *loc; /* Localization data */
+
+
+ /*
+ * See if this is a PPD size...
+ */
+
+ if (!strncasecmp(size, "Custom.", 7) || ppdPageSize(ppd, size))
+ {
+ ppd_mark_option(ppd, "PageSize", size);
+ return;
+ }
+
+ /*
+ * Nope, try looking up the PWG or legacy (IPP/ISO) size name...
+ */
+
+ if ((pwgmedia = _cupsPWGMediaByName(size)) == NULL)
+ pwgmedia = _cupsPWGMediaByLegacy(size);
+
+ if (pwgmedia)
+ {
+ width = pwgmedia->width;
+ length = pwgmedia->length;
+ }
+ else if (sscanf(size, "%*[^_]_%*[^_]_%255[0-9.]x%255[0-9.]%s", width_str,
+ length_str, units) == 3)
+ {
+ /*
+ * Got a "self-describing" name that isn't in our table...
+ */
+
+ loc = localeconv();
+ width = _cupsStrScand(width_str, NULL, loc);
+ length = _cupsStrScand(length_str, NULL, loc);
+
+ if (!strcmp(units, "in"))
+ {
+ width *= 72.0;
+ length *= 72.0;
+ }
+ else if (!strcmp(units, "mm"))
+ {
+ width *= 25.4 / 72.0;
+ length *= 25.4 / 72.0;
+ }
+ else
+ return;
+ }
+ else
+ return;
+
+ /*
+ * Search the PPD file for a matching size...
+ */
+
+ for (i = ppd->num_sizes, ppdsize = ppd->sizes; i > 0; i --, ppdsize ++)
+ {
+ dw = ppdsize->width - width;
+ dl = ppdsize->length - length;
+
+ if (dw > -5.0 && dw < 5.0 && dl > -5.0 && dl < 5.0)
+ {
+ ppd_mark_option(ppd, "PageSize", ppdsize->name);
+ return;
+ }
+ }
+
+ /*
+ * No match found; if custom sizes are supported, set a custom size...
+ */
+
+ if (ppd->variable_sizes)
+ {
+ snprintf(custom, sizeof(custom), "Custom.%dx%d", (int)width, (int)length);
+ ppd_mark_option(ppd, "PageSize", custom);
+ }
+}
+
+
+/*
+ * End of "$Id: mark.c 8210 2009-01-09 02:30:26Z mike $".
*/
--- /dev/null
+/*
+ * "$Id$"
+ *
+ * PWG media name API implementation for the Common UNIX Printing System
+ * (CUPS).
+ *
+ * Copyright 2009 by Apple Inc.
+ *
+ * These coded instructions, statements, and computer programs are the
+ * property of Apple Inc. 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
+ * file is missing or damaged, see the license at "http://www.cups.org/".
+ *
+ * Contents:
+ *
+ * _cupsPWGMediaByLegacy() - Find a PWG media size by ISO/IPP legacy name.
+ * _cupsPWGMediaByName() - Find a PWG media size by 5101.1 self-describing
+ * name.
+ * _cupsPWGMediaBySize() - Find a PWG media size by size in points.
+ * compare_legacy() - Compare two sizes using the legacy names.
+ * compare_pwg() - Compare two sizes using the PWG names.
+ */
+
+/*
+ * Include necessary headers...
+ */
+
+#include "pwgmedia.h"
+#include "globals.h"
+#include "string.h"
+#include "debug.h"
+#include <math.h>
+
+
+/*
+ * Local macros...
+ */
+
+#define _CUPS_SIZE_IN(p,l,x,y) {p, l, x * 72.0, y * 72.0}
+#define _CUPS_SIZE_MM(p,l,x,y) {p, l, x / 25.4 * 72.0, y / 25.4 * 72.0}
+
+
+/*
+ * Local functions...
+ */
+
+static int compare_legacy(_cups_pwg_media_t *a, _cups_pwg_media_t *b);
+static int compare_pwg(_cups_pwg_media_t *a, _cups_pwg_media_t *b);
+
+
+/*
+ * Local globals...
+ */
+
+static _cups_pwg_media_t const cups_pwg_media[] =
+{ /* Media size lookup table */
+ /* North American Standard Sheet Media Sizes */
+ _CUPS_SIZE_IN("na_index-3x5_3x5in", NULL, 3, 5),
+ _CUPS_SIZE_IN("na_personal_3.625x6.5in", NULL, 3.625, 6.5),
+ _CUPS_SIZE_IN("na_monarch_3.875x7.5in", "monarch-envelope", 3.875, 7.5),
+ _CUPS_SIZE_IN("na_number-9_3.875x8.875in", "na-number-9-envelope", 3.875, 8.875),
+ _CUPS_SIZE_IN("na_index-4x6_4x6in", NULL, 4, 6),
+ _CUPS_SIZE_IN("na_number-10_4.125x9.5in", "na-number-10-envelope", 4.125, 9.5),
+ _CUPS_SIZE_IN("na_a2_4.375x5.75in", NULL, 4.375, 5.75),
+ _CUPS_SIZE_IN("na_number-11_4.5x10.375in", NULL, 4.5, 10.375),
+ _CUPS_SIZE_IN("na_number-12_4.75x11in", NULL, 4.75, 11),
+ _CUPS_SIZE_IN("na_5x7_5x7in", NULL, 5, 7),
+ _CUPS_SIZE_IN("na_index-5x8_5x8in", NULL, 5, 8),
+ _CUPS_SIZE_IN("na_number-14_5x11.5in", NULL, 5, 11.5),
+ _CUPS_SIZE_IN("na_invoice_5.5x8.5in", "invoice", 5.5, 8.5),
+ _CUPS_SIZE_IN("na_index-4x6-ext_6x8in", NULL, 6, 8),
+ _CUPS_SIZE_IN("na_6x9_6x9in", "na-6x9-envelope", 6, 9),
+ _CUPS_SIZE_IN("na_c5_6.5x9.5in", NULL, 6.5, 9.5),
+ _CUPS_SIZE_IN("na_7x9_7x9in", "na-7x9-envelope", 7, 9),
+ _CUPS_SIZE_IN("na_executive_7.25x10.5in", "executive", 7.25, 10.5),
+ _CUPS_SIZE_IN("na_govt-letter_8x10in", "na-8x10", 8, 10),
+ _CUPS_SIZE_IN("na_govt-legal_8x13in", NULL, 8, 13),
+ _CUPS_SIZE_IN("na_quarto_8.5x10.83in", "quarto", 8.5, 10.83),
+ _CUPS_SIZE_IN("na_letter_8.5x11in", "na-letter", 8.5, 11),
+ _CUPS_SIZE_IN("na_fanfold-eur_8.5x12in", NULL, 8.5, 12),
+ _CUPS_SIZE_IN("na_letter-plus_8.5x12.69in", NULL, 8.5, 12.69),
+ _CUPS_SIZE_IN("na_foolscap_8.5x13in", NULL, 8.5, 13),
+ _CUPS_SIZE_IN("na_legal_8.5x14in", "na-legal", 8.5, 14),
+ _CUPS_SIZE_IN("na_super-a_8.94x14in", NULL, 8.94, 14),
+ _CUPS_SIZE_IN("na_9x11_9x11in", "na-9x11-envelope", 9, 11),
+ _CUPS_SIZE_IN("na_arch-a_9x12in", "arch-a", 9, 12),
+ _CUPS_SIZE_IN("na_letter-extra_9.5x12in", NULL, 9.5, 12),
+ _CUPS_SIZE_IN("na_legal-extra_9.5x15in", NULL, 9.5, 15),
+ _CUPS_SIZE_IN("na_10x11_10x11in", NULL, 10, 11),
+ _CUPS_SIZE_IN("na_10x13_10x13in", "na-10x13-envelope", 10, 13),
+ _CUPS_SIZE_IN("na_10x14_10x14in", "na-10x14-envelope", 10, 14),
+ _CUPS_SIZE_IN("na_10x15_10x15in", "na-10x15-envelope", 10, 15),
+ _CUPS_SIZE_IN("na_11x12_11x12in", NULL, 11, 12),
+ _CUPS_SIZE_IN("na_edp_11x14in", NULL, 11, 14),
+ _CUPS_SIZE_IN("na_fanfold-us_11x14.875in", NULL, 11, 14.875),
+ _CUPS_SIZE_IN("na_11x15_11x15in", NULL, 11, 15),
+ _CUPS_SIZE_IN("na_ledger_11x17in", "tabloid", 11, 17),
+ _CUPS_SIZE_IN("na_eur-edp_12x14in", NULL, 12, 14),
+ _CUPS_SIZE_IN("na_arch-b_12x18in", "arch-b", 12, 18),
+ _CUPS_SIZE_IN("na_12x19_12x19in", NULL, 12, 19),
+ _CUPS_SIZE_IN("na_b-plus_12x19.17in", NULL, 12, 19.17),
+ _CUPS_SIZE_IN("na_super-b_13x19in", NULL, 13, 19),
+ _CUPS_SIZE_IN("na_c_17x22in", "c", 17, 22),
+ _CUPS_SIZE_IN("na_arch-c_18x24in", "arch-c", 18, 24),
+ _CUPS_SIZE_IN("na_d_22x34in", "d", 22, 34),
+ _CUPS_SIZE_IN("na_arch-d_24x36in", "arch-d", 24, 36),
+ _CUPS_SIZE_IN("asme_f_28x40in", "f", 28, 40),
+ _CUPS_SIZE_IN("na_wide-format_30x42in", NULL, 30, 42),
+ _CUPS_SIZE_IN("na_e_34x44in", "e", 34, 44),
+ _CUPS_SIZE_IN("na_arch-e_36x48in", "arch-e", 36, 48),
+ _CUPS_SIZE_IN("na_f_44x68in", NULL, 44, 68),
+
+ /* Chinese Standard Sheet Media Inch Sizes */
+ _CUPS_SIZE_IN("roc_16k_7.75x10.75in", NULL, 7.75, 10.75),
+ _CUPS_SIZE_IN("roc_8k_10.75x15.5in", NULL, 10.75, 15.5),
+
+ /* ISO Standard Sheet Media Sizes */
+ _CUPS_SIZE_MM("iso_a10_26x37mm", "iso-a10", 26, 37),
+ _CUPS_SIZE_MM("iso_a9_37x52mm", "iso-a9", 37, 52),
+ _CUPS_SIZE_MM("iso_a8_52x74mm", "iso-a8", 52, 74),
+ _CUPS_SIZE_MM("iso_a7_74x105mm", "iso-a7", 74, 105),
+ _CUPS_SIZE_MM("iso_a6_105x148mm", "iso-a6", 105, 148),
+ _CUPS_SIZE_MM("iso_a5_148x210mm", "iso-a5", 148, 210),
+ _CUPS_SIZE_MM("iso_a5-extra_174x235mm", NULL, 174, 235),
+ _CUPS_SIZE_MM("iso_a4_210x297mm", "iso-a4", 210, 297),
+ _CUPS_SIZE_MM("iso_a4-tab_225x297mm", NULL, 225, 297),
+ _CUPS_SIZE_MM("iso_a4-extra_235.5x322.3mm", NULL, 235.5, 322.3),
+ _CUPS_SIZE_MM("iso_a3_297x420mm", "iso-a3", 297, 420),
+ _CUPS_SIZE_MM("iso_a4x3_297x630mm", "iso-a4x3", 297, 630),
+ _CUPS_SIZE_MM("iso_a4x4_297x841mm", "iso-a4x4", 297, 841),
+ _CUPS_SIZE_MM("iso_a4x5_297x1051mm", "iso-a4x5", 297, 1051),
+ _CUPS_SIZE_MM("iso_a4x6_297x1261mm", "iso-a4x6", 297, 1261),
+ _CUPS_SIZE_MM("iso_a4x7_297x1471mm", "iso-a4x7", 297, 1471),
+ _CUPS_SIZE_MM("iso_a4x8_297x1682mm", "iso-a4x8", 297, 1682),
+ _CUPS_SIZE_MM("iso_a4x9_297x1892mm", "iso-a4x9", 297, 1892),
+ _CUPS_SIZE_MM("iso_a3-extra_322x445mm", "iso-a3-extra", 322, 445),
+ _CUPS_SIZE_MM("iso_a2_420x594mm", "iso-a2", 420, 594),
+ _CUPS_SIZE_MM("iso_a3x3_420x891mm", "iso-a3x3", 420, 891),
+ _CUPS_SIZE_MM("iso_a3x4_420x1189mm", "iso-a3x4", 420, 1189),
+ _CUPS_SIZE_MM("iso_a3x5_420x1486mm", "iso-a3x5", 420, 1486),
+ _CUPS_SIZE_MM("iso_a3x6_420x1783mm", "iso-a3x6", 420, 1783),
+ _CUPS_SIZE_MM("iso_a3x7_420x2080mm", "iso-a3x7", 420, 2080),
+ _CUPS_SIZE_MM("iso_a1_594x841mm", "iso-a1", 594, 841),
+ _CUPS_SIZE_MM("iso_a2x3_594x1261mm", "iso-a2x3", 594, 1261),
+ _CUPS_SIZE_MM("iso_a2x4_594x1682mm", "iso-a2x4", 594, 1682),
+ _CUPS_SIZE_MM("iso_a2x5_594x2102mm", "iso-a2x5", 594, 2102),
+ _CUPS_SIZE_MM("iso_a0_841x1189mm", "iso-a0", 841, 1189),
+ _CUPS_SIZE_MM("iso_a1x3_841x1783mm", "iso-a1x3", 841, 1783),
+ _CUPS_SIZE_MM("iso_a1x4_841x2378mm", "iso-a1x4", 841, 2378),
+ _CUPS_SIZE_MM("iso_2a0_1189x1682mm", NULL, 1189, 1682),
+ _CUPS_SIZE_MM("iso_a0x3_1189x2523mm", NULL, 1189, 2523),
+ _CUPS_SIZE_MM("iso_b10_31x44mm", "iso-b10", 31, 44),
+ _CUPS_SIZE_MM("iso_b9_44x62mm", "iso-b9", 44, 62),
+ _CUPS_SIZE_MM("iso_b8_62x88mm", "iso-b8", 62, 88),
+ _CUPS_SIZE_MM("iso_b7_88x125mm", "iso-b7", 88, 125),
+ _CUPS_SIZE_MM("iso_b6_125x176mm", "iso-b6", 125, 176),
+ _CUPS_SIZE_MM("iso_b6c4_125x324mm", NULL, 125, 324),
+ _CUPS_SIZE_MM("iso_b5_176x250mm", "iso-b5", 176, 250),
+ _CUPS_SIZE_MM("iso_b5-extra_201x276mm", NULL, 201, 276),
+ _CUPS_SIZE_MM("iso_b4_250x353mm", "iso-b4", 250, 353),
+ _CUPS_SIZE_MM("iso_b3_353x500mm", "iso-b3", 353, 500),
+ _CUPS_SIZE_MM("iso_b2_500x707mm", "iso-b2", 500, 707),
+ _CUPS_SIZE_MM("iso_b1_707x1000mm", "iso-b1", 707, 1000),
+ _CUPS_SIZE_MM("iso_b0_1000x1414mm", "iso-b0", 1000, 1414),
+ _CUPS_SIZE_MM("iso_c10_28x40mm", "iso-c10", 28, 40),
+ _CUPS_SIZE_MM("iso_c9_40x57mm", "iso-c9", 40, 57),
+ _CUPS_SIZE_MM("iso_c8_57x81mm", "iso-c8", 57, 81),
+ _CUPS_SIZE_MM("iso_c7_81x114mm", "iso-c7", 81, 114),
+ _CUPS_SIZE_MM("iso_c7c6_81x162mm", NULL, 81, 162),
+ _CUPS_SIZE_MM("iso_c6_114x162mm", "iso-c6", 114, 162),
+ _CUPS_SIZE_MM("iso_c6c5_114x229mm", NULL, 114, 229),
+ _CUPS_SIZE_MM("iso_c5_162x229mm", "iso-c5", 162, 229),
+ _CUPS_SIZE_MM("iso_c4_229x324mm", "iso-c4", 229, 324),
+ _CUPS_SIZE_MM("iso_c3_324x458mm", "iso-c3", 324, 458),
+ _CUPS_SIZE_MM("iso_c2_458x648mm", "iso-c2", 458, 648),
+ _CUPS_SIZE_MM("iso_c1_648x917mm", "iso-c1", 648, 917),
+ _CUPS_SIZE_MM("iso_c0_917x1297mm", "iso-c0", 917, 1297),
+ _CUPS_SIZE_MM("iso_dl_110x220mm", "iso-designated", 110, 220),
+ _CUPS_SIZE_MM("iso_ra2_430x610mm", "iso-ra2", 430, 610),
+ _CUPS_SIZE_MM("iso_sra2_450x640mm", "iso-sra2", 450, 640),
+ _CUPS_SIZE_MM("iso_ra1_610x860mm", "iso-ra1", 610, 860),
+ _CUPS_SIZE_MM("iso_sra1_640x900mm", "iso-sra1", 640, 900),
+ _CUPS_SIZE_MM("iso_ra0_860x1220mm", "iso-ra0", 860, 1220),
+ _CUPS_SIZE_MM("iso_sra0_900x1280mm", "iso-sra0", 900, 1280),
+
+ /* Japanese Standard Sheet Media Sizes */
+ _CUPS_SIZE_MM("jis_b10_32x45mm", "jis-b10", 32, 45),
+ _CUPS_SIZE_MM("jis_b9_45x64mm", "jis-b9", 45, 64),
+ _CUPS_SIZE_MM("jis_b8_64x91mm", "jis-b8", 64, 91),
+ _CUPS_SIZE_MM("jis_b7_91x128mm", "jis-b7", 91, 128),
+ _CUPS_SIZE_MM("jis_b6_128x182mm", "jis-b6", 128, 182),
+ _CUPS_SIZE_MM("jis_b5_182x257mm", "jis-b5", 182, 257),
+ _CUPS_SIZE_MM("jis_b4_257x364mm", "jis-b4", 257, 364),
+ _CUPS_SIZE_MM("jis_b3_364x515mm", "jis-b3", 364, 515),
+ _CUPS_SIZE_MM("jis_b2_515x728mm", "jis-b2", 515, 728),
+ _CUPS_SIZE_MM("jis_b1_728x1030mm", "jis-b1", 728, 1030),
+ _CUPS_SIZE_MM("jis_b0_1030x1456mm", "jis-b0", 1030, 1456),
+ _CUPS_SIZE_MM("jis_exec_216x330mm", NULL, 216, 330),
+ _CUPS_SIZE_MM("jpn_chou4_90x205mm", NULL, 90, 205),
+ _CUPS_SIZE_MM("jpn_hagaki_100x148mm", NULL, 100, 148),
+ _CUPS_SIZE_MM("jpn_you4_105x235mm", NULL, 105, 235),
+ _CUPS_SIZE_MM("jpn_chou2_111.1x146mm", NULL, 111.1, 146),
+ _CUPS_SIZE_MM("jpn_chou3_120x235mm", NULL, 120, 235),
+ _CUPS_SIZE_MM("jpn_oufuku_148x200mm", NULL, 148, 200),
+ _CUPS_SIZE_MM("jpn_kahu_240x322.1mm", NULL, 240, 322.1),
+ _CUPS_SIZE_MM("jpn_kaku2_240x332mm", NULL, 240, 332),
+
+ /* Chinese Standard Sheet Media Sizes */
+ _CUPS_SIZE_MM("prc_32k_97x151mm", NULL, 97, 151),
+ _CUPS_SIZE_MM("prc_1_102x165mm", NULL, 102, 165),
+ _CUPS_SIZE_MM("prc_2_102x176mm", NULL, 102, 176),
+ _CUPS_SIZE_MM("prc_4_110x208mm", NULL, 110, 208),
+ _CUPS_SIZE_MM("prc_5_110x220mm", NULL, 110, 220),
+ _CUPS_SIZE_MM("prc_8_120x309mm", NULL, 120, 309),
+ _CUPS_SIZE_MM("prc_6_120x320mm", NULL, 120, 320),
+ _CUPS_SIZE_MM("prc_3_125x176mm", NULL, 125, 176),
+ _CUPS_SIZE_MM("prc_16k_146x215mm", NULL, 146, 215),
+ _CUPS_SIZE_MM("prc_7_160x230mm", NULL, 160, 230),
+ _CUPS_SIZE_MM("om_juuro-ku-kai_198x275mm", NULL, 198, 275),
+ _CUPS_SIZE_MM("om_pa-kai_267x389mm", NULL, 267, 389),
+ _CUPS_SIZE_MM("om_dai-pa-kai_275x395mm", NULL, 275, 395),
+ _CUPS_SIZE_MM("prc_10_324x458mm", NULL, 324, 458),
+
+ /* Other Metric Standard Sheet Media Sizes */
+ _CUPS_SIZE_MM("om_small-photo_100x150mm", NULL, 100, 150),
+ _CUPS_SIZE_MM("om_italian_110x230mm", NULL, 110, 230),
+ _CUPS_SIZE_MM("om_postfix_114x229mm", NULL, 114, 229),
+ _CUPS_SIZE_MM("om_large-photo_200x300", NULL, 200, 300),
+ _CUPS_SIZE_MM("om_folio_210x330mm", "folio", 210, 330),
+ _CUPS_SIZE_MM("om_folio-sp_215x315mm", NULL, 215, 315),
+ _CUPS_SIZE_MM("om_invite_220x220mm", NULL, 220, 220)
+};
+
+
+/*
+ * '_cupsPWGMediaByLegacy()' - Find a PWG media size by ISO/IPP legacy name.
+ */
+
+_cups_pwg_media_t * /* O - Matching size or NULL */
+_cupsPWGMediaByLegacy(
+ const char *legacy) /* I - Legacy size name */
+{
+ _cups_pwg_media_t key; /* Search key */
+ _cups_globals_t *cg = _cupsGlobals();
+ /* Global data */
+
+
+ /*
+ * Build the lookup table for PWG names as needed...
+ */
+
+ if (!cg->leg_size_lut)
+ {
+ int i; /* Looping var */
+ _cups_pwg_media_t *size; /* Current size */
+
+ cg->leg_size_lut = cupsArrayNew((cups_array_func_t)compare_legacy, NULL);
+
+ for (i = (int)(sizeof(cups_pwg_media) / sizeof(cups_pwg_media[0])),
+ size = (_cups_pwg_media_t *)cups_pwg_media;
+ i > 0;
+ i --, size ++)
+ if (size->legacy)
+ cupsArrayAdd(cg->leg_size_lut, size);
+ }
+
+ /*
+ * Lookup the name...
+ */
+
+ key.legacy = legacy;
+ return ((_cups_pwg_media_t *)cupsArrayFind(cg->leg_size_lut, &key));
+}
+
+
+/*
+ * '_cupsPWGMediaByName()' - Find a PWG media size by 5101.1 self-describing
+ * name.
+ */
+
+_cups_pwg_media_t * /* O - Matching size or NULL */
+_cupsPWGMediaByName(const char *pwg) /* I - PWG size name */
+{
+ _cups_pwg_media_t key; /* Search key */
+ _cups_globals_t *cg = _cupsGlobals();
+ /* Global data */
+
+
+ /*
+ * Build the lookup table for PWG names as needed...
+ */
+
+ if (!cg->pwg_size_lut)
+ {
+ int i; /* Looping var */
+ _cups_pwg_media_t *size; /* Current size */
+
+ cg->pwg_size_lut = cupsArrayNew((cups_array_func_t)compare_pwg, NULL);
+
+ for (i = (int)(sizeof(cups_pwg_media) / sizeof(cups_pwg_media[0])),
+ size = (_cups_pwg_media_t *)cups_pwg_media;
+ i > 0;
+ i --, size ++)
+ cupsArrayAdd(cg->pwg_size_lut, size);
+ }
+
+ /*
+ * Lookup the name...
+ */
+
+ key.pwg = pwg;
+ return ((_cups_pwg_media_t *)cupsArrayFind(cg->pwg_size_lut, &key));
+}
+
+
+/*
+ * '_cupsPWGMediaBySize()' - Find a PWG media size by size in points.
+ */
+
+_cups_pwg_media_t * /* O - Matching size or NULL */
+_cupsPWGMediaBySize(double width, /* I - Width in points */
+ double length) /* I - Length in points */
+{
+ int i; /* Looping var */
+ _cups_pwg_media_t *size; /* Current size */
+ double dw, dl; /* Difference in width and length */
+
+
+ for (i = (int)(sizeof(cups_pwg_media) / sizeof(cups_pwg_media[0])),
+ size = (_cups_pwg_media_t *)cups_pwg_media;
+ i > 0;
+ i --, size ++)
+ {
+ /*
+ * Adobe uses a size matching algorithm with an epsilon of 5 points...
+ */
+
+ dw = size->width - width;
+ dl = size->length - length;
+
+ if (dw > -5.0 && dw < 5.0 && dl > -5.0 && dl < 5.0)
+ return (size);
+ }
+
+ return (NULL);
+}
+
+
+/*
+ * 'compare_legacy()' - Compare two sizes using the legacy names.
+ */
+
+static int /* O - Result of comparison */
+compare_legacy(_cups_pwg_media_t *a, /* I - First size */
+ _cups_pwg_media_t *b) /* I - Second size */
+{
+ return (strcmp(a->legacy, b->legacy));
+}
+
+
+/*
+ * 'compare_pwg()' - Compare two sizes using the PWG names.
+ */
+
+static int /* O - Result of comparison */
+compare_pwg(_cups_pwg_media_t *a, /* I - First size */
+ _cups_pwg_media_t *b) /* I - Second size */
+{
+ return (strcmp(a->pwg, b->pwg));
+}
+
+
+/*
+ * End of "$Id$".
+ */
--- /dev/null
+/*
+ * "$Id$"
+ *
+ * PWG media name API definitions for the Common UNIX Printing System (CUPS).
+ *
+ * Copyright 2009 by Apple Inc.
+ *
+ * These coded instructions, statements, and computer programs are the
+ * property of Apple Inc. 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
+ * file is missing or damaged, see the license at "http://www.cups.org/".
+ */
+
+#ifndef _CUPS_PWGMEDIA_H_
+# define _CUPS_PWGMEDIA_H_
+
+
+/*
+ * C++ magic...
+ */
+
+# ifdef __cplusplus
+extern "C" {
+# endif /* __cplusplus */
+
+
+/*
+ * Types and structures...
+ */
+
+typedef struct _cups_pwg_media_s /**** Common media size data ****/
+{
+ const char *pwg, /* PWG 5101.1 "self describing" name */
+ *legacy; /* IPP/ISO legacy name */
+ double width, /* Width in points */
+ length; /* Length in points */
+} _cups_pwg_media_t;
+
+
+/*
+ * Functions...
+ */
+
+extern _cups_pwg_media_t *_cupsPWGMediaByLegacy(const char *legacy);
+extern _cups_pwg_media_t *_cupsPWGMediaByName(const char *pwg);
+extern _cups_pwg_media_t *_cupsPWGMediaBySize(double width,
+ double length);
+
+
+# ifdef __cplusplus
+}
+# endif /* __cplusplus */
+
+#endif /* !_CUPS_PWGMEDIA_H_ */
+
+/*
+ * End of "$Id$".
+ */
*
* PPD constraint test program for the Common UNIX Printing System (CUPS).
*
- * Copyright 2008 by Apple Inc.
+ * Copyright 2008-2009 by Apple Inc.
*
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
char line[256]; /* Input buffer */
int num_options; /* Number of options */
cups_option_t *options; /* Options */
+ char *option, /* Current option */
+ *choice; /* Current choice */
if (argc != 2)
ppdMarkDefaults(ppd);
+ option = NULL;
+ choice = NULL;
+
for (;;)
{
num_options = 0;
options = NULL;
- if (!cupsResolveConflicts(ppd, NULL, NULL, &num_options, &options))
+ if (!cupsResolveConflicts(ppd, option, choice, &num_options, &options))
puts("Unable to resolve conflicts!");
else if (num_options > 0)
{
cupsFreeOptions(num_options, options);
}
+ if (option)
+ {
+ free(option);
+ free(choice);
+ }
+
printf("\nNew Option(s): ");
fflush(stdout);
if (!fgets(line, sizeof(line), stdin) || line[0] == '\n')
break;
num_options = cupsParseOptions(line, 0, &options);
+ if (num_options > 0)
+ {
+ option = strdup(options[0].name);
+ choice = strdup(options[0].value);
+ }
+
if (cupsMarkOptions(ppd, num_options, options))
puts("Options Conflict!");
cupsFreeOptions(num_options, options);
*
* PPD test program for the Common UNIX Printing System (CUPS).
*
- * Copyright 2007-2008 by Apple Inc.
+ * Copyright 2007-2009 by Apple Inc.
* Copyright 1997-2006 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
#include <sys/stat.h>
#include <errno.h>
#include "cups.h"
+#include "pwgmedia.h"
#ifdef WIN32
# include <io.h>
#else
int num_options; /* Number of options */
cups_option_t *options; /* Options */
ppd_size_t minsize, /* Minimum size */
- maxsize; /* Maximum size */
+ maxsize, /* Maximum size */
+ *size; /* Current size */
ppd_attr_t *attr; /* Current attribute */
+ _cups_pwg_media_t *pwgmedia; /* PWG media size */
status = 0;
fputs("cupsResolveConflicts(InputSlot=Envelope): ", stdout);
num_options = 0;
options = NULL;
- if (cupsResolveConflicts(ppd, "InputSlot", "Envelope", &num_options,
+ if (!cupsResolveConflicts(ppd, "InputSlot", "Envelope", &num_options,
&options))
{
- puts("FAIL (Resolved but shouldn't be able to!)");
+ puts("FAIL (Unable to resolve)");
+ status ++;
+ }
+ else if (num_options != 2 ||
+ !cupsGetOption("PageSize", num_options, options))
+ {
+ printf("FAIL (%d options:", num_options);
+ for (i = 0; i < num_options; i ++)
+ printf(" %s=%s", options[i].name, options[i].value);
+ puts(")");
status ++;
}
else
- puts("PASS (Unable to resolve)");
+ puts("PASS (Resolved by changing PageSize)");
+
cupsFreeOptions(num_options, options);
fputs("cupsResolveConflicts(No option/choice): ", stdout);
options = NULL;
if (cupsResolveConflicts(ppd, NULL, NULL, &num_options, &options) &&
num_options == 1 && !strcasecmp(options[0].name, "InputSlot") &&
- !strcasecmp(options[0].value, "Manual"))
- puts("PASS (Resolved)");
+ !strcasecmp(options[0].value, "Tray"))
+ puts("PASS (Resolved by changing InputSlot)");
else if (num_options > 0)
{
printf("FAIL (%d options:", num_options);
status ++;
}
+ /*
+ * cupsMarkOptions with PWG and IPP size names.
+ */
+
+ fputs("cupsMarkOptions(media=iso-a4): ", stdout);
+ num_options = cupsAddOption("media", "iso-a4", 0, &options);
+ cupsMarkOptions(ppd, num_options, options);
+ cupsFreeOptions(num_options, options);
+
+ size = ppdPageSize(ppd, NULL);
+ if (!size || strcmp(size->name, "A4"))
+ {
+ printf("FAIL (%s)\n", size ? size->name : "unknown");
+ status ++;
+ }
+ else
+ puts("PASS");
+
+ fputs("cupsMarkOptions(media=na_letter_8.5x11in): ", stdout);
+ num_options = cupsAddOption("media", "na_letter_8.5x11in", 0, &options);
+ cupsMarkOptions(ppd, num_options, options);
+ cupsFreeOptions(num_options, options);
+
+ size = ppdPageSize(ppd, NULL);
+ if (!size || strcmp(size->name, "Letter"))
+ {
+ printf("FAIL (%s)\n", size ? size->name : "unknown");
+ status ++;
+ }
+ else
+ puts("PASS");
+
+ fputs("_cupsPWGMediaBySize(842, 1191): ", stdout);
+ if ((pwgmedia = _cupsPWGMediaBySize(842, 1191)) == NULL)
+ {
+ puts("FAIL (not found)");
+ status ++;
+ }
+ else if (strcmp(pwgmedia->pwg, "iso_a3_297x420mm"))
+ {
+ printf("FAIL (%s)\n", pwgmedia->pwg);
+ status ++;
+ }
+ else
+ puts("PASS");
+
/*
* Test localization...
*/
# Install data files...
#
-install-data:
+install-data: $(INSTALL_LANGUAGES)
$(INSTALL_DIR) -m 755 $(DOCDIR)
for file in $(WEBPAGES); do \
$(INSTALL_MAN) $$file $(DOCDIR); \
install-languages:
for lang in $(LANGUAGES); do \
if test -d $$lang; then \
- $(INSTALL_DIR) -m 755 $(DOCDIR)/$$lang/images; \
+ $(INSTALL_DIR) -m 755 $(DOCDIR)/$$lang; \
$(INSTALL_MAN) $$lang/index.html $(DOCDIR)/$$lang; \
$(INSTALL_MAN) $$lang/cups.css $(DOCDIR)/$$lang 2>/dev/null || true; \
- $(INSTALL_DIR) -m 755 $(DOCDIR)/$$lang/images; \
- for file in $(WEBIMAGES); do \
- $(INSTALL_MAN) $$lang/$$file $(DOCDIR)/$$lang/images 2>/dev/null || true; \
- done; \
fi; \
done
#
-# Unnstall all documentation files...
+# Uninstall all documentation files...
#
uninstall: $(UNINSTALL_LANGUAGES)
-for lang in $(LANGUAGES); do \
$(RM) $(DOCDIR)/$$lang/index.html; \
$(RM) $(DOCDIR)/$$lang/cups.css; \
- for file in $(WEBIMAGES); do \
- $(RM) $(DOCDIR)/$$lang/$$file; \
- done; \
- $(RMDIR) $(DOCDIR)/$$lang/images; \
$(RMDIR) $(DOCDIR)/$$lang; \
done
<TR><TD> </TD></TR>
<TR><TD CLASS="trailer">Common UNIX Printing System, CUPS, y el logo de CUPS son
marcas registradas de <A HREF="http://www.apple.com">Apple Inc.</A> Los derechos
-de copia de CUPS 2007-2008 son de Apple Inc. Todos los derechos reservados.</TD></TR>
+de copia de CUPS 2007-2009 son de Apple Inc. Todos los derechos reservados.</TD></TR>
</TABLE>
</BODY>
</HTML>
<TD><TT>version=1.0</TT></TD>
<TD>Specifies that version 1.0 of the IPP protocol should be used instead of the default version 1.1.</TD>
</TR>
+<TR>
+ <TD><TT>version=2.0</TT></TD>
+ <TD>Specifies that version 2.0 of the IPP protocol should be used instead of the default version 1.1.</TD>
+</TR>
+<TR>
+ <TD><TT>version=2.1</TT></TD>
+ <TD>Specifies that version 2.1 of the IPP protocol should be used instead of the default version 1.1.</TD>
+</TR>
<TR>
<TD><TT>waitjob=false</TT></TD>
<TD>Specifies that the IPP backend should not wait for the job to complete.</TD>
<PRE>
lpd://<i>ip-address-or-hostname</i>/<i>queue</i>
+lpd://<i>username@ip-address-or-hostname</i>/<i>queue</i>
lpd://<i>ip-address-or-hostname</i>/<i>queue</i>?<i>option=value</i>
+lpd://<i>username@ip-address-or-hostname</i>/<i>queue</i>?<i>option=value</i>
lpd://<i>ip-address-or-hostname</i>/<i>queue</i>?<i>option=value&option=value</i>
+lpd://<i>username@ip-address-or-hostname</i>/<i>queue</i>?<i>option=value&option=value</i>
</PRE>
<P><A HREF="#TABLE3">Table 3</A> summarizes the options supported by the <tt>lpd</tt> backend.</P>
<OL START="23">
+ <LI><EM>IPP/2.x support;</EM> CUPS now conforms to the draft IPP/2.0 and IPP/2.1 specifications.</LI>
+
<LI><EM>CUPS-Add-Modify-Printer operation;</EM> the scheduler now supports setting the printer-state-reasons attribute using this operation.</LI>
<LI><EM>CUPS-Get-Document operation;</EM> the scheduler now supports a "get document" operation to download files from a print job.</LI>
<H2 CLASS="title"><A NAME="SCHEDULER">Scheduler</A></H2>
-<OL START="27">
+<OL START="28">
<LI><EM>Access control;</EM> the scheduler now supports multiple addresses in Allow and Deny lines. It also now returns a HTTP 403 (forbidden) status when a user authenticates successfully but is not allowed to perform an operation.</LI>
<H2 CLASS="title"><A NAME="DRIVERS">Printer Drivers</A></H2>
-<OL START="48">
+<OL START="49">
<LI><EM>Device discovery;</EM> the cups-deviced helper now runs backends in parallel for faster discovery and streams the results of discovery as the backends provide them.</LI>
<H2 CLASS="title"><A NAME="FILTERS">Print Filters</A></H2>
-<OL START="57">
+<OL START="58">
<LI><EM>Banner filter;</EM> the bundled banner ("job-sheets") pages are now generated using a new banner filter provides easier customization and better support for UTF-8 text.</LI>
<H2 CLASS="title"><A NAME="CUPSAPI">CUPS API</A></H2>
-<OL START="60">
+<OL START="61">
<LI><EM>Backend API;</EM> a new cupsBackendReport function is provided to report a device from a backend and handles any needed quoting of the make-and-model, info, device-id, and location strings.</LI>
<TR><TD> </TD></TR>
<TR><TD CLASS="trailer">The Common UNIX Printing System, CUPS, and the CUPS
logo are trademarks of <A HREF="http://www.apple.com">Apple Inc.</A> CUPS is
-copyright 2007-2008 Apple Inc. All rights reserved.</TD></TR>
+copyright 2007-2009 Apple Inc. All rights reserved.</TD></TR>
</TABLE>
</BODY>
</HTML>
#
# Makefile for the CUPS base drivers.
#
-# Copyright 2007-2008 by Apple Inc.
+# Copyright 2007-2009 by Apple Inc.
# Copyright 2002-2005 by Easy Software Products.
#
# These coded instructions, statements, and computer programs are the
testcmyk: test testcmyk.o libcupsdriver.a ../cups/libcups.a
echo Linking $@...
$(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testcmyk.o libcupsdriver.a \
- ../cups/libcups.a $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
+ ../cups/libcups.a $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) \
+ $(COMMONLIBS) $(LIBZ)
echo Running CMYK API tests...
./testcmyk > test/testcmyk.log
testdither: test testdither.o libcupsdriver.a ../cups/libcups.a
echo Linking $@...
$(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testdither.o libcupsdriver.a \
- ../cups/libcups.a $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
+ ../cups/libcups.a $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) \
+ $(COMMONLIBS) $(LIBZ)
echo Running dither API tests...
./testdither > test/0-255.pgm 2>test/0-255.log
./testdither 0 127 255 > test/0-127-255.pgm 2>test/0-127-255.log
testrgb: test testrgb.o libcupsdriver.a ../cups/libcups.a
echo Linking $@...
$(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testrgb.o libcupsdriver.a \
- ../cups/libcups.a $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
+ ../cups/libcups.a $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) \
+ $(COMMONLIBS) $(LIBZ)
echo Running RGB API tests...
./testrgb > test/testrgb.log 2>&1 || echo "RGB tests failed!"
#
# Filter makefile for the Common UNIX Printing System (CUPS).
#
-# Copyright 2007-2008 by Apple Inc.
+# Copyright 2007-2009 by Apple Inc.
# Copyright 1997-2006 by Easy Software Products.
#
# These coded instructions, statements, and computer programs are the
echo Linking $@...
$(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testraster.o libcupsimage.a \
../cups/libcups.a $(IMGLIBS) $(DSOLIBS) $(COMMONLIBS) \
- $(SSLLIBS) $(LIBGSSAPI)
+ $(SSLLIBS) $(DNSSDLIBS) $(LIBGSSAPI)
echo Running raster API tests...
./testraster
static void
end_ps(ppd_file_t *ppd) /* I - PPD file */
{
- if (ppd->jcl_begin)
- fputs(ppd->jcl_begin, stdout);
+ if (ppd->jcl_end)
+ fputs(ppd->jcl_end, stdout);
else
putchar(0x04);
.\"
.\" Backend man page for the Common UNIX Printing System (CUPS).
.\"
-.\" Copyright 2007-2008 by Apple Inc.
+.\" Copyright 2007-2009 by Apple Inc.
.\" Copyright 1997-2006 by Easy Software Products.
.\"
.\" These coded instructions, statements, and computer programs are the
http://localhost:631/help
.SH COPYRIGHT
-Copyright 2007-2008 by Apple Inc.
+Copyright 2007-2009 by Apple Inc.
.\"
.\" End of "$Id: backend.man 7810 2008-07-29 01:11:15Z mike $".
.\"
.\"
.\" cancel man page for the Common UNIX Printing System (CUPS).
.\"
-.\" Copyright 2007-2008 by Apple Inc.
+.\" Copyright 2007-2009 by Apple Inc.
.\" Copyright 1997-2006 by Easy Software Products.
.\"
.\" These coded instructions, statements, and computer programs are the
.br
http://localhost:631/help
.SH COPYRIGHT
-Copyright 2007-2008 by Apple Inc.
+Copyright 2007-2009 by Apple Inc.
.\"
.\" End of "$Id: cancel.man 7600 2008-05-20 21:06:23Z mike $".
.\"
.\"
.\" classes.conf man page for the Common UNIX Printing System (CUPS).
.\"
-.\" Copyright 2007-2008 by Apple Inc.
+.\" Copyright 2007-2009 by Apple Inc.
.\" Copyright 1997-2006 by Easy Software Products.
.\"
.\" These coded instructions, statements, and computer programs are the
.br
http://localhost:631/help
.SH COPYRIGHT
-Copyright 2007-2008 by Apple Inc.
+Copyright 2007-2009 by Apple Inc.
.\"
.\" End of "$Id: classes.conf.man 7600 2008-05-20 21:06:23Z mike $".
.\"
.\"
.\" client.conf man page for the Common UNIX Printing System (CUPS).
.\"
-.\" Copyright 2007-2008 by Apple Inc.
+.\" Copyright 2007-2009 by Apple Inc.
.\" Copyright 2006 by Easy Software Products.
.\"
.\" These coded instructions, statements, and computer programs are the
.SH SEE ALSO
http://localhost:631/help
.SH COPYRIGHT
-Copyright 2007-2008 by Apple Inc.
+Copyright 2007-2009 by Apple Inc.
.\"
.\" End of "$Id: client.conf.man.in 6649 2007-07-11 21:46:42Z mike $".
.\"
.\"
.\" rastertoescpx man page for the CUPS Driver Development Kit.
.\"
-.\" Copyright 2007-2008 by Apple Inc.
+.\" Copyright 2007-2009 by Apple Inc.
.\" Copyright 1997-2007 by Easy Software Products.
.\"
.\" These coded instructions, statements, and computer programs are the
.SH SEE ALSO
cupsprofile(1), ppdc(1), ppdhtml(1), ppdi(1), ppdmerge(1), ppdpo(1), ppdcfile(5), CUPS Driver Developer Kit Manual.
.SH COPYRIGHT
-Copyright 2007-2008 by Apple Inc.
+Copyright 2007-2009 by Apple Inc.
.\"
.\" End of "$Id: commandtoescpx.man 7600 2008-05-20 21:06:23Z mike $".
.\"
.\"
.\" rastertopclx man page for the CUPS Driver Development Kit.
.\"
-.\" Copyright 2007-2008 by Apple Inc.
+.\" Copyright 2007-2009 by Apple Inc.
.\" Copyright 1997-2007 by Easy Software Products.
.\"
.\" These coded instructions, statements, and computer programs are the
.SH SEE ALSO
cupsprofile(1), ppdc(1), ppdhtml(1), ppdi(1), ppdmerge(1), ppdpo(1), ppdcfile(5), CUPS Driver Developer Kit Manual.
.SH COPYRIGHT
-Copyright 2007-2008 by Apple Inc.
+Copyright 2007-2009 by Apple Inc.
.\"
.\" End of "$Id: commandtopclx.man 7600 2008-05-20 21:06:23Z mike $".
.\"
.\"
.\" cups-config man page for the Common UNIX Printing System (CUPS).
.\"
-.\" Copyright 2007-2008 by Apple Inc.
+.\" Copyright 2007-2009 by Apple Inc.
.\" Copyright 1997-2006 by Easy Software Products.
.\"
.\" These coded instructions, statements, and computer programs are the
.SH SEE ALSO
http://localhost:631/help
.SH COPYRIGHT
-Copyright 2007-2008 by Apple Inc.
+Copyright 2007-2009 by Apple Inc.
.\"
.\" End of "$Id: cups-config.man 7646 2008-06-16 17:26:20Z mike $".
.\"
.\"
.\" cups-deviced man page for the Common UNIX Printing System (CUPS).
.\"
-.\" Copyright 2007-2008 by Apple Inc.
+.\" Copyright 2007-2009 by Apple Inc.
.\" Copyright 1997-2006 by Easy Software Products.
.\"
.\" These coded instructions, statements, and computer programs are the
.br
http://localhost:631/help
.SH COPYRIGHT
-Copyright 2007-2008 by Apple Inc.
+Copyright 2007-2009 by Apple Inc.
.\"
.\" End of "$Id: cups-deviced.man.in 7646 2008-06-16 17:26:20Z mike $".
.\"
.\"
.\" cups-driverd man page for the Common UNIX Printing System (CUPS).
.\"
-.\" Copyright 2007-2008 by Apple Inc.
+.\" Copyright 2007-2009 by Apple Inc.
.\" Copyright 1997-2006 by Easy Software Products.
.\"
.\" These coded instructions, statements, and computer programs are the
.br
http://localhost:631/help
.SH COPYRIGHT
-Copyright 2007-2008 by Apple Inc.
+Copyright 2007-2009 by Apple Inc.
.\"
.\" End of "$Id: cups-driverd.man.in 7662 2008-06-17 14:34:20Z mike $".
.\"
.\"
.\" cups-lpd man page for the Common UNIX Printing System (CUPS).
.\"
-.\" Copyright 2007-2008 by Apple Inc.
+.\" Copyright 2007-2009 by Apple Inc.
.\" Copyright 1997-2006 by Easy Software Products.
.\"
.\" These coded instructions, statements, and computer programs are the
.br
http://localhost:631/help
.SH COPYRIGHT
-Copyright 2007-2008 by Apple Inc.
+Copyright 2007-2009 by Apple Inc.
.\"
.\" End of "$Id: cups-lpd.man.in 7835 2008-08-09 06:37:04Z mike $".
.\"
.\"
.\" cups-polld man page for the Common UNIX Printing System (CUPS).
.\"
-.\" Copyright 2007-2008 by Apple Inc.
+.\" Copyright 2007-2009 by Apple Inc.
.\" Copyright 1997-2006 by Easy Software Products.
.\"
.\" These coded instructions, statements, and computer programs are the
.br
http://localhost:631/help
.SH COPYRIGHT
-Copyright 2007-2008 by Apple Inc.
+Copyright 2007-2009 by Apple Inc.
.\"
.\" End of "$Id: cups-polld.man 7600 2008-05-20 21:06:23Z mike $".
.\"
.\"
.\" snmp.conf man page for the Common UNIX Printing System (CUPS).
.\"
-.\" Copyright 2007-2008 by Apple Inc.
+.\" Copyright 2007-2009 by Apple Inc.
.\" Copyright 2006 by Easy Software Products.
.\"
.\" These coded instructions, statements, and computer programs are the
.SH SEE ALSO
http://localhost:631/help
.SH COPYRIGHT
-Copyright 2007-2008 by Apple Inc.
+Copyright 2007-2009 by Apple Inc.
.\"
.\" End of "$Id: cups-snmp.conf.man 7600 2008-05-20 21:06:23Z mike $".
.\"
.\"
.\" accept/reject man page for the Common UNIX Printing System (CUPS).
.\"
-.\" Copyright 2007-2008 by Apple Inc.
+.\" Copyright 2007-2009 by Apple Inc.
.\" Copyright 1997-2006 by Easy Software Products.
.\"
.\" These coded instructions, statements, and computer programs are the
.br
http://localhost:631/help
.SH COPYRIGHT
-Copyright 2007-2008 by Apple Inc.
+Copyright 2007-2009 by Apple Inc.
.\"
.\" End of "$Id: cupsaccept.man 7930 2008-09-10 22:25:54Z mike $".
.\"
.\"
.\" cupsaddsmb man page for the Common UNIX Printing System (CUPS).
.\"
-.\" Copyright 2007-2008 by Apple Inc.
+.\" Copyright 2007-2009 by Apple Inc.
.\" Copyright 1997-2006 by Easy Software Products.
.\"
.\" These coded instructions, statements, and computer programs are the
http://www.cups.org/windows/
.SH COPYRIGHT
-Copyright 2007-2008 by Apple Inc.
+Copyright 2007-2009 by Apple Inc.
.\"
.\" End of "$Id: cupsaddsmb.man.in 7600 2008-05-20 21:06:23Z mike $".
.\"
.\"
.\" cupsctl man page for the Common UNIX Printing System (CUPS).
.\"
-.\" Copyright 2007-2008 by Apple Inc.
+.\" Copyright 2007-2009 by Apple Inc.
.\" Copyright 2007 by Easy Software Products.
.\"
.\" These coded instructions, statements, and computer programs are the
.br
http://localhost:631/help
.SH COPYRIGHT
-Copyright 2007-2008 by Apple Inc.
+Copyright 2007-2009 by Apple Inc.
.\"
.\" End of "$Id: cupsctl.man 7600 2008-05-20 21:06:23Z mike $".
.\"
.\"
.\" cupsd.conf man page for the Common UNIX Printing System (CUPS).
.\"
-.\" Copyright 2007-2008 by Apple Inc.
+.\" Copyright 2007-2009 by Apple Inc.
.\" Copyright 1997-2006 by Easy Software Products.
.\"
.\" These coded instructions, statements, and computer programs are the
.br
http://localhost:631/help
.SH COPYRIGHT
-Copyright 2007-2008 by Apple Inc.
+Copyright 2007-2009 by Apple Inc.
.\"
.\" End of "$Id: cupsd.conf.man.in 7935 2008-09-11 01:54:11Z mike $".
.\"
.\"
.\" cupsd man page for the Common UNIX Printing System (CUPS).
.\"
-.\" Copyright 2007-2008 by Apple Inc.
+.\" Copyright 2007-2009 by Apple Inc.
.\" Copyright 1997-2006 by Easy Software Products.
.\"
.\" These coded instructions, statements, and computer programs are the
.br
http://localhost:631/help
.SH COPYRIGHT
-Copyright 2007-2008 by Apple Inc.
+Copyright 2007-2009 by Apple Inc.
.\"
.\" End of "$Id: cupsd.man.in 7600 2008-05-20 21:06:23Z mike $".
.\"
.\" cupsenable/cupsdisable man page for the Common UNIX Printing System
.\" (CUPS).
.\"
-.\" Copyright 2007-2008 by Apple Inc.
+.\" Copyright 2007-2009 by Apple Inc.
.\" Copyright 1997-2006 by Easy Software Products.
.\"
.\" These coded instructions, statements, and computer programs are the
.br
http://localhost:631/help
.SH COPYRIGHT
-Copyright 2007-2008 by Apple Inc.
+Copyright 2007-2009 by Apple Inc.
.\"
.\" End of "$Id: cupsenable.man 7600 2008-05-20 21:06:23Z mike $".
.\"
.\" cupsfilter man page for the Common UNIX Printing System (CUPS).
.\"
-.\" Copyright 2007-2008 by Apple Inc.
+.\" Copyright 2007-2009 by Apple Inc.
.\"
.\" These coded instructions, statements, and computer programs are the
.\" property of Apple Inc. and are protected by Federal copyright
.br
http://localhost:631/help
.SH COPYRIGHT
-Copyright 2007-2008 by Apple Inc.
+Copyright 2007-2009 by Apple Inc.
.\"
.\" End of "$Id: cupsfilter.man 7936 2008-09-11 03:12:59Z mike $".
.\"
.\"
.\" cupstestdsc man page for the Common UNIX Printing System (CUPS).
.\"
-.\" Copyright 2007-2008 by Apple Inc.
+.\" Copyright 2007-2009 by Apple Inc.
.\" Copyright 2006 by Easy Software Products.
.\"
.\" These coded instructions, statements, and computer programs are the
Adobe PostScript Language Document Structuring Conventions
Specification, Version 3.0.
.SH COPYRIGHT
-Copyright 2007-2008 by Apple Inc.
+Copyright 2007-2009 by Apple Inc.
.\"
.\" End of "$Id: cupstestdsc.man 7600 2008-05-20 21:06:23Z mike $".
.\"
.\"
.\" cupstestppd man page for the Common UNIX Printing System (CUPS).
.\"
-.\" Copyright 2007-2008 by Apple Inc.
+.\" Copyright 2007-2009 by Apple Inc.
.\" Copyright 1997-2006 by Easy Software Products.
.\"
.\" These coded instructions, statements, and computer programs are the
.br
Adobe PostScript Printer Description File Format Specification, Version 4.3.
.SH COPYRIGHT
-Copyright 2007-2008 by Apple Inc.
+Copyright 2007-2009 by Apple Inc.
.\"
.\" End of "$Id: cupstestppd.man 7600 2008-05-20 21:06:23Z mike $".
.\"
.\"
.\" drv man page for the Common UNIX Printing System.
.\"
-.\" Copyright 2008 by Apple Inc.
+.\" Copyright 2008-2009 by Apple Inc.
.\"
.\" These coded instructions, statements, and computer programs are the
.\" property of Apple Inc. and are protected by Federal copyright
.br
http://localhost:631/help
.SH COPYRIGHT
-Copyright 2008 by Apple Inc.
+Copyright 2008-2009 by Apple Inc.
.\"
.\" End of "$Id$".
.\"
.\"
.\" filter man page for the Common UNIX Printing System (CUPS).
.\"
-.\" Copyright 2007-2008 by Apple Inc.
+.\" Copyright 2007-2009 by Apple Inc.
.\" Copyright 1997-2007 by Easy Software Products.
.\"
.\" These coded instructions, statements, and computer programs are the
.br
http://localhost:631/help
.SH COPYRIGHT
-Copyright 2007-2008 by Apple Inc.
+Copyright 2007-2009 by Apple Inc.
.\"
.\" End of "$Id: filter.man 7600 2008-05-20 21:06:23Z mike $".
.\"
.\"
.\" lp man page for the Common UNIX Printing System (CUPS).
.\"
-.\" Copyright 2007-2008 by Apple Inc.
+.\" Copyright 2007-2009 by Apple Inc.
.\" Copyright 1997-2006 by Easy Software Products.
.\"
.\" These coded instructions, statements, and computer programs are the
.br
http://localhost:631/help
.SH COPYRIGHT
-Copyright 2007-2008 by Apple Inc.
+Copyright 2007-2009 by Apple Inc.
.\"
.\" End of "$Id: lp.man 7889 2008-08-29 22:03:35Z mike $".
.\"
.\"
.\" lpadmin man page for the Common UNIX Printing System (CUPS).
.\"
-.\" Copyright 2007-2008 by Apple Inc.
+.\" Copyright 2007-2009 by Apple Inc.
.\" Copyright 1997-2006 by Easy Software Products.
.\"
.\" These coded instructions, statements, and computer programs are the
.br
http://localhost:631/help
.SH COPYRIGHT
-Copyright 2007-2008 by Apple Inc.
+Copyright 2007-2009 by Apple Inc.
.\"
.\" End of "$Id: lpadmin.man 7600 2008-05-20 21:06:23Z mike $".
.\"
.\"
.\" lpc man page for the Common UNIX Printing System (CUPS).
.\"
-.\" Copyright 2007-2008 by Apple Inc.
+.\" Copyright 2007-2009 by Apple Inc.
.\" Copyright 1997-2006 by Easy Software Products.
.\"
.\" These coded instructions, statements, and computer programs are the
.br
http://localhost:631/help
.SH COPYRIGHT
-Copyright 2007-2008 by Apple Inc.
+Copyright 2007-2009 by Apple Inc.
.\"
.\" End of "$Id: lpc.man 7600 2008-05-20 21:06:23Z mike $".
.\"
.\"
.\" lpinfo man page for the Common UNIX Printing System (CUPS).
.\"
-.\" Copyright 2007-2008 by Apple Inc.
+.\" Copyright 2007-2009 by Apple Inc.
.\" Copyright 1997-2006 by Easy Software Products.
.\"
.\" These coded instructions, statements, and computer programs are the
.br
http://localhost:631/help
.SH COPYRIGHT
-Copyright 2007-2008 by Apple Inc.
+Copyright 2007-2009 by Apple Inc.
.\"
.\" End of "$Id: lpinfo.man 7600 2008-05-20 21:06:23Z mike $".
.\"
.\"
.\" lpmove man page for the Common UNIX Printing System (CUPS).
.\"
-.\" Copyright 2007-2008 by Apple Inc.
+.\" Copyright 2007-2009 by Apple Inc.
.\" Copyright 1997-2006 by Easy Software Products.
.\"
.\" These coded instructions, statements, and computer programs are the
.br
http://localhost:631/help
.SH COPYRIGHT
-Copyright 2007-2008 by Apple Inc.
+Copyright 2007-2009 by Apple Inc.
.\"
.\" End of "$Id: lpmove.man 7600 2008-05-20 21:06:23Z mike $".
.\"
.\"
.\" lpoptions man page for the Common UNIX Printing System (CUPS).
.\"
-.\" Copyright 2007-2008 by Apple Inc.
+.\" Copyright 2007-2009 by Apple Inc.
.\" Copyright 1997-2006 by Easy Software Products.
.\"
.\" These coded instructions, statements, and computer programs are the
.br
http://localhost:631/help
.SH COPYRIGHT
-Copyright 2007-2008 by Apple Inc.
+Copyright 2007-2009 by Apple Inc.
.\"
.\" End of "$Id: lpoptions.man.in 7889 2008-08-29 22:03:35Z mike $".
.\"
.\"
.\" lpadmin man page for the Common UNIX Printing System (CUPS).
.\"
-.\" Copyright 2007-2008 by Apple Inc.
+.\" Copyright 2007-2009 by Apple Inc.
.\" Copyright 1997-2006 by Easy Software Products.
.\"
.\" These coded instructions, statements, and computer programs are the
.br
http://localhost:631/help
.SH COPYRIGHT
-Copyright 2007-2008 by Apple Inc.
+Copyright 2007-2009 by Apple Inc.
.\"
.\" End of "$Id: lppasswd.man 7600 2008-05-20 21:06:23Z mike $".
.\"
.\"
.\" lpq man page for the Common UNIX Printing System (CUPS).
.\"
-.\" Copyright 2007-2008 by Apple Inc.
+.\" Copyright 2007-2009 by Apple Inc.
.\" Copyright 1997-2006 by Easy Software Products.
.\"
.\" These coded instructions, statements, and computer programs are the
.br
http://localhost:631/help
.SH COPYRIGHT
-Copyright 2007-2008 by Apple Inc.
+Copyright 2007-2009 by Apple Inc.
.\"
.\" End of "$Id: lpq.man 7646 2008-06-16 17:26:20Z mike $".
.\"
.\"
.\" lpr man page for the Common UNIX Printing System (CUPS).
.\"
-.\" Copyright 2007-2008 by Apple Inc.
+.\" Copyright 2007-2009 by Apple Inc.
.\" Copyright 1997-2006 by Easy Software Products.
.\"
.\" These coded instructions, statements, and computer programs are the
.br
http://localhost:631/help
.SH COPYRIGHT
-Copyright 2007-2008 by Apple Inc.
+Copyright 2007-2009 by Apple Inc.
.\"
.\" End of "$Id: lpr.man 7889 2008-08-29 22:03:35Z mike $".
.\"
.\"
.\" lprm man page for the Common UNIX Printing System (CUPS).
.\"
-.\" Copyright 2007-2008 by Apple Inc.
+.\" Copyright 2007-2009 by Apple Inc.
.\" Copyright 1997-2006 by Easy Software Products.
.\"
.\" These coded instructions, statements, and computer programs are the
.br
http://localhost:631/help
.SH COPYRIGHT
-Copyright 2007-2008 by Apple Inc.
+Copyright 2007-2009 by Apple Inc.
.\"
.\" End of "$Id: lprm.man 7600 2008-05-20 21:06:23Z mike $".
.\"
.\"
.\" lpstat man page for the Common UNIX Printing System (CUPS).
.\"
-.\" Copyright 2007-2008 by Apple Inc.
+.\" Copyright 2007-2009 by Apple Inc.
.\" Copyright 1997-2006 by Easy Software Products.
.\"
.\" These coded instructions, statements, and computer programs are the
.br
http://localhost:631/help
.SH COPYRIGHT
-Copyright 2007-2008 by Apple Inc.
+Copyright 2007-2009 by Apple Inc.
.\"
.\" End of "$Id: lpstat.man 7921 2008-09-10 15:42:24Z mike $".
.\"
.\"
.\" mailto.conf man page for the Common UNIX Printing System (CUPS).
.\"
-.\" Copyright 2007-2008 by Apple Inc.
+.\" Copyright 2007-2009 by Apple Inc.
.\" Copyright 1997-2006 by Easy Software Products.
.\"
.\" These coded instructions, statements, and computer programs are the
.br
http://localhost:631/help
.SH COPYRIGHT
-Copyright 2007-2008 by Apple Inc.
+Copyright 2007-2009 by Apple Inc.
.\"
.\" End of "$Id: mailto.conf.man 7600 2008-05-20 21:06:23Z mike $".
.\"
.\"
.\" mime.convs man page for the Common UNIX Printing System (CUPS).
.\"
-.\" Copyright 2007-2008 by Apple Inc.
+.\" Copyright 2007-2009 by Apple Inc.
.\" Copyright 1997-2006 by Easy Software Products.
.\"
.\" These coded instructions, statements, and computer programs are the
.br
http://localhost:631/help
.SH COPYRIGHT
-Copyright 2007-2008 by Apple Inc.
+Copyright 2007-2009 by Apple Inc.
.\"
.\" End of "$Id: mime.convs.man 7600 2008-05-20 21:06:23Z mike $".
.\"
.\"
.\" mime.types man page for the Common UNIX Printing System (CUPS).
.\"
-.\" Copyright 2007-2008 by Apple Inc.
+.\" Copyright 2007-2009 by Apple Inc.
.\" Copyright 1997-2006 by Easy Software Products.
.\"
.\" These coded instructions, statements, and computer programs are the
.br
http://localhost:631/help
.SH COPYRIGHT
-Copyright 2007-2008 by Apple Inc.
+Copyright 2007-2009 by Apple Inc.
.\"
.\" End of "$Id: mime.types.man 7670 2008-06-17 22:42:08Z mike $".
.\"
.\"
.\" ppdc man page for the Common UNIX Printing System.
.\"
-.\" Copyright 2007-2008 by Apple Inc.
+.\" Copyright 2007-2009 by Apple Inc.
.\" Copyright 1997-2007 by Easy Software Products.
.\"
.\" These coded instructions, statements, and computer programs are the
.br
http://localhost:631/help
.SH COPYRIGHT
-Copyright 2007-2008 by Apple Inc.
+Copyright 2007-2009 by Apple Inc.
.\"
.\" End of "$Id: ppdc.man 7600 2008-05-20 21:06:23Z mike $".
.\"
.\"
.\" ppdcfile man page for the Common UNIX Printing System.
.\"
-.\" Copyright 2007-2008 by Apple Inc.
+.\" Copyright 2007-2009 by Apple Inc.
.\" Copyright 1997-2007 by Easy Software Products.
.\"
.\" These coded instructions, statements, and computer programs are the
.br
http://localhost:631/help
.SH COPYRIGHT
-Copyright 2007-2008 by Apple Inc.
+Copyright 2007-2009 by Apple Inc.
.\"
.\" End of "$Id: ppdcfile.man 7607 2008-05-21 01:06:23Z mike $".
.\"
.\"
.\" ppdhtml man page for the Common UNIX Printing System.
.\"
-.\" Copyright 2007-2008 by Apple Inc.
+.\" Copyright 2007-2009 by Apple Inc.
.\" Copyright 1997-2007 by Easy Software Products.
.\"
.\" These coded instructions, statements, and computer programs are the
.br
http://localhost:631/help
.SH COPYRIGHT
-Copyright 2007-2008 by Apple Inc.
+Copyright 2007-2009 by Apple Inc.
.\"
.\" End of "$Id: ppdhtml.man 7600 2008-05-20 21:06:23Z mike $".
.\"
.\"
.\" ppdi man page for the Common UNIX Printing System.
.\"
-.\" Copyright 2007-2008 by Apple Inc.
+.\" Copyright 2007-2009 by Apple Inc.
.\" Copyright 1997-2007 by Easy Software Products.
.\"
.\" These coded instructions, statements, and computer programs are the
.br
http://localhost:631/help
.SH COPYRIGHT
-Copyright 2007-2008 by Apple Inc.
+Copyright 2007-2009 by Apple Inc.
.\"
.\" End of "$Id: ppdi.man 7600 2008-05-20 21:06:23Z mike $".
.\"
.\"
.\" ppdmerge man page for the Common UNIX Printing System.
.\"
-.\" Copyright 2007-2008 by Apple Inc.
+.\" Copyright 2007-2009 by Apple Inc.
.\" Copyright 1997-2007 by Easy Software Products.
.\"
.\" These coded instructions, statements, and computer programs are the
.br
http://localhost:631/help
.SH COPYRIGHT
-Copyright 2007-2008 by Apple Inc.
+Copyright 2007-2009 by Apple Inc.
.\"
.\" End of "$Id: ppdmerge.man 7600 2008-05-20 21:06:23Z mike $".
.\"
.\"
.\" ppdpo man page for the Common UNIX Printing System.
.\"
-.\" Copyright 2007-2008 by Apple Inc.
+.\" Copyright 2007-2009 by Apple Inc.
.\" Copyright 1997-2007 by Easy Software Products.
.\"
.\" These coded instructions, statements, and computer programs are the
.br
http://localhost:631/help
.SH COPYRIGHT
-Copyright 2007-2008 by Apple Inc.
+Copyright 2007-2009 by Apple Inc.
.\"
.\" End of "$Id: ppdpo.man 7600 2008-05-20 21:06:23Z mike $".
.\"
.\"
.\" printers.conf man page for the Common UNIX Printing System (CUPS).
.\"
-.\" Copyright 2007-2008 by Apple Inc.
+.\" Copyright 2007-2009 by Apple Inc.
.\" Copyright 1997-2006 by Easy Software Products.
.\"
.\" These coded instructions, statements, and computer programs are the
.br
http://localhost:631/help
.SH COPYRIGHT
-Copyright 2007-2008 by Apple Inc.
+Copyright 2007-2009 by Apple Inc.
.\"
.\" End of "$Id: printers.conf.man 7600 2008-05-20 21:06:23Z mike $".
.\"
.\"
.\" rastertoescpx man page for the Common UNIX Printing System.
.\"
-.\" Copyright 2007-2008 by Apple Inc.
+.\" Copyright 2007-2009 by Apple Inc.
.\" Copyright 1997-2007 by Easy Software Products.
.\"
.\" These coded instructions, statements, and computer programs are the
.br
http://localhost:631/help
.SH COPYRIGHT
-Copyright 2007-2008 by Apple Inc.
+Copyright 2007-2009 by Apple Inc.
.\"
.\" End of "$Id: rastertoescpx.man 7600 2008-05-20 21:06:23Z mike $".
.\"
.\"
.\" rastertopclx man page for the Common UNIX Printing System.
.\"
-.\" Copyright 2007-2008 by Apple Inc.
+.\" Copyright 2007-2009 by Apple Inc.
.\" Copyright 1997-2007 by Easy Software Products.
.\"
.\" These coded instructions, statements, and computer programs are the
.br
http://localhost:631/help
.SH COPYRIGHT
-Copyright 2007-2008 by Apple Inc.
+Copyright 2007-2009 by Apple Inc.
.\"
.\" End of "$Id: rastertopclx.man 7600 2008-05-20 21:06:23Z mike $".
.\"
.\"
.\" subscriptions.conf man page for the Common UNIX Printing System (CUPS).
.\"
-.\" Copyright 2007-2008 by Apple Inc.
+.\" Copyright 2007-2009 by Apple Inc.
.\" Copyright 2006 by Easy Software Products.
.\"
.\" These coded instructions, statements, and computer programs are the
.br
http://localhost:631/help
.SH COPYRIGHT
-Copyright 2007-2008 by Apple Inc.
+Copyright 2007-2009 by Apple Inc.
.\"
.\" End of "$Id: subscriptions.conf.man 7600 2008-05-20 21:06:23Z mike $".
.\"
/usr/share/doc/cups/help/whatsnew.html
%dir /usr/share/doc/cups/images
/usr/share/doc/cups/images/*
-#/usr/share/locale/*
+/usr/share/locale/*
%dir /usr/share/man/man1
/usr/share/man/man1/cancel.1.gz
#
# Makefile for the CUPS PPD Compiler.
#
-# Copyright 2007-2008 by Apple Inc.
+# Copyright 2007-2009 by Apple Inc.
# Copyright 2002-2006 by Easy Software Products.
#
# These coded instructions, statements, and computer programs are the
echo Linking $@...
$(CXX) $(ARCHFLAGS) $(LDFLAGS) -o genstrings genstrings.o \
libcupsppdc.a ../cups/libcups.a $(LIBGSSAPI) $(SSLLIBS) \
- $(COMMONLIBS) $(LIBZ)
+ $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
echo Generating localization strings...
./genstrings >sample.c
ppdc-static: ppdc.o libcupsppdc.a ../cups/libcups.a foo.drv foo-fr.po
echo Linking $@...
$(CXX) $(ARCHFLAGS) $(LDFLAGS) -o ppdc-static ppdc.o libcupsppdc.a \
- ../cups/libcups.a $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
+ ../cups/libcups.a $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) \
+ $(COMMONLIBS) $(LIBZ)
echo Testing PPD compiler...
./ppdc-static -l en,fr -I ../data foo.drv
./ppdc-static -l en,fr -z -I ../data foo.drv
testcatalog: testcatalog.o libcupsppdc.a ../cups/libcups.a
echo Linking $@...
$(CXX) $(LDFLAGS) -o $@ testcatalog.o libcupsppdc.a \
- ../cups/libcups.a $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
+ ../cups/libcups.a $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) \
+ $(COMMONLIBS) $(LIBZ)
#
printers.o: ../cups/transcode.h ../cups/debug.h sysman.h statbuf.h cert.h
printers.o: auth.h client.h policy.h printers.h classes.h job.h conf.h
printers.o: banners.h dirsvc.h network.h subscriptions.h ../cups/dir.h
+printers.o: ../cups/pwgmedia.h
process.o: cupsd.h ../cups/http-private.h ../config.h ../cups/http.h
process.o: ../cups/versioning.h ../cups/md5.h ../cups/ipp-private.h
process.o: ../cups/ipp.h ../cups/string.h ../cups/array.h ../cups/cups.h
#
# Scheduler Makefile for the Common UNIX Printing System (CUPS).
#
-# Copyright 2007-2008 by Apple Inc.
+# Copyright 2007-2009 by Apple Inc.
# Copyright 1997-2007 by Easy Software Products, all rights reserved.
#
# These coded instructions, statements, and computer programs are the
testlpd: testlpd.o ../cups/libcups.a cups-lpd
echo Linking $@...
$(CC) $(LDFLAGS) -o testlpd testlpd.o ../cups/libcups.a \
- $(COMMONLIBS) $(LIBZ) $(SSLLIBS) $(LIBGSSAPI)
+ $(COMMONLIBS) $(LIBZ) $(SSLLIBS) $(DNSSDLIBS) $(LIBGSSAPI)
#
testmime: testmime.o libcupsmime.a ../cups/libcups.a
echo Linking $@...
$(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testmime.o libcupsmime.a \
- ../cups/libcups.a $(COMMONLIBS) $(LIBZ) $(SSLLIBS) $(LIBGSSAPI)
+ ../cups/libcups.a $(COMMONLIBS) $(LIBZ) $(SSLLIBS) \
+ $(DNSSDLIBS) $(LIBGSSAPI)
echo Running MIME tests...
./testmime
testspeed: testspeed.o ../cups/libcups.a
echo Linking $@...
$(CC) $(LDFLAGS) -o testspeed testspeed.o ../cups/libcups.a \
- $(SSLLIBS) $(COMMONLIBS) $(LIBZ) $(LIBGSSAPI)
+ $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ) $(LIBGSSAPI)
#
testsub: testsub.o ../cups/libcups.a
echo Linking $@...
$(CC) $(LDFLAGS) -o testsub testsub.o ../cups/libcups.a \
- $(SSLLIBS) $(COMMONLIBS) $(LIBZ) $(LIBGSSAPI)
+ $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ) $(LIBGSSAPI)
#
*
* Printer class routines for the Common UNIX Printing System (CUPS).
*
- * Copyright 2007-2008 by Apple Inc.
+ * Copyright 2007-2009 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
cupsd_printer_t *c, /* I - Class to delete from */
cupsd_printer_t *p) /* I - Printer to delete */
{
- int i; /* Looping var */
- cups_ptype_t type, /* Class type */
- oldtype; /* Old class type */
+ int i; /* Looping var */
/*
return;
/*
- * Recompute the printer type mask as needed...
+ * Update the IPP attributes (have to do this for member-names)...
*/
- if (c->num_printers > 0)
- {
- oldtype = c->type;
- type = c->type & (CUPS_PRINTER_CLASS | CUPS_PRINTER_IMPLICIT);
- c->type = ~CUPS_PRINTER_REMOTE;
-
- for (i = 0; i < c->num_printers; i ++)
- c->type &= c->printers[i]->type;
-
- c->type |= type;
-
- /*
- * Update the IPP attributes...
- */
-
- if (c->type != oldtype)
- cupsdSetPrinterAttrs(c);
- }
+ cupsdSetPrinterAttrs(c);
}
* in CUPS_DATADIR/model and dynamically generated PPD files using
* the driver helper programs in CUPS_SERVERBIN/driver.
*
- * Copyright 2007-2008 by Apple Inc.
+ * Copyright 2007-2009 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
}
else if (!strncmp(line, "*Product:", 9))
{
- if (sscanf(line, "%*[^\"]\"(%255[^)]", product) == 1)
- cupsArrayAdd(products, strdup(product));
+ if (sscanf(line, "%*[^\"]\"(%255[^\"]", product) == 1)
+ {
+ /*
+ * Make sure the value ends with a right parenthesis - can't stop at
+ * the first right paren since the product name may contain escaped
+ * parenthesis...
+ */
+
+ ptr = product + strlen(product) - 1;
+ if (ptr > product && *ptr == ')')
+ {
+ /*
+ * Yes, ends with a parenthesis, so remove it from the end and
+ * add the product to the list...
+ */
+
+ *ptr = '\0';
+ cupsArrayAdd(products, strdup(product));
+ }
+ }
}
else if (!strncmp(line, "*PSVersion:", 11))
{
*
* IPP routines for the Common UNIX Printing System (CUPS) scheduler.
*
- * Copyright 2007-2008 by Apple Inc.
+ * Copyright 2007-2009 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* This file contains Kerberos support code, copyright 2006 by
* send_ipp_status() - Send a status back to the IPP client.
* set_default() - Set the default destination...
* set_job_attrs() - Set job attributes.
+ * set_printer_attrs() - Set printer attributes.
* set_printer_defaults() - Set printer default options from a request.
* start_printer() - Start a printer.
* stop_printer() - Stop a printer.
static void get_ppds(cupsd_client_t *con);
static void get_printers(cupsd_client_t *con, int type);
static void get_printer_attrs(cupsd_client_t *con, ipp_attribute_t *uri);
+static void get_printer_supported(cupsd_client_t *con, ipp_attribute_t *uri);
static void get_subscription_attrs(cupsd_client_t *con, int sub_id);
static void get_subscriptions(cupsd_client_t *con, ipp_attribute_t *uri);
static const char *get_username(cupsd_client_t *con);
;
static void set_default(cupsd_client_t *con, ipp_attribute_t *uri);
static void set_job_attrs(cupsd_client_t *con, ipp_attribute_t *uri);
+static void set_printer_attrs(cupsd_client_t *con, ipp_attribute_t *uri);
static void set_printer_defaults(cupsd_client_t *con,
cupsd_printer_t *printer);
static void start_printer(cupsd_client_t *con, ipp_attribute_t *uri);
* Then validate the request header and required attributes...
*/
- if (con->request->request.any.version[0] != 1)
+ if (con->request->request.any.version[0] != 1 &&
+ con->request->request.any.version[0] != 2)
{
/*
- * Return an error, since we only support IPP 1.x.
+ * Return an error, since we only support IPP 1.x and 2.x.
*/
cupsdAddEvent(CUPSD_EVENT_SERVER_AUDIT, NULL, NULL,
get_printer_attrs(con, uri);
break;
+ case IPP_GET_PRINTER_SUPPORTED_VALUES :
+ get_printer_supported(con, uri);
+ break;
+
case IPP_HOLD_JOB :
hold_job(con, uri);
break;
set_job_attrs(con, uri);
break;
+ case IPP_SET_PRINTER_ATTRIBUTES :
+ set_printer_attrs(con, uri);
+ break;
+
case IPP_HOLD_NEW_JOBS :
hold_new_jobs(con, uri);
break;
}
+/*
+ * 'get_printer_supported()' - Get printer supported values.
+ */
+
+static void
+get_printer_supported(
+ cupsd_client_t *con, /* I - Client connection */
+ ipp_attribute_t *uri) /* I - Printer URI */
+{
+ http_status_t status; /* Policy status */
+ cups_ptype_t dtype; /* Destination type (printer/class) */
+ cupsd_printer_t *printer; /* Printer/class */
+
+
+ cupsdLogMessage(CUPSD_LOG_DEBUG2, "get_printer_supported(%p[%d], %s)", con,
+ con->http.fd, uri->values[0].string.text);
+
+ /*
+ * Is the destination valid?
+ */
+
+ if (!cupsdValidateDest(uri->values[0].string.text, &dtype, &printer))
+ {
+ /*
+ * Bad URI...
+ */
+
+ send_ipp_status(con, IPP_NOT_FOUND,
+ _("The printer or class was not found."));
+ return;
+ }
+
+ /*
+ * Check policy...
+ */
+
+ if ((status = cupsdCheckPolicy(printer->op_policy_ptr, con, NULL)) != HTTP_OK)
+ {
+ send_http_error(con, status, printer);
+ return;
+ }
+
+ /*
+ * Return a list of attributes that can be set via Set-Printer-Attributes.
+ */
+
+ ippAddInteger(con->response, IPP_TAG_PRINTER, IPP_TAG_ADMINDEFINE,
+ "printer-info", 0);
+ ippAddInteger(con->response, IPP_TAG_PRINTER, IPP_TAG_ADMINDEFINE,
+ "printer-location", 0);
+
+ con->response->request.status.status_code = IPP_OK;
+}
+
+
/*
* 'get_printers()' - Get a list of printers or classes.
*/
}
+/*
+ * 'set_printer_attrs()' - Set printer attributes.
+ */
+
+static void
+set_printer_attrs(cupsd_client_t *con, /* I - Client connection */
+ ipp_attribute_t *uri) /* I - Printer */
+{
+ http_status_t status; /* Policy status */
+ cups_ptype_t dtype; /* Destination type (printer/class) */
+ cupsd_printer_t *printer; /* Printer/class */
+ ipp_attribute_t *attr; /* Printer attribute */
+ int changed; /* Was anything changed? */
+
+
+ cupsdLogMessage(CUPSD_LOG_DEBUG2, "set_printer_attrs(%p[%d], %s)", con,
+ con->http.fd, uri->values[0].string.text);
+
+ /*
+ * Is the destination valid?
+ */
+
+ if (!cupsdValidateDest(uri->values[0].string.text, &dtype, &printer))
+ {
+ /*
+ * Bad URI...
+ */
+
+ send_ipp_status(con, IPP_NOT_FOUND,
+ _("The printer or class was not found."));
+ return;
+ }
+
+ /*
+ * Check policy...
+ */
+
+ if ((status = cupsdCheckPolicy(printer->op_policy_ptr, con, NULL)) != HTTP_OK)
+ {
+ send_http_error(con, status, printer);
+ return;
+ }
+
+ /*
+ * Return a list of attributes that can be set via Set-Printer-Attributes.
+ */
+
+ if ((attr = ippFindAttribute(con->request, "printer-location",
+ IPP_TAG_TEXT)) != NULL)
+ {
+ cupsdSetString(&printer->location, attr->values[0].string.text);
+ changed = 1;
+ }
+
+ if ((attr = ippFindAttribute(con->request, "printer-info",
+ IPP_TAG_TEXT)) != NULL)
+ {
+ cupsdSetString(&printer->info, attr->values[0].string.text);
+ changed = 1;
+ }
+
+ /*
+ * Update the printer attributes and return...
+ */
+
+ if (changed)
+ {
+ cupsdSetPrinterAttrs(printer);
+ cupsdMarkDirty(CUPSD_DIRTY_PRINTERS);
+
+ cupsdAddEvent(CUPSD_EVENT_PRINTER_CONFIG, printer, NULL,
+ "Printer \"%s\" description or location changed by \"%s\".",
+ printer->name, get_username(con));
+
+ cupsdLogMessage(CUPSD_LOG_INFO,
+ "Printer \"%s\" description or location changed by \"%s\".",
+ printer->name, get_username(con));
+ }
+
+ con->response->request.status.status_code = IPP_OK;
+}
+
+
/*
* 'set_printer_defaults()' - Set printer default options from a request.
*/
update_job_attrs(job, 0);
+ /*
+ * Clear the "connecting-to-device" reason, which is only valid when a
+ * printer is processing...
+ */
+
+ cupsdSetPrinterReasons(printer, "-connecting-to-device");
+
if (job->status < 0)
{
/*
if (job->filters[i] > 0)
{
cupsdEndProcess(job->filters[i], force);
- job->filters[i] = 0;
+ if (force)
+ job->filters[i] = 0;
}
if (job->backend > 0)
{
cupsdEndProcess(job->backend, force);
- job->backend = 0;
+ if (force)
+ job->backend = 0;
}
+ if (!force)
+ return;
+
cupsdDestroyProfile(job->profile);
job->profile = NULL;
*
* Printer routines for the Common UNIX Printing System (CUPS).
*
- * Copyright 2007-2008 by Apple Inc.
+ * Copyright 2007-2009 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
*
* Contents:
*
- * cupsdAddPrinter() - Add a printer to the system.
- * cupsdAddPrinterHistory() - Add the current printer state to the history.
- * cupsdAddPrinterUser() - Add a user to the ACL.
- * cupsdCreateCommonData() - Create the common printer data.
- * cupsdDeleteAllPrinters() - Delete all printers from the system.
- * cupsdDeletePrinter() - Delete a printer from the system.
- * cupsdFindPrinter() - Find a printer in the list.
- * cupsdFreePrinterUsers() - Free allow/deny users.
- * cupsdLoadAllPrinters() - Load printers from the printers.conf file.
- * cupsdRenamePrinter() - Rename a printer.
- * cupsdSaveAllPrinters() - Save all printer definitions to the
- * printers.conf file.
- * cupsdSetAuthInfoRequired() - Set the required authentication info.
- * cupsdSetDeviceURI() - Set the device URI for a printer.
- * cupsdSetPrinterAttr() - Set a printer attribute.
- * cupsdSetPrinterAttrs() - Set printer attributes based upon the PPD
- * file.
- * cupsdSetPrinterReasons() - Set/update the reasons strings.
- * cupsdSetPrinterState() - Update the current state of a printer.
- * cupsdStopPrinter() - Stop a printer from printing any jobs...
- * cupsdUpdatePrinters() - Update printers after a partial reload.
- * cupsdValidateDest() - Validate a printer/class destination.
- * cupsdWritePrintcap() - Write a pseudo-printcap file for older
- * applications that need it...
- * add_printer_defaults() - Add name-default attributes to the printer
- * attributes.
- * add_printer_filter() - Add a MIME filter for a printer.
- * add_printer_formats() - Add document-format-supported values for
- * a printer.
- * compare_printers() - Compare two printers.
- * delete_printer_filters() - Delete all MIME filters for a printer.
- * write_irix_config() - Update the config files used by the IRIX
- * desktop tools.
- * write_irix_state() - Update the status files used by IRIX
- * printing desktop tools.
- * write_xml_string() - Write a string with XML escaping.
+ * cupsdAddPrinter() - Add a printer to the system.
+ * cupsdAddPrinterHistory() - Add the current printer state to the history.
+ * cupsdAddPrinterUser() - Add a user to the ACL.
+ * cupsdCreateCommonData() - Create the common printer data.
+ * cupsdDeleteAllPrinters() - Delete all printers from the system.
+ * cupsdDeletePrinter() - Delete a printer from the system.
+ * cupsdFindDest() - Find a destination in the list.
+ * cupsdFindPrinter() - Find a printer in the list.
+ * cupsdFreePrinterUsers() - Free allow/deny users.
+ * cupsdLoadAllPrinters() - Load printers from the printers.conf file.
+ * cupsdRenamePrinter() - Rename a printer.
+ * cupsdSaveAllPrinters() - Save all printer definitions to the
+ * printers.conf file.
+ * cupsdSetAuthInfoRequired() - Set the required authentication info.
+ * cupsdSetDeviceURI() - Set the device URI for a printer.
+ * cupsdSetPrinterAttr() - Set a printer attribute.
+ * cupsdSetPrinterAttrs() - Set printer attributes based upon the PPD
+ * file.
+ * cupsdSetPrinterReasons() - Set/update the reasons strings.
+ * cupsdSetPrinterState() - Update the current state of a printer.
+ * cupsdStopPrinter() - Stop a printer from printing any jobs...
+ * cupsdUpdatePrinterPPD() - Update keywords in a printer's PPD file.
+ * cupsdUpdatePrinters() - Update printers after a partial reload.
+ * cupsdValidateDest() - Validate a printer/class destination.
+ * cupsdWritePrintcap() - Write a pseudo-printcap file for older
+ * applications that need it...
+ * add_printer_defaults() - Add name-default attributes to the printer
+ * attributes.
+ * add_printer_filter() - Add a MIME filter for a printer.
+ * add_printer_formats() - Add document-format-supported values for a
+ * printer.
+ * add_string_array() - Add a string to an array of CUPS strings.
+ * compare_printers() - Compare two printers.
+ * delete_printer_filters() - Delete all MIME filters for a printer.
+ * delete_string_array() - Delete an array of CUPS strings.
+ * load_ppd() - Load a cached PPD file, updating the cache as
+ * needed.
+ * write_irix_config() - Update the config files used by the IRIX
+ * desktop tools.
+ * write_irix_state() - Update the status files used by IRIX printing
+ * desktop tools.
+ * write_xml_string() - Write a string with XML escaping.
*/
/*
#include "cupsd.h"
#include <cups/dir.h>
+#include <cups/pwgmedia.h>
/*
static const char * const versions[] =/* ipp-versions-supported values */
{
"1.0",
- "1.1"
+ "1.1",
+ "2.0",
+ "2.1"
};
static const int ops[] = /* operations-supported values */
{
IPP_PAUSE_PRINTER,
IPP_RESUME_PRINTER,
IPP_PURGE_JOBS,
+ IPP_SET_PRINTER_ATTRIBUTES,
IPP_SET_JOB_ATTRIBUTES,
+ IPP_GET_PRINTER_SUPPORTED_VALUES,
IPP_CREATE_PRINTER_SUBSCRIPTION,
IPP_CREATE_JOB_SUBSCRIPTION,
IPP_GET_SUBSCRIPTION_ATTRIBUTES,
"printer-resolution",
"sides"
};
+ static const char * const printer_settable[] =
+ { /* printer-settable-attributes-supported */
+ "printer-info",
+ "printer-location"
+ };
if (CommonData)
i ++, p = (cupsd_policy_t *)cupsArrayNext(Policies))
attr->values[i].string.text = p->name;
+ /* printer-settable-attributes-supported */
+ ippAddStrings(CommonData, IPP_TAG_PRINTER, IPP_TAG_KEYWORD | IPP_TAG_COPY,
+ "printer-settable-attributes-supported",
+ sizeof(printer_settable) / sizeof(printer_settable[0]),
+ NULL, printer_settable);
+
/* server-is-sharing-printers */
ippAddBoolean(CommonData, IPP_TAG_PRINTER, "server-is-sharing-printers",
BrowseLocalProtocols != 0 && Browsing);
char ppd_name[1024]; /* PPD filename */
struct stat ppd_info; /* PPD file info */
int num_media; /* Number of media options */
- ppd_option_t *input_slot, /* InputSlot options */
- *media_type, /* MediaType options */
- *page_size, /* PageSize options */
- *output_bin, /* OutputBin options */
- *media_quality, /* EFMediaQualityMode options */
+ char custom_in[256], /* Custom size name in inches */
+ custom_mm[256]; /* Custom size name in millimeters */
+ ppd_size_t *size; /* Current size */
+ ppd_option_t *output_bin, /* OutputBin options */
*duplex; /* Duplex options */
ppd_attr_t *ppd_attr; /* PPD attribute */
+ _cups_pwg_media_t *pwgmedia; /* Matching PWG size name */
ipp_attribute_t *attr; /* Attribute data */
ipp_value_t *val; /* Attribute value */
int num_finishings; /* Number of finishings */
{ /* Standard CUPS commands */
"AutoConfigure",
"Clean",
- "PrintSelfTestPage",
- "ReportLevels"
+ "PrintSelfTestPage"
};
* Add make/model and other various attributes...
*/
+ ppdMarkDefaults(ppd);
+
if (ppd->color_device)
p->type |= CUPS_PRINTER_COLOR;
if (ppd->variable_sizes)
* Add media options from the PPD file...
*/
- if ((input_slot = ppdFindOption(ppd, "InputSlot")) != NULL)
- num_media = input_slot->num_choices;
- else
- num_media = 0;
-
- if ((media_type = ppdFindOption(ppd, "MediaType")) != NULL)
- num_media += media_type->num_choices;
-
- if ((page_size = ppdFindOption(ppd, "PageSize")) != NULL)
- num_media += page_size->num_choices;
-
- if ((media_quality = ppdFindOption(ppd, "EFMediaQualityMode")) != NULL)
- num_media += media_quality->num_choices;
-
- if (num_media == 0)
+ if (ppd->num_sizes == 0)
{
cupsdLogMessage(CUPSD_LOG_CRIT,
"The PPD file for printer %s contains no media "
}
else
{
+ num_media = ppd->num_sizes;
+ if (ppd->variable_sizes)
+ num_media ++;
+
attr = ippAddStrings(p->ppd_attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD,
"media-supported", num_media, NULL, NULL);
if (attr != NULL)
{
val = attr->values;
- if (input_slot != NULL)
- for (i = 0; i < input_slot->num_choices; i ++, val ++)
- val->string.text = _cupsStrAlloc(input_slot->choices[i].choice);
+ for (i = ppd->num_sizes, size = ppd->sizes; i > 0; i --, size ++)
+ {
+ if (strcasecmp(size->name, "Custom"))
+ {
+ if ((pwgmedia = _cupsPWGMediaBySize(size->width,
+ size->length)) != NULL)
+ {
+ val->string.text = _cupsStrAlloc(pwgmedia->pwg);
+ }
+ else
+ {
+ snprintf(custom_in, sizeof(custom_in), "adobe_%s_%gx%gin",
+ size->name, size->width / 72.0, size->length / 72.0);
+ snprintf(custom_mm, sizeof(custom_mm), "adobe_%s_%gx%gmm",
+ size->name, size->width * 25.4 / 72.0,
+ size->length * 25.4 / 72.0);
+ if (strlen(custom_in) < strlen(custom_mm))
+ val->string.text = _cupsStrAlloc(custom_in);
+ else
+ val->string.text = _cupsStrAlloc(custom_mm);
+ }
- if (media_type != NULL)
- for (i = 0; i < media_type->num_choices; i ++, val ++)
- val->string.text = _cupsStrAlloc(media_type->choices[i].choice);
+ if (size->marked)
+ ippAddString(p->ppd_attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD,
+ "media-default", NULL,
+ _cupsStrRetain(val->string.text));
- if (media_quality != NULL)
- for (i = 0; i < media_quality->num_choices; i ++, val ++)
- val->string.text = _cupsStrAlloc(media_quality->choices[i].choice);
+ val ++;
+ }
+ }
- if (page_size != NULL)
+ if (ppd->variable_sizes)
{
- for (i = 0; i < page_size->num_choices; i ++, val ++)
- val->string.text = _cupsStrAlloc(page_size->choices[i].choice);
-
- ippAddString(p->ppd_attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD,
- "media-default", NULL, page_size->defchoice);
+ snprintf(custom_in, sizeof(custom_in), "custom_min_%gx%gin",
+ ppd->custom_min[0] / 72.0, ppd->custom_min[1] / 72.0);
+ snprintf(custom_mm, sizeof(custom_mm), "custom_min_%gx%gmm",
+ ppd->custom_min[0] * 25.4 / 72.0,
+ ppd->custom_min[1] * 25.4 / 72.0);
+ if (strlen(custom_in) < strlen(custom_mm))
+ val->string.text = _cupsStrAlloc(custom_in);
+ else
+ val->string.text = _cupsStrAlloc(custom_mm);
+ val ++;
+
+ snprintf(custom_in, sizeof(custom_in), "custom_max_%gx%gin",
+ ppd->custom_max[0] / 72.0, ppd->custom_max[1] / 72.0);
+ snprintf(custom_mm, sizeof(custom_mm), "custom_max_%gx%gmm",
+ ppd->custom_max[0] * 25.4 / 72.0,
+ ppd->custom_max[1] * 25.4 / 72.0);
+ if (strlen(custom_in) < strlen(custom_mm))
+ val->string.text = _cupsStrAlloc(custom_in);
+ else
+ val->string.text = _cupsStrAlloc(custom_mm);
}
- else if (input_slot != NULL)
- ippAddString(p->ppd_attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD,
- "media-default", NULL, input_slot->defchoice);
- else if (media_type != NULL)
- ippAddString(p->ppd_attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD,
- "media-default", NULL, media_type->defchoice);
- else if (media_quality != NULL)
- ippAddString(p->ppd_attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD,
- "media-default", NULL, media_quality->defchoice);
- else
- ippAddString(p->ppd_attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD,
- "media-default", NULL, "none");
}
}
i ++, val ++)
val->string.text = _cupsStrAlloc(output_bin->choices[i].choice);
}
+
+ attr = ippAddString(p->ppd_attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD,
+ "output-bin-default", NULL, output_bin->defchoice);
}
/*
*
* MIME test program for the Common UNIX Printing System (CUPS).
*
- * Copyright 2007-2008 by Apple Inc.
+ * Copyright 2007-2009 by Apple Inc.
* Copyright 1997-2006 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
puts("MIME database types:");
for (src = mimeFirstType(mime); src; src = mimeNextType(mime))
{
- printf("\t%s/%s:\n", src->super, src->type);
+ printf("\t%s/%s (%d):\n", src->super, src->type, src->priority);
print_rules(src->rules);
puts("");
}
*
* MIME typing routines for the Common UNIX Printing System (CUPS).
*
- * Copyright 2007-2008 by Apple Inc.
+ * Copyright 2007-2009 by Apple Inc.
* Copyright 1997-2006 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
length[num_values] = ptr - value[num_values];
if (*rule != ',')
+ {
+ num_values ++;
break;
+ }
rule ++;
}
#
# Standards makefile for the Common UNIX Printing System (CUPS).
#
-# Copyright 2007-2008 by Apple Inc.
+# Copyright 2007-2009 by Apple Inc.
# Copyright 2006 by Easy Software Products.
#
# These coded instructions, statements, and computer programs are the
rfctohtml: rfctohtml.o ../cups/libcups.a
$(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ rfctohtml.o ../cups/libcups.a \
- $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
+ $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
#
<TR><TD> </TD></TR>
<TR><TD CLASS="trailer">Common UNIX Printing System, CUPS, y el logo de CUPS son
marcas registradas de <A HREF="http://www.apple.com">Apple, Inc.</A> Los
-derechos de copia de CUPS 2007-2008 son de Apple Inc.
+derechos de copia de CUPS 2007-2009 son de Apple Inc.
Todos los derechos reservados.</TD></TR>
</TABLE>
</BODY>
<TR><TD> </TD></TR>
<TR><TD CLASS="trailer">The Common UNIX Printing System, CUPS, and the CUPS
logo are trademarks of <A HREF="http://www.apple.com">Apple Inc.</A> CUPS is
-copyright 2007-2008 Apple Inc. All rights reserved.</TD></TR>
+copyright 2007-2009 Apple Inc. All rights reserved.</TD></TR>
</TABLE>
</BODY>
</HTML>
#
# IPP test makefile for the Common UNIX Printing System (CUPS).
#
-# Copyright 2007-2008 by Apple Inc.
+# Copyright 2007-2009 by Apple Inc.
# Copyright 1997-2006 by Easy Software Products, all rights reserved.
#
# These coded instructions, statements, and computer programs are the
ipptest: ipptest.o ../cups/libcups.a
echo Linking $@...
$(CC) $(LDFLAGS) -o ipptest ipptest.o ../cups/libcups.a \
- $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
+ $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
#
fi
# Page log file...
-if grep -q 'testfile.pdf Letter' /tmp/cups-$user/log/page_log; then
+if grep -iq 'testfile.pdf na_letter_8.5x11in' /tmp/cups-$user/log/page_log; then
echo "PASS: page_log formatted correctly."
echo "<P>PASS: page_log formatted correctly.</P>" >>$strfile
else