[prev in list] [next in list] [prev in thread] [next in thread] 

List:       cups-commit
Subject:    [cups.commit] [CUPS] r10693 - in trunk: cups test
From:       cups-dev () easysw ! com
Date:       2012-11-13 15:43:54
Message-ID: 11465-cups.commit () news ! easysw ! com
[Download RAW message or body]

Author: mike
Date: 2012-11-13 07:43:53 -0800 (Tue, 13 Nov 2012)
New Revision: 10693
Log:
More cleanup on deprecation messages (now with messages if the compiler
supports it and we have a replacement function).

Switch ippserver to use httpConnect2 instead of httpConnectEncrypt.

Rename IPP_TAG_CUPS_COPY to IPP_TAG_CUPS_CONST since it is more for const
data than copied/retained data.



Modified:
   trunk/cups/cups.h
   trunk/cups/http-private.h
   trunk/cups/http.h
   trunk/cups/ipp.h
   trunk/cups/raster.h
   trunk/cups/versioning.h
   trunk/test/ippserver.c

Modified: trunk/cups/cups.h
===================================================================
--- trunk/cups/cups.h	2012-11-13 12:57:31 UTC (rev 10692)
+++ trunk/cups/cups.h	2012-11-13 15:43:53 UTC (rev 10693)
@@ -353,12 +353,12 @@
 			               const char *resource);
 extern http_encryption_t cupsEncryption(void);
 extern void		cupsFreeJobs(int num_jobs, cups_job_t *jobs);
-extern int		cupsGetClasses(char ***classes) _CUPS_DEPRECATED;
+extern int		cupsGetClasses(char ***classes) _CUPS_DEPRECATED_MSG("Use cupsGetDests \
instead.");  extern const char	*cupsGetDefault(void);
 extern int		cupsGetJobs(cups_job_t **jobs, const char *name,
 			            int myjobs, int whichjobs);
 extern const char	*cupsGetPPD(const char *name);
-extern int		cupsGetPrinters(char ***printers) _CUPS_DEPRECATED;
+extern int		cupsGetPrinters(char ***printers) _CUPS_DEPRECATED_MSG("Use cupsGetDests \
instead.");  extern ipp_status_t	cupsLastError(void);
 extern int		cupsPrintFile(const char *name, const char *filename,
 			              const char *title, int num_options,
@@ -366,7 +366,7 @@
 extern int		cupsPrintFiles(const char *name, int num_files,
 			               const char **files, const char *title,
 				       int num_options, cups_option_t *options);
-extern char		*cupsTempFile(char *filename, int len) _CUPS_DEPRECATED;
+extern char		*cupsTempFile(char *filename, int len) _CUPS_DEPRECATED_MSG("Use \
cupsTempFd or cupsTempFile2 instead.");  extern int		cupsTempFd(char *filename, int \
len);  
 extern int		cupsAddDest(const char *name, const char *instance,

Modified: trunk/cups/http-private.h
===================================================================
--- trunk/cups/http-private.h	2012-11-13 12:57:31 UTC (rev 10692)
+++ trunk/cups/http-private.h	2012-11-13 15:43:53 UTC (rev 10693)
@@ -403,7 +403,7 @@
  */
 
 #define			_httpAddrFamily(addrp) (addrp)->addr.sa_family
-extern int		_httpAddrPort(http_addr_t *addr) _CUPS_DEPRECATED;
+extern int		_httpAddrPort(http_addr_t *addr) _CUPS_DEPRECATED_MSG("Use httpAddrPort \
instead.");  extern void		_httpAddrSetPort(http_addr_t *addr, int port);
 extern char		*_httpAssembleUUID(const char *server, int port,
 					   const char *name, int number,

Modified: trunk/cups/http.h
===================================================================
--- trunk/cups/http.h	2012-11-13 12:57:31 UTC (rev 10692)
+++ trunk/cups/http.h	2012-11-13 15:43:53 UTC (rev 10693)
@@ -448,10 +448,10 @@
 extern void		httpClearFields(http_t *http);
 extern void		httpClose(http_t *http);
 extern http_t		*httpConnect(const char *host, int port)
-			             _CUPS_DEPRECATED;
+			             _CUPS_DEPRECATED_MSG("Use httpConnect2 instead.");
 extern http_t		*httpConnectEncrypt(const char *host, int port,
 			                    http_encryption_t encryption)
-			                    _CUPS_DEPRECATED;
+			                    _CUPS_DEPRECATED_MSG("Use httpConnect2 instead.");
 extern int		httpDelete(http_t *http, const char *uri);
 extern int		httpEncryption(http_t *http, http_encryption_t e);
 extern int		httpError(http_t *http);
@@ -471,20 +471,20 @@
 extern int		httpPrintf(http_t *http, const char *format, ...)
 			__attribute__ ((__format__ (__printf__, 2, 3)));
 extern int		httpPut(http_t *http, const char *uri);
-extern int		httpRead(http_t *http, char *buffer, int length) _CUPS_DEPRECATED;
-extern int		httpReconnect(http_t *http) _CUPS_DEPRECATED;
+extern int		httpRead(http_t *http, char *buffer, int length) \
_CUPS_DEPRECATED_MSG("Use httpRead2 instead."); +extern int		httpReconnect(http_t \
*http) _CUPS_DEPRECATED_MSG("Use httpReconnect2 instead.");  extern \
void		httpSeparate(const char *uri, char *method,  char *username, char *host, int \
                *port,
-				     char *resource) _CUPS_DEPRECATED;
+				     char *resource) _CUPS_DEPRECATED_MSG("Use httpSeparateURI instead.");
 extern void		httpSetField(http_t *http, http_field_t field,
 			             const char *value);
 extern const char	*httpStatus(http_status_t status);
 extern int		httpTrace(http_t *http, const char *uri);
 extern http_status_t	httpUpdate(http_t *http);
-extern int		httpWrite(http_t *http, const char *buffer, int length) \
                _CUPS_DEPRECATED;
-extern char		*httpEncode64(char *out, const char *in) _CUPS_DEPRECATED;
-extern char		*httpDecode64(char *out, const char *in) _CUPS_DEPRECATED;
-extern int		httpGetLength(http_t *http) _CUPS_DEPRECATED;
+extern int		httpWrite(http_t *http, const char *buffer, int length) \
_CUPS_DEPRECATED_MSG("Use httpWrite2 instead."); +extern char		*httpEncode64(char \
*out, const char *in) _CUPS_DEPRECATED_MSG("Use httpEncode64_2 instead."); +extern \
char		*httpDecode64(char *out, const char *in) _CUPS_DEPRECATED_MSG("Use \
httpDecode64_2 instead."); +extern int		httpGetLength(http_t *http) \
_CUPS_DEPRECATED_MSG("Use httpGetLength2 instead.");  extern char		*httpMD5(const \
char *, const char *, const char *,  char [33]);
 extern char		*httpMD5Final(const char *, const char *, const char *,
@@ -505,7 +505,7 @@
 			              char *method, int methodlen,
 			              char *username, int usernamelen,
 				      char *host, int hostlen, int *port,
-				      char *resource, int resourcelen) _CUPS_DEPRECATED;
+				      char *resource, int resourcelen) _CUPS_DEPRECATED_MSG("Use httpSeparateURI \
instead.");  
 /**** New in CUPS 1.2/OS X 10.5 ****/
 extern int		httpAddrAny(const http_addr_t *addr) _CUPS_API_1_2;

Modified: trunk/cups/ipp.h
===================================================================
--- trunk/cups/ipp.h	2012-11-13 12:57:31 UTC (rev 10692)
+++ trunk/cups/ipp.h	2012-11-13 15:43:53 UTC (rev 10693)
@@ -594,11 +594,11 @@
   IPP_TAG_EXTENSION = 0x7f,		/* Extension point for 32-bit tags */
   IPP_TAG_CUPS_MASK = 0x7fffffff,	/* Mask for copied attribute values @private@ */
   /* The following expression is used to avoid compiler warnings with +/-0x80000000 \
                */
-  IPP_TAG_CUPS_COPY = -0x7fffffff-1	/* Bitflag for copied attribute values @private@ \
*/ +  IPP_TAG_CUPS_CONST = -0x7fffffff-1	/* Bitflag for copied/const attribute values \
@private@ */  
 #  ifndef _CUPS_NO_DEPRECATED
 #    define IPP_TAG_MASK		IPP_TAG_CUPS_MASK
-#    define IPP_TAG_COPY		IPP_TAG_CUPS_COPY
+#    define IPP_TAG_COPY		IPP_TAG_CUPS_CONST
 #  endif /* !_CUPS_NO_DEPRECATED */
 } ipp_tag_t;
 

Modified: trunk/cups/raster.h
===================================================================
--- trunk/cups/raster.h	2012-11-13 12:57:31 UTC (rev 10692)
+++ trunk/cups/raster.h	2012-11-13 15:43:53 UTC (rev 10693)
@@ -368,11 +368,11 @@
 extern void		cupsRasterClose(cups_raster_t *r);
 extern cups_raster_t	*cupsRasterOpen(int fd, cups_mode_t mode);
 extern unsigned		cupsRasterReadHeader(cups_raster_t *r,
-			                     cups_page_header_t *h) _CUPS_DEPRECATED;
+			                     cups_page_header_t *h) _CUPS_DEPRECATED_MSG("Use \
cupsRasterReadHeader2 instead.");  extern \
unsigned		cupsRasterReadPixels(cups_raster_t *r,  unsigned char *p, unsigned len);
 extern unsigned		cupsRasterWriteHeader(cups_raster_t *r,
-			                      cups_page_header_t *h) _CUPS_DEPRECATED;
+			                      cups_page_header_t *h) _CUPS_DEPRECATED_MSG("Use \
cupsRasterWriteHeader2 instead.");  extern \
unsigned		cupsRasterWritePixels(cups_raster_t *r,  unsigned char *p, unsigned len);
 

Modified: trunk/cups/versioning.h
===================================================================
--- trunk/cups/versioning.h	2012-11-13 12:57:31 UTC (rev 10692)
+++ trunk/cups/versioning.h	2012-11-13 15:43:53 UTC (rev 10693)
@@ -78,16 +78,27 @@
  * a warning at compile-time.
  */
 
-#  if defined(__GNUC__) && __GNUC__ > 2 && !defined(_CUPS_SOURCE)
-#    define _CUPS_DEPRECATED __attribute__ ((__deprecated__))
+#  if defined(__GNUC__) && __GNUC__ > 2
+#    if defined(__clang__) && defined(_CUPS_NO_DEPRECATED)
+#      define _CUPS_DEPRECATED __attribute__ ((unavailable))
+#      define _CUPS_DEPRECATED_MSG(m) __attribute__ ((unavailable(m)))
+#    elif !defined(_CUPS_SOURCE) || defined(_CUPS_NO_DEPRECATED)
+#      define _CUPS_DEPRECATED __attribute__ ((deprecated))
+#      define _CUPS_DEPRECATED_MSG(m) __attribute__ ((deprecated(m)))
+#    else
+#      define _CUPS_DEPRECATED
+#      define _CUPS_DEPRECATED_MSG(m)
+#    endif /* !_CUPS_SOURCE || _CUPS_NO_DEPRECATED */
 #  else
 #    define _CUPS_DEPRECATED
-#  endif /* __GNUC__ && __GNUC__ > 2 && !_CUPS_SOURCE */
+#    define _CUPS_DEPRECATED_MSG(m)
+#  endif /* __GNUC__ && __GNUC__ > 2 */
 
 #  ifndef __GNUC__
 #    define __attribute__(x)
 #  endif /* !__GNUC__ */
 
+#
 #endif /* !_CUPS_VERSIONING_H_ */
 
 /*

Modified: trunk/test/ippserver.c
===================================================================
--- trunk/test/ippserver.c	2012-11-13 12:57:31 UTC (rev 10692)
+++ trunk/test/ippserver.c	2012-11-13 15:43:53 UTC (rev 10693)
@@ -375,7 +375,7 @@
 #ifdef HAVE_DNSSD
   const char	*subtype = "_print";	/* Bonjour service subtype */
 #endif /* HAVE_DNSSD */
-  int		port = 8631,		/* Port number (0 = auto) TODO: FIX */
+  int		port = 8631,		/* Port number (0 = auto) */
 		duplex = 0,		/* Duplex mode */
 		ppm = 10,		/* Pages per minute for mono */
 		ppm_color = 0,		/* Pages per minute for color */
@@ -660,57 +660,57 @@
     {
       case IPP_JSTATE_PENDING :
 	  ippAddString(client->response, IPP_TAG_JOB,
-	               IPP_TAG_KEYWORD | IPP_TAG_CUPS_COPY, "job-state-reasons",
+	               IPP_TAG_KEYWORD | IPP_TAG_CUPS_CONST, "job-state-reasons",
 		       NULL, "none");
 	  break;
 
       case IPP_JSTATE_HELD :
           if (job->fd >= 0)
 	    ippAddString(client->response, IPP_TAG_JOB,
-	                 IPP_TAG_KEYWORD | IPP_TAG_CUPS_COPY, "job-state-reasons",
-			 NULL, "job-incoming");
+	                 IPP_TAG_KEYWORD | IPP_TAG_CUPS_CONST,
+	                 "job-state-reasons", NULL, "job-incoming");
 	  else if (ippFindAttribute(job->attrs, "job-hold-until", IPP_TAG_ZERO))
 	    ippAddString(client->response, IPP_TAG_JOB,
-	                 IPP_TAG_KEYWORD | IPP_TAG_CUPS_COPY, "job-state-reasons",
-			 NULL, "job-hold-until-specified");
+	                 IPP_TAG_KEYWORD | IPP_TAG_CUPS_CONST,
+	                 "job-state-reasons", NULL, "job-hold-until-specified");
           else
 	    ippAddString(client->response, IPP_TAG_JOB,
-	                 IPP_TAG_KEYWORD | IPP_TAG_CUPS_COPY, "job-state-reasons",
-			 NULL, "job-data-insufficient");
+	                 IPP_TAG_KEYWORD | IPP_TAG_CUPS_CONST,
+	                 "job-state-reasons", NULL, "job-data-insufficient");
 	  break;
 
       case IPP_JSTATE_PROCESSING :
 	  if (job->cancel)
 	    ippAddString(client->response, IPP_TAG_JOB,
-	                 IPP_TAG_KEYWORD | IPP_TAG_CUPS_COPY, "job-state-reasons",
-			 NULL, "processing-to-stop-point");
+	                 IPP_TAG_KEYWORD | IPP_TAG_CUPS_CONST,
+	                 "job-state-reasons", NULL, "processing-to-stop-point");
 	  else
 	    ippAddString(client->response, IPP_TAG_JOB,
-	                 IPP_TAG_KEYWORD | IPP_TAG_CUPS_COPY, "job-state-reasons",
-			 NULL, "job-printing");
+	                 IPP_TAG_KEYWORD | IPP_TAG_CUPS_CONST,
+	                 "job-state-reasons", NULL, "job-printing");
 	  break;
 
       case IPP_JSTATE_STOPPED :
 	  ippAddString(client->response, IPP_TAG_JOB,
-	               IPP_TAG_KEYWORD | IPP_TAG_CUPS_COPY, "job-state-reasons",
+	               IPP_TAG_KEYWORD | IPP_TAG_CUPS_CONST, "job-state-reasons",
 		       NULL, "job-stopped");
 	  break;
 
       case IPP_JSTATE_CANCELED :
 	  ippAddString(client->response, IPP_TAG_JOB,
-	               IPP_TAG_KEYWORD | IPP_TAG_CUPS_COPY, "job-state-reasons",
+	               IPP_TAG_KEYWORD | IPP_TAG_CUPS_CONST, "job-state-reasons",
 		       NULL, "job-canceled-by-user");
 	  break;
 
       case IPP_JSTATE_ABORTED :
 	  ippAddString(client->response, IPP_TAG_JOB,
-	               IPP_TAG_KEYWORD | IPP_TAG_CUPS_COPY, "job-state-reasons",
+	               IPP_TAG_KEYWORD | IPP_TAG_CUPS_CONST, "job-state-reasons",
 		       NULL, "aborted-by-system");
 	  break;
 
       case IPP_JSTATE_COMPLETED :
 	  ippAddString(client->response, IPP_TAG_JOB,
-	               IPP_TAG_KEYWORD | IPP_TAG_CUPS_COPY, "job-state-reasons",
+	               IPP_TAG_KEYWORD | IPP_TAG_CUPS_CONST, "job-state-reasons",
 		       NULL, "job-completed-successfully");
 	  break;
     }
@@ -830,7 +830,8 @@
                                IPP_TAG_NAME)) != NULL)
     ippSetName(job->attrs, &attr, "job-originating-user-name");
   else
-    attr = ippAddString(job->attrs, IPP_TAG_JOB, IPP_TAG_NAME | IPP_TAG_CUPS_COPY,
+    attr = ippAddString(job->attrs, IPP_TAG_JOB,
+                        IPP_TAG_NAME | IPP_TAG_CUPS_CONST,
                         "job-originating-user-name", NULL, "anonymous");
 
   if (attr)
@@ -1253,11 +1254,13 @@
   printer->attrs = ippNew();
 
   /* charset-configured */
-  ippAddString(printer->attrs, IPP_TAG_PRINTER, IPP_TAG_CHARSET | IPP_TAG_CUPS_COPY,
+  ippAddString(printer->attrs, IPP_TAG_PRINTER,
+               IPP_TAG_CHARSET | IPP_TAG_CUPS_CONST,
                "charset-configured", NULL, "utf-8");
 
   /* charset-supported */
-  ippAddStrings(printer->attrs, IPP_TAG_PRINTER, IPP_TAG_CHARSET | \
IPP_TAG_CUPS_COPY, +  ippAddStrings(printer->attrs, IPP_TAG_PRINTER,
+                IPP_TAG_CHARSET | IPP_TAG_CUPS_CONST,
                 "charset-supported", sizeof(charsets) / sizeof(charsets[0]),
 		NULL, charsets);
 
@@ -1266,7 +1269,8 @@
                 ppm_color > 0);
 
   /* compression-supported */
-  ippAddString(printer->attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD | IPP_TAG_CUPS_COPY,
+  ippAddString(printer->attrs, IPP_TAG_PRINTER,
+               IPP_TAG_KEYWORD | IPP_TAG_CUPS_CONST,
 	       "compression-supported", NULL, "none");
 
   /* copies-default */
@@ -1294,11 +1298,13 @@
                 "finishings-supported", IPP_FINISHINGS_NONE);
 
   /* generated-natural-language-supported */
-  ippAddString(printer->attrs, IPP_TAG_PRINTER, IPP_TAG_LANGUAGE | \
IPP_TAG_CUPS_COPY, +  ippAddString(printer->attrs, IPP_TAG_PRINTER,
+               IPP_TAG_LANGUAGE | IPP_TAG_CUPS_CONST,
                "generated-natural-language-supported", NULL, "en");
 
   /* ipp-versions-supported */
-  ippAddStrings(printer->attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD | \
IPP_TAG_CUPS_COPY, +  ippAddStrings(printer->attrs, IPP_TAG_PRINTER,
+                IPP_TAG_KEYWORD | IPP_TAG_CUPS_CONST,
                 "ipp-versions-supported",
 		sizeof(versions) / sizeof(versions[0]), NULL, versions);
 
@@ -1310,7 +1316,8 @@
                 "job-accounting-user-id-supported", 1);
 
   /* job-creation-attributes-supported */
-  ippAddStrings(printer->attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD | \
IPP_TAG_CUPS_COPY, +  ippAddStrings(printer->attrs, IPP_TAG_PRINTER,
+                IPP_TAG_KEYWORD | IPP_TAG_CUPS_CONST,
                 "job-creation-attributes-supported",
 		sizeof(job_creation) / sizeof(job_creation[0]),
 		NULL, job_creation);
@@ -1332,11 +1339,13 @@
                 "job-priority-supported", 100);
 
   /* job-sheets-default */
-  ippAddString(printer->attrs, IPP_TAG_PRINTER, IPP_TAG_NAME | IPP_TAG_CUPS_COPY,
+  ippAddString(printer->attrs, IPP_TAG_PRINTER,
+               IPP_TAG_NAME | IPP_TAG_CUPS_CONST,
                "job-sheets-default", NULL, "none");
 
   /* job-sheets-supported */
-  ippAddString(printer->attrs, IPP_TAG_PRINTER, IPP_TAG_NAME | IPP_TAG_CUPS_COPY,
+  ippAddString(printer->attrs, IPP_TAG_PRINTER,
+               IPP_TAG_NAME | IPP_TAG_CUPS_CONST,
                "job-sheets-supported", NULL, "none");
 
   /* media-bottom-margin-supported */
@@ -1421,14 +1430,16 @@
   ippDelete(media_col_default);
 
   /* media-col-supported */
-  ippAddStrings(printer->attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD | \
IPP_TAG_CUPS_COPY, +  ippAddStrings(printer->attrs, IPP_TAG_PRINTER,
+                IPP_TAG_KEYWORD | IPP_TAG_CUPS_CONST,
                 "media-col-supported",
 		(int)(sizeof(media_col_supported) /
 		      sizeof(media_col_supported[0])), NULL,
 		media_col_supported);
 
   /* media-default */
-  ippAddString(printer->attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD | IPP_TAG_CUPS_COPY,
+  ippAddString(printer->attrs, IPP_TAG_PRINTER,
+               IPP_TAG_KEYWORD | IPP_TAG_CUPS_CONST,
                "media-default", NULL, media_supported[0]);
 
   /* media-left-margin-supported */
@@ -1446,7 +1457,8 @@
 		 media_xxx_margin_supported);
 
   /* media-supported */
-  ippAddStrings(printer->attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD | \
IPP_TAG_CUPS_COPY, +  ippAddStrings(printer->attrs, IPP_TAG_PRINTER,
+                IPP_TAG_KEYWORD | IPP_TAG_CUPS_CONST,
                 "media-supported",
 		(int)(sizeof(media_supported) / sizeof(media_supported[0])),
 		NULL, media_supported);
@@ -1472,14 +1484,16 @@
 		 media_xxx_margin_supported);
 
   /* media-type-supported */
-  ippAddStrings(printer->attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD | \
IPP_TAG_CUPS_COPY, +  ippAddStrings(printer->attrs, IPP_TAG_PRINTER,
+                IPP_TAG_KEYWORD | IPP_TAG_CUPS_CONST,
                 "media-type-supported",
 		(int)(sizeof(media_type_supported) /
 		      sizeof(media_type_supported[0])),
 		NULL, media_type_supported);
 
   /* multiple-document-handling-supported */
-  ippAddStrings(printer->attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD | \
IPP_TAG_CUPS_COPY, +  ippAddStrings(printer->attrs, IPP_TAG_PRINTER,
+                IPP_TAG_KEYWORD | IPP_TAG_CUPS_CONST,
                 "multiple-document-handling-supported",
                 sizeof(multiple_document_handling) /
 		    sizeof(multiple_document_handling[0]), NULL,
@@ -1490,7 +1504,8 @@
                 "multiple-document-jobs-supported", 0);
 
   /* natural-language-configured */
-  ippAddString(printer->attrs, IPP_TAG_PRINTER, IPP_TAG_LANGUAGE | \
IPP_TAG_CUPS_COPY, +  ippAddString(printer->attrs, IPP_TAG_PRINTER,
+               IPP_TAG_LANGUAGE | IPP_TAG_CUPS_CONST,
                "natural-language-configured", NULL, "en");
 
   /* number-up-default */
@@ -1514,11 +1529,13 @@
                  "orientation-requested-supported", 4, orients);
 
   /* output-bin-default */
-  ippAddString(printer->attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD | IPP_TAG_CUPS_COPY,
+  ippAddString(printer->attrs, IPP_TAG_PRINTER,
+               IPP_TAG_KEYWORD | IPP_TAG_CUPS_CONST,
                "output-bin-default", NULL, "face-down");
 
   /* output-bin-supported */
-  ippAddString(printer->attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD | IPP_TAG_CUPS_COPY,
+  ippAddString(printer->attrs, IPP_TAG_PRINTER,
+               IPP_TAG_KEYWORD | IPP_TAG_CUPS_CONST,
                "output-bin-supported", NULL, "face-down");
 
   /* pages-per-minute */
@@ -1531,7 +1548,8 @@
                   "pages-per-minute-color", ppm_color);
 
   /* pdl-override-supported */
-  ippAddString(printer->attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD | IPP_TAG_CUPS_COPY,
+  ippAddString(printer->attrs, IPP_TAG_PRINTER,
+               IPP_TAG_KEYWORD | IPP_TAG_CUPS_CONST,
                "pdl-override-supported", NULL, "attempted");
 
   /* print-quality-default */
@@ -1605,30 +1623,35 @@
 
   /* reference-uri-scheme-supported */
   ippAddStrings(printer->attrs, IPP_TAG_PRINTER,
-                IPP_TAG_URISCHEME | IPP_TAG_CUPS_COPY,
+                IPP_TAG_URISCHEME | IPP_TAG_CUPS_CONST,
                 "reference-uri-schemes-supported",
                 (int)(sizeof(reference_uri_schemes_supported) /
                       sizeof(reference_uri_schemes_supported[0])),
                 NULL, reference_uri_schemes_supported);
 
   /* sides-default */
-  ippAddString(printer->attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD | IPP_TAG_CUPS_COPY,
+  ippAddString(printer->attrs, IPP_TAG_PRINTER,
+               IPP_TAG_KEYWORD | IPP_TAG_CUPS_CONST,
                "sides-default", NULL, "one-sided");
 
   /* sides-supported */
-  ippAddStrings(printer->attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD | \
IPP_TAG_CUPS_COPY, +  ippAddStrings(printer->attrs, IPP_TAG_PRINTER,
+                IPP_TAG_KEYWORD | IPP_TAG_CUPS_CONST,
                 "sides-supported", duplex ? 3 : 1, NULL, sides_supported);
 
   /* uri-authentication-supported */
-  ippAddString(printer->attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD | IPP_TAG_CUPS_COPY,
+  ippAddString(printer->attrs, IPP_TAG_PRINTER,
+               IPP_TAG_KEYWORD | IPP_TAG_CUPS_CONST,
                "uri-authentication-supported", NULL, "none");
 
   /* uri-security-supported */
-  ippAddString(printer->attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD | IPP_TAG_CUPS_COPY,
+  ippAddString(printer->attrs, IPP_TAG_PRINTER,
+               IPP_TAG_KEYWORD | IPP_TAG_CUPS_CONST,
                "uri-security-supported", NULL, "none");
 
   /* which-jobs-supported */
-  ippAddStrings(printer->attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD | \
IPP_TAG_CUPS_COPY, +  ippAddStrings(printer->attrs, IPP_TAG_PRINTER,
+                IPP_TAG_KEYWORD | IPP_TAG_CUPS_CONST,
                 "which-jobs-supported",
                 sizeof(which_jobs) / sizeof(which_jobs[0]), NULL, which_jobs);
 
@@ -2458,7 +2481,8 @@
 
   if ((job = create_job(client)) == NULL)
   {
-    respond_ipp(client, IPP_STATUS_ERROR_BUSY, "Currently printing another job.");
+    respond_ipp(client, IPP_STATUS_ERROR_BUSY,
+                "Currently printing another job.");
     return;
   }
 
@@ -2680,7 +2704,8 @@
 	(job_comparison == 0 && job->state != job_state) ||
 	(job_comparison > 0 && job->state < job_state) ||
 	job->id < first_job_id ||
-	(username && job->username && _cups_strcasecmp(username, job->username)))
+	(username && job->username &&
+	 _cups_strcasecmp(username, job->username)))
       continue;
 
     if (count > 0)
@@ -2720,7 +2745,7 @@
   _cupsRWLockRead(&(printer->rwlock));
 
   copy_attributes(client->response, printer->attrs, ra, IPP_TAG_ZERO,
-		  IPP_TAG_CUPS_COPY);
+		  IPP_TAG_CUPS_CONST);
 
   if (!ra || cupsArrayFind(ra, "printer-state"))
     ippAddInteger(client->response, IPP_TAG_PRINTER, IPP_TAG_ENUM,
@@ -2730,8 +2755,8 @@
   {
     if (printer->state_reasons == _IPP_PSTATE_NONE)
       ippAddString(client->response, IPP_TAG_PRINTER,
-                   IPP_TAG_KEYWORD | IPP_TAG_CUPS_COPY, "printer-state-reasons",
-		   NULL, "none");
+                   IPP_TAG_KEYWORD | IPP_TAG_CUPS_CONST,
+                   "printer-state-reasons", NULL, "none");
     else
     {
       int			num_reasons = 0;/* Number of reasons */
@@ -2771,8 +2796,8 @@
 	reasons[num_reasons ++] = "toner-low-report";
 
       ippAddStrings(client->response, IPP_TAG_PRINTER,
-                    IPP_TAG_KEYWORD | IPP_TAG_CUPS_COPY,  "printer-state-reasons",
-		    num_reasons, NULL, reasons);
+                    IPP_TAG_KEYWORD | IPP_TAG_CUPS_CONST,
+                    "printer-state-reasons", num_reasons, NULL, reasons);
     }
   }
 
@@ -2832,7 +2857,8 @@
 
   if ((job = create_job(client)) == NULL)
   {
-    respond_ipp(client, IPP_STATUS_ERROR_BUSY, "Currently printing another job.");
+    respond_ipp(client, IPP_STATUS_ERROR_BUSY,
+                "Currently printing another job.");
     return;
   }
 
@@ -2897,7 +2923,8 @@
 
     unlink(filename);
 
-    respond_ipp(client, IPP_STATUS_ERROR_INTERNAL, "Unable to read print file.");
+    respond_ipp(client, IPP_STATUS_ERROR_INTERNAL,
+                "Unable to read print file.");
     return;
   }
 
@@ -2910,8 +2937,8 @@
 
     unlink(filename);
 
-    respond_ipp(client, IPP_STATUS_ERROR_INTERNAL, "Unable to write print file: %s",
-                strerror(error));
+    respond_ipp(client, IPP_STATUS_ERROR_INTERNAL,
+                "Unable to write print file: %s", strerror(error));
     return;
   }
 
@@ -3022,7 +3049,8 @@
 
   if (ippGetCount(uri) != 1)
   {
-    respond_ipp(client, IPP_STATUS_ERROR_BAD_REQUEST, "Too many document-uri \
values."); +    respond_ipp(client, IPP_STATUS_ERROR_BAD_REQUEST,
+                "Too many document-uri values.");
     return;
   }
 
@@ -3043,15 +3071,15 @@
 #endif /* HAVE_SSL */
       strcmp(scheme, "http"))
   {
-    respond_ipp(client, IPP_STATUS_ERROR_URI_SCHEME, "URI scheme \"%s\" not \
                supported.",
-                scheme);
+    respond_ipp(client, IPP_STATUS_ERROR_URI_SCHEME,
+                "URI scheme \"%s\" not supported.", scheme);
     return;
   }
 
   if (!strcmp(scheme, "file") && access(resource, R_OK))
   {
-    respond_ipp(client, IPP_STATUS_ERROR_DOCUMENT_ACCESS, "Unable to access URI: \
                %s",
-                strerror(errno));
+    respond_ipp(client, IPP_STATUS_ERROR_DOCUMENT_ACCESS,
+                "Unable to access URI: %s", strerror(errno));
     return;
   }
 
@@ -3061,7 +3089,8 @@
 
   if ((job = create_job(client)) == NULL)
   {
-    respond_ipp(client, IPP_STATUS_ERROR_BUSY, "Currently printing another job.");
+    respond_ipp(client, IPP_STATUS_ERROR_BUSY,
+                "Currently printing another job.");
     return;
   }
 
@@ -3098,8 +3127,8 @@
   {
     if ((infile = open(resource, O_RDONLY)) < 0)
     {
-      respond_ipp(client, IPP_STATUS_ERROR_DOCUMENT_ACCESS, "Unable to access URI: \
                %s",
-		  strerror(errno));
+      respond_ipp(client, IPP_STATUS_ERROR_DOCUMENT_ACCESS,
+                  "Unable to access URI: %s", strerror(errno));
       return;
     }
 
@@ -3138,7 +3167,8 @@
 #endif /* HAVE_SSL */
     encryption = HTTP_ENCRYPTION_IF_REQUESTED;
 
-    if ((http = httpConnectEncrypt(hostname, port, encryption)) == NULL)
+    if ((http = httpConnect2(hostname, port, NULL, AF_UNSPEC, encryption,
+                             1, 30000, NULL)) == NULL)
     {
       respond_ipp(client, IPP_STATUS_ERROR_DOCUMENT_ACCESS,
                   "Unable to connect to %s: %s", hostname,
@@ -3156,8 +3186,8 @@
     httpSetField(http, HTTP_FIELD_ACCEPT_LANGUAGE, "en");
     if (httpGet(http, resource))
     {
-      respond_ipp(client, IPP_STATUS_ERROR_DOCUMENT_ACCESS, "Unable to GET URI: %s",
-		  strerror(errno));
+      respond_ipp(client, IPP_STATUS_ERROR_DOCUMENT_ACCESS,
+                  "Unable to GET URI: %s", strerror(errno));
 
       job->state = IPP_JSTATE_ABORTED;
 
@@ -3173,8 +3203,8 @@
 
     if (status != HTTP_STATUS_OK)
     {
-      respond_ipp(client, IPP_STATUS_ERROR_DOCUMENT_ACCESS, "Unable to GET URI: %s",
-		  httpStatus(status));
+      respond_ipp(client, IPP_STATUS_ERROR_DOCUMENT_ACCESS,
+                  "Unable to GET URI: %s", httpStatus(status));
 
       job->state = IPP_JSTATE_ABORTED;
 
@@ -3218,8 +3248,8 @@
 
     unlink(filename);
 
-    respond_ipp(client, IPP_STATUS_ERROR_INTERNAL, "Unable to write print file: %s",
-		strerror(error));
+    respond_ipp(client, IPP_STATUS_ERROR_INTERNAL,
+                "Unable to write print file: %s", strerror(error));
     return;
   }
 
@@ -3294,7 +3324,8 @@
 
   if (job->state > IPP_JSTATE_HELD)
   {
-    respond_ipp(client, IPP_STATUS_ERROR_NOT_POSSIBLE, "Job is not in a pending \
state."); +    respond_ipp(client, IPP_STATUS_ERROR_NOT_POSSIBLE,
+                "Job is not in a pending state.");
     httpFlush(client->http);
     return;
   }
@@ -3409,7 +3440,8 @@
 
     unlink(filename);
 
-    respond_ipp(client, IPP_STATUS_ERROR_INTERNAL, "Unable to read print file.");
+    respond_ipp(client, IPP_STATUS_ERROR_INTERNAL,
+                "Unable to read print file.");
     return;
   }
 
@@ -3422,8 +3454,8 @@
 
     unlink(filename);
 
-    respond_ipp(client, IPP_STATUS_ERROR_INTERNAL, "Unable to write print file: %s",
-                strerror(error));
+    respond_ipp(client, IPP_STATUS_ERROR_INTERNAL,
+                "Unable to write print file: %s", strerror(error));
     return;
   }
 
@@ -3524,7 +3556,8 @@
 
   if (job->state > IPP_JSTATE_HELD)
   {
-    respond_ipp(client, IPP_STATUS_ERROR_NOT_POSSIBLE, "Job is not in a pending \
state."); +    respond_ipp(client, IPP_STATUS_ERROR_NOT_POSSIBLE,
+                "Job is not in a pending state.");
     httpFlush(client->http);
     return;
   }
@@ -3586,7 +3619,8 @@
 
   if (ippGetCount(uri) != 1)
   {
-    respond_ipp(client, IPP_STATUS_ERROR_BAD_REQUEST, "Too many document-uri \
values."); +    respond_ipp(client, IPP_STATUS_ERROR_BAD_REQUEST,
+                "Too many document-uri values.");
     return;
   }
 
@@ -3607,15 +3641,15 @@
 #endif /* HAVE_SSL */
       strcmp(scheme, "http"))
   {
-    respond_ipp(client, IPP_STATUS_ERROR_URI_SCHEME, "URI scheme \"%s\" not \
                supported.",
-                scheme);
+    respond_ipp(client, IPP_STATUS_ERROR_URI_SCHEME,
+                "URI scheme \"%s\" not supported.", scheme);
     return;
   }
 
   if (!strcmp(scheme, "file") && access(resource, R_OK))
   {
-    respond_ipp(client, IPP_STATUS_ERROR_DOCUMENT_ACCESS, "Unable to access URI: \
                %s",
-                strerror(errno));
+    respond_ipp(client, IPP_STATUS_ERROR_DOCUMENT_ACCESS,
+                "Unable to access URI: %s", strerror(errno));
     return;
   }
 
@@ -3668,8 +3702,8 @@
   {
     if ((infile = open(resource, O_RDONLY)) < 0)
     {
-      respond_ipp(client, IPP_STATUS_ERROR_DOCUMENT_ACCESS, "Unable to access URI: \
                %s",
-		  strerror(errno));
+      respond_ipp(client, IPP_STATUS_ERROR_DOCUMENT_ACCESS,
+                  "Unable to access URI: %s", strerror(errno));
       return;
     }
 
@@ -3708,7 +3742,8 @@
 #endif /* HAVE_SSL */
     encryption = HTTP_ENCRYPTION_IF_REQUESTED;
 
-    if ((http = httpConnectEncrypt(hostname, port, encryption)) == NULL)
+    if ((http = httpConnect2(hostname, port, NULL, AF_UNSPEC, encryption,
+                             1, 30000, NULL)) == NULL)
     {
       respond_ipp(client, IPP_STATUS_ERROR_DOCUMENT_ACCESS,
                   "Unable to connect to %s: %s", hostname,
@@ -3726,8 +3761,8 @@
     httpSetField(http, HTTP_FIELD_ACCEPT_LANGUAGE, "en");
     if (httpGet(http, resource))
     {
-      respond_ipp(client, IPP_STATUS_ERROR_DOCUMENT_ACCESS, "Unable to GET URI: %s",
-		  strerror(errno));
+      respond_ipp(client, IPP_STATUS_ERROR_DOCUMENT_ACCESS,
+                  "Unable to GET URI: %s", strerror(errno));
 
       job->state = IPP_JSTATE_ABORTED;
 
@@ -3743,8 +3778,8 @@
 
     if (status != HTTP_STATUS_OK)
     {
-      respond_ipp(client, IPP_STATUS_ERROR_DOCUMENT_ACCESS, "Unable to GET URI: %s",
-		  httpStatus(status));
+      respond_ipp(client, IPP_STATUS_ERROR_DOCUMENT_ACCESS,
+                  "Unable to GET URI: %s", httpStatus(status));
 
       job->state = IPP_JSTATE_ABORTED;
 
@@ -3788,8 +3823,8 @@
 
     unlink(filename);
 
-    respond_ipp(client, IPP_STATUS_ERROR_INTERNAL, "Unable to write print file: %s",
-		strerror(error));
+    respond_ipp(client, IPP_STATUS_ERROR_INTERNAL,
+                "Unable to write print file: %s", strerror(error));
     return;
   }
 
@@ -4055,7 +4090,8 @@
           if (!stat(client->printer->icon, &fileinfo) &&
 	      (fd = open(client->printer->icon, O_RDONLY)) >= 0)
 	  {
-	    if (!respond_http(client, HTTP_STATUS_OK, "image/png", fileinfo.st_size))
+	    if (!respond_http(client, HTTP_STATUS_OK, "image/png",
+	                      fileinfo.st_size))
 	    {
 	      close(fd);
 	      return (0);
@@ -4195,7 +4231,8 @@
     respond_ipp(client, IPP_STATUS_ERROR_BAD_REQUEST, "Bad request-id %d.",
                 ippGetRequestId(client->request));
   else if (!ippFirstAttribute(client->request))
-    respond_ipp(client, IPP_STATUS_ERROR_BAD_REQUEST, "No attributes in request.");
+    respond_ipp(client, IPP_STATUS_ERROR_BAD_REQUEST,
+                "No attributes in request.");
   else
   {
    /*
@@ -4277,14 +4314,15 @@
 	* for all operations.
 	*/
 
-	respond_ipp(client, IPP_STATUS_ERROR_BAD_REQUEST, "Missing required attributes.");
+	respond_ipp(client, IPP_STATUS_ERROR_BAD_REQUEST,
+	            "Missing required attributes.");
       }
       else if (strcmp(ippGetString(uri, 0, NULL), client->printer->uri) &&
                strncmp(ippGetString(uri, 0, NULL), client->printer->uri,
 	               client->printer->urilen))
       {
-        respond_ipp(client, IPP_STATUS_ERROR_NOT_FOUND, "%s %s not found.", \
                ippGetName(uri),
-	            ippGetString(uri, 0, NULL));
+        respond_ipp(client, IPP_STATUS_ERROR_NOT_FOUND, "%s %s not found.",
+                    ippGetName(uri), ippGetString(uri, 0, NULL));
       }
       else
       {
@@ -4598,7 +4636,8 @@
 
   httpClearFields(client->http);
 
-  if (code == HTTP_STATUS_METHOD_NOT_ALLOWED || client->operation == \
HTTP_STATE_OPTIONS) +  if (code == HTTP_STATUS_METHOD_NOT_ALLOWED ||
+      client->operation == HTTP_STATE_OPTIONS)
     httpSetField(client->http, HTTP_FIELD_ALLOW, "GET, HEAD, OPTIONS, POST");
 
   if (type)
@@ -4700,8 +4739,9 @@
   ipp_attribute_t	*temp;		/* Copy of attribute */
 
 
-  respond_ipp(client, IPP_STATUS_ERROR_ATTRIBUTES_OR_VALUES, "Unsupported %s %s%s \
                value.",
-	      ippGetName(attr), ippGetCount(attr) > 1 ? "1setOf " : "",
+  respond_ipp(client, IPP_STATUS_ERROR_ATTRIBUTES_OR_VALUES,
+              "Unsupported %s %s%s value.", ippGetName(attr),
+              ippGetCount(attr) > 1 ? "1setOf " : "",
 	      ippTagString(ippGetValueTag(attr)));
 
   temp = ippCopyAttribute(client->response, attr, 0);
@@ -4803,7 +4843,8 @@
 {
   if (!status)
   {
-    puts(CUPS_SVERSION " - Copyright 2010-2012 by Apple Inc. All rights reserved.");
+    puts(CUPS_SVERSION " - Copyright 2010-2012 by Apple Inc. All rights "
+         "reserved.");
     puts("");
   }
 

_______________________________________________
cups-commit mailing list
cups-commit@easysw.com
http://lists.easysw.com/mailman/listinfo/cups-commit


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic