]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Update libcups to not use any deprecated APIs (other than the PPD APIs, that is...)
authormike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Mon, 25 Feb 2013 22:12:59 +0000 (22:12 +0000)
committermike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Mon, 25 Feb 2013 22:12:59 +0000 (22:12 +0000)
git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@10881 7a7537e8-13f0-0310-91df-b6672ffda945

27 files changed:
cups/Makefile
cups/adminutil.c
cups/auth.c
cups/dest-job.c
cups/dest-localization.c
cups/dest-options.c
cups/dest.c
cups/encode.c
cups/getdevices.c
cups/getputfile.c
cups/http-addrlist.c
cups/http-support.c
cups/http.c
cups/http.h
cups/ipp-support.c
cups/ipp.c
cups/notify.c
cups/ppd-cache.c
cups/ppd-private.h
cups/pwg-media.c
cups/request.c
cups/testadmin.c
cups/testcups.c
cups/testhttp.c
cups/testipp.c
cups/usersys.c
cups/util.c

index 6d79173f72b35ec6ca8aeb87ba4f753f953c55d5..ce9af10eb6fe7eab814cb9fd5304057fa8ac3e95 100644 (file)
@@ -3,7 +3,7 @@
 #
 #   API library Makefile for CUPS.
 #
-#   Copyright 2007-2012 by Apple Inc.
+#   Copyright 2007-2013 by Apple Inc.
 #   Copyright 1997-2006 by Easy Software Products, all rights reserved.
 #
 #   These coded instructions, statements, and computer programs are the
 
 include ../Makedefs
 
+
+#
+# Options to build libcups without the use of deprecated APIs...
+#
+
+OPTIONS        =       -D_CUPS_NO_DEPRECATED=1 -D_PPD_DEPRECATED=""
+
+
 #
 # Object files...
 #
index 7a8de0b897873cac9549bf53e7d2c044eb9c0e35..a84a5363eb9d48e2c490687922c3f0c19c055de4 100644 (file)
@@ -3,7 +3,7 @@
  *
  *   Administration utility API definitions for CUPS.
  *
- *   Copyright 2007-2012 by Apple Inc.
+ *   Copyright 2007-2013 by Apple Inc.
  *   Copyright 2001-2007 by Easy Software Products.
  *
  *   These coded instructions, statements, and computer programs are the
@@ -129,7 +129,7 @@ cupsAdminCreateWindowsPPD(
   * Get the supported banner pages, etc. for the printer...
   */
 
-  request = ippNewRequest(IPP_GET_PRINTER_ATTRIBUTES);
+  request = ippNewRequest(IPP_OP_GET_PRINTER_ATTRIBUTES);
 
   httpAssembleURIf(HTTP_URI_CODING_ALL, uri, sizeof(uri), "ipp", NULL,
                    "localhost", 0, "/printers/%s", dest);
@@ -145,7 +145,7 @@ cupsAdminCreateWindowsPPD(
   */
 
   response = cupsDoRequest(http, request, "/");
-  if (!response || cupsLastError() > IPP_OK_CONFLICT)
+  if (!response || cupsLastError() > IPP_STATUS_OK_CONFLICTING)
   {
     unlink(src);
     return (NULL);
@@ -253,7 +253,7 @@ cupsAdminCreateWindowsPPD(
         snprintf(line, sizeof(line),
                 _cupsLangString(language, _("Missing value on line %d.")),
                 linenum);
-        _cupsSetError(IPP_DOCUMENT_FORMAT_ERROR, line, 0);
+        _cupsSetError(IPP_STATUS_ERROR_DOCUMENT_FORMAT_ERROR, line, 0);
 
         cupsFileClose(srcfp);
         cupsFileClose(dstfp);
@@ -272,7 +272,7 @@ cupsAdminCreateWindowsPPD(
                 _cupsLangString(language,
                                 _("Missing double quote on line %d.")),
                 linenum);
-        _cupsSetError(IPP_DOCUMENT_FORMAT_ERROR, line, 0);
+        _cupsSetError(IPP_STATUS_ERROR_DOCUMENT_FORMAT_ERROR, line, 0);
 
         cupsFileClose(srcfp);
         cupsFileClose(dstfp);
@@ -291,7 +291,7 @@ cupsAdminCreateWindowsPPD(
                 _cupsLangString(language,
                                 _("Bad option + choice on line %d.")),
                 linenum);
-        _cupsSetError(IPP_DOCUMENT_FORMAT_ERROR, line, 0);
+        _cupsSetError(IPP_STATUS_ERROR_DOCUMENT_FORMAT_ERROR, line, 0);
 
         cupsFileClose(srcfp);
         cupsFileClose(dstfp);
@@ -334,7 +334,7 @@ cupsAdminCreateWindowsPPD(
 
   if (linenum == 0)
   {
-    _cupsSetError(IPP_DOCUMENT_FORMAT_ERROR, _("Empty PPD file."), 1);
+    _cupsSetError(IPP_STATUS_ERROR_DOCUMENT_FORMAT_ERROR, _("Empty PPD file."), 1);
 
     cupsFileClose(dstfp);
     unlink(buffer);
@@ -424,7 +424,7 @@ cupsAdminExportSamba(
 
   if (!dest || !ppd || !samba_server || !samba_user || !samba_password)
   {
-    _cupsSetError(IPP_INTERNAL_ERROR, strerror(EINVAL), 0);
+    _cupsSetError(IPP_STATUS_ERROR_INTERNAL, strerror(EINVAL), 0);
     return (0);
   }
 
@@ -434,7 +434,7 @@ cupsAdminExportSamba(
 
   if ((fp = cupsTempFile2(authfile, sizeof(authfile))) == NULL)
   {
-    _cupsSetError(IPP_INTERNAL_ERROR, NULL, 0);
+    _cupsSetError(IPP_STATUS_ERROR_INTERNAL, NULL, 0);
     return (0);
   }
 
@@ -487,7 +487,7 @@ cupsAdminExportSamba(
                               _("Unable to copy Windows 2000 printer "
                                 "driver files (%d).")), status);
 
-      _cupsSetError(IPP_INTERNAL_ERROR, message, 0);
+      _cupsSetError(IPP_STATUS_ERROR_INTERNAL, message, 0);
 
       if (logfile)
        _cupsLangPuts(logfile, message);
@@ -522,7 +522,7 @@ cupsAdminExportSamba(
                                 _("Unable to copy CUPS printer driver "
                                   "files (%d).")), status);
 
-       _cupsSetError(IPP_INTERNAL_ERROR, message, 0);
+       _cupsSetError(IPP_STATUS_ERROR_INTERNAL, message, 0);
 
        if (logfile)
          _cupsLangPuts(logfile, message);
@@ -565,7 +565,7 @@ cupsAdminExportSamba(
                               _("Unable to install Windows 2000 printer "
                                 "driver files (%d).")), status);
 
-      _cupsSetError(IPP_INTERNAL_ERROR, message, 0);
+      _cupsSetError(IPP_STATUS_ERROR_INTERNAL, message, 0);
 
       if (logfile)
        _cupsLangPuts(logfile, message);
@@ -610,7 +610,7 @@ cupsAdminExportSamba(
                               _("Unable to copy Windows 9x printer "
                                 "driver files (%d).")), status);
 
-      _cupsSetError(IPP_INTERNAL_ERROR, message, 0);
+      _cupsSetError(IPP_STATUS_ERROR_INTERNAL, message, 0);
 
       if (logfile)
        _cupsLangPuts(logfile, message);
@@ -639,7 +639,7 @@ cupsAdminExportSamba(
                               _("Unable to install Windows 9x printer "
                                 "driver files (%d).")), status);
 
-      _cupsSetError(IPP_INTERNAL_ERROR, message, 0);
+      _cupsSetError(IPP_STATUS_ERROR_INTERNAL, message, 0);
 
       if (logfile)
        _cupsLangPuts(logfile, message);
@@ -691,7 +691,7 @@ cupsAdminExportSamba(
                               _("Unable to copy 64-bit Windows printer "
                                 "driver files (%d).")), status);
 
-      _cupsSetError(IPP_INTERNAL_ERROR, message, 0);
+      _cupsSetError(IPP_STATUS_ERROR_INTERNAL, message, 0);
 
       if (logfile)
        _cupsLangPuts(logfile, message);
@@ -726,7 +726,7 @@ cupsAdminExportSamba(
                                 _("Unable to copy 64-bit CUPS printer driver "
                                   "files (%d).")), status);
 
-       _cupsSetError(IPP_INTERNAL_ERROR, message, 0);
+       _cupsSetError(IPP_STATUS_ERROR_INTERNAL, message, 0);
 
        if (logfile)
          _cupsLangPuts(logfile, message);
@@ -769,7 +769,7 @@ cupsAdminExportSamba(
                               _("Unable to install Windows 2000 printer "
                                 "driver files (%d).")), status);
 
-      _cupsSetError(IPP_INTERNAL_ERROR, message, 0);
+      _cupsSetError(IPP_STATUS_ERROR_INTERNAL, message, 0);
 
       if (logfile)
        _cupsLangPuts(logfile, message);
@@ -794,13 +794,13 @@ cupsAdminExportSamba(
                                "are installed.")),
               sizeof(message));
 
-    _cupsSetError(IPP_NOT_FOUND, message, 0);
+    _cupsSetError(IPP_STATUS_ERROR_NOT_FOUND, message, 0);
     _cupsLangPuts(logfile, message);
   }
 
   if (have_drivers == 0)
   {
-    _cupsSetError(IPP_NOT_FOUND, message, 0);
+    _cupsSetError(IPP_STATUS_ERROR_NOT_FOUND, message, 0);
 
     unlink(authfile);
 
@@ -821,7 +821,7 @@ cupsAdminExportSamba(
                             _("Unable to set Windows printer driver (%d).")),
                             status);
 
-    _cupsSetError(IPP_INTERNAL_ERROR, message, 0);
+    _cupsSetError(IPP_STATUS_ERROR_INTERNAL, message, 0);
 
     if (logfile)
       _cupsLangPuts(logfile, message);
@@ -884,7 +884,7 @@ cupsAdminGetServerSettings(
       if (strcmp(cg->http->hostname, cg->server) ||
           cg->ipp_port != httpAddrPort(cg->http->hostaddr) ||
          (cg->http->encryption != cg->encryption &&
-          cg->http->encryption == HTTP_ENCRYPT_NEVER))
+          cg->http->encryption == HTTP_ENCRYPTION_NEVER))
       {
        /*
        * Need to close the current connection because something has changed...
@@ -905,9 +905,9 @@ cupsAdminGetServerSettings(
                                    cupsEncryption(), 1, 0, NULL)) == NULL)
       {
        if (errno)
-         _cupsSetError(IPP_SERVICE_UNAVAILABLE, NULL, 0);
+         _cupsSetError(IPP_STATUS_ERROR_SERVICE_UNAVAILABLE, NULL, 0);
        else
-         _cupsSetError(IPP_SERVICE_UNAVAILABLE,
+         _cupsSetError(IPP_STATUS_ERROR_SERVICE_UNAVAILABLE,
                        _("Unable to connect to host."), 1);
 
        if (num_settings)
@@ -925,7 +925,7 @@ cupsAdminGetServerSettings(
 
   if (!http || !num_settings || !settings)
   {
-    _cupsSetError(IPP_INTERNAL_ERROR, strerror(EINVAL), 0);
+    _cupsSetError(IPP_STATUS_ERROR_INTERNAL, strerror(EINVAL), 0);
 
     if (num_settings)
       *num_settings = 0;
@@ -944,7 +944,7 @@ cupsAdminGetServerSettings(
   */
 
   if ((status = get_cupsd_conf(http, cg, cg->cupsd_update, cupsdconf,
-                               sizeof(cupsdconf), &remote)) == HTTP_OK)
+                               sizeof(cupsdconf), &remote)) == HTTP_STATUS_OK)
   {
     if ((cupsd = cupsFileOpen(cupsdconf, "r")) == NULL)
     {
@@ -954,7 +954,7 @@ cupsAdminGetServerSettings(
       snprintf(message, sizeof(message),
                _cupsLangString(cupsLangDefault(), _("Open of %s failed: %s")),
                cupsdconf, strerror(errno));
-      _cupsSetError(IPP_INTERNAL_ERROR, message, 0);
+      _cupsSetError(IPP_STATUS_ERROR_INTERNAL, message, 0);
     }
   }
   else
@@ -1136,7 +1136,7 @@ cupsAdminGetServerSettings(
                                           cg->cupsd_num_settings,
                                           &(cg->cupsd_settings));
   }
-  else if (status != HTTP_NOT_MODIFIED)
+  else if (status != HTTP_STATUS_NOT_MODIFIED)
     invalidate_cupsd_cache(cg);
 
  /*
@@ -1220,7 +1220,7 @@ cupsAdminSetServerSettings(
 
   if (!http || !num_settings || !settings)
   {
-    _cupsSetError(IPP_INTERNAL_ERROR, strerror(EINVAL), 0);
+    _cupsSetError(IPP_STATUS_ERROR_INTERNAL, strerror(EINVAL), 0);
 
     return (0);
   }
@@ -1230,11 +1230,11 @@ cupsAdminSetServerSettings(
   */
 
   if (get_cupsd_conf(http, cg, 0, cupsdconf, sizeof(cupsdconf),
-                     &remote) == HTTP_OK)
+                     &remote) == HTTP_STATUS_OK)
   {
     if ((cupsd = cupsFileOpen(cupsdconf, "r")) == NULL)
     {
-      _cupsSetError(IPP_INTERNAL_ERROR, NULL, 0);
+      _cupsSetError(IPP_STATUS_ERROR_INTERNAL, NULL, 0);
       return (0);
     }
   }
@@ -1398,7 +1398,7 @@ cupsAdminSetServerSettings(
     if (remote)
       unlink(cupsdconf);
 
-    _cupsSetError(IPP_INTERNAL_ERROR, NULL, 0);
+    _cupsSetError(IPP_STATUS_ERROR_INTERNAL, NULL, 0);
     return (0);
   }
 
@@ -1954,7 +1954,7 @@ cupsAdminSetServerSettings(
 
   status = cupsPutFile(http, "/admin/conf/cupsd.conf", tempfile);
 
-  if (status == HTTP_CREATED)
+  if (status == HTTP_STATUS_CREATED)
   {
    /*
     * Updated OK, add the basic settings...
@@ -2024,7 +2024,7 @@ cupsAdminSetServerSettings(
 
   unlink(tempfile);
 
-  return (status == HTTP_CREATED);
+  return (status == HTTP_STATUS_CREATED);
 }
 
 
@@ -2158,16 +2158,16 @@ get_cupsd_conf(
       snprintf(message, sizeof(message),
                _cupsLangString(cupsLangDefault(), _("stat of %s failed: %s")),
                name, strerror(errno));
-      _cupsSetError(IPP_INTERNAL_ERROR, message, 0);
+      _cupsSetError(IPP_STATUS_ERROR_INTERNAL, message, 0);
 
       *name = '\0';
 
-      return (HTTP_SERVER_ERROR);
+      return (HTTP_STATUS_SERVER_ERROR);
     }
     else if (last_update && info.st_mtime <= last_update)
-      status = HTTP_NOT_MODIFIED;
+      status = HTTP_STATUS_NOT_MODIFIED;
     else
-      status = HTTP_OK;
+      status = HTTP_STATUS_OK;
   }
   else
 #endif /* !WIN32 */
@@ -2180,11 +2180,11 @@ get_cupsd_conf(
     {
       *name = '\0';
 
-      _cupsSetError(IPP_INTERNAL_ERROR, NULL, 0);
+      _cupsSetError(IPP_STATUS_ERROR_INTERNAL, NULL, 0);
 
       invalidate_cupsd_cache(cg);
 
-      return (HTTP_SERVER_ERROR);
+      return (HTTP_STATUS_SERVER_ERROR);
     }
 
     *remote = 1;
@@ -2199,7 +2199,7 @@ get_cupsd_conf(
 
     close(fd);
 
-    if (status != HTTP_OK)
+    if (status != HTTP_STATUS_OK)
     {
       unlink(name);
       *name = '\0';
index 0bfbb46b6929cae52d158f6bb0bc354fd03007a6..309b9cce114dcc62a5f01ed108b0b2364e1fcdc8 100644 (file)
@@ -3,7 +3,7 @@
  *
  *   Authentication functions for CUPS.
  *
- *   Copyright 2007-2012 by Apple Inc.
+ *   Copyright 2007-2013 by Apple Inc.
  *   Copyright 1997-2007 by Easy Software Products.
  *
  *   This file contains Kerberos support code, copyright 2006 by
@@ -112,7 +112,7 @@ static int  cups_local_auth(http_t *http);
 /*
  * 'cupsDoAuthentication()' - Authenticate a request.
  *
- * This function should be called in response to a @code HTTP_UNAUTHORIZED@
+ * This function should be called in response to a @code HTTP_STATUS_UNAUTHORIZED@
  * status, prior to resubmitting your request.
  *
  * @since CUPS 1.1.20/OS X 10.4@
@@ -164,14 +164,14 @@ cupsDoAuthentication(
       DEBUG_printf(("2cupsDoAuthentication: authstring=\"%s\"",
                     http->authstring));
 
-      if (http->status == HTTP_UNAUTHORIZED)
+      if (http->status == HTTP_STATUS_UNAUTHORIZED)
        http->digest_tries ++;
 
       return (0);
     }
     else if (localauth == -1)
     {
-      http->status = HTTP_AUTHORIZATION_CANCELED;
+      http->status = HTTP_STATUS_CUPS_AUTHORIZATION_CANCELED;
       return (-1);                     /* Error or canceled */
     }
   }
@@ -212,22 +212,22 @@ cupsDoAuthentication(
 
     if ((password = cupsGetPassword2(prompt, http, method, resource)) == NULL)
     {
-      http->status = HTTP_AUTHORIZATION_CANCELED;
+      http->status = HTTP_STATUS_CUPS_AUTHORIZATION_CANCELED;
       return (-1);
     }
 
     snprintf(http->userpass, sizeof(http->userpass), "%s:%s", cupsUser(),
              password);
   }
-  else if (http->status == HTTP_UNAUTHORIZED)
+  else if (http->status == HTTP_STATUS_UNAUTHORIZED)
     http->digest_tries ++;
 
-  if (http->status == HTTP_UNAUTHORIZED && http->digest_tries >= 3)
+  if (http->status == HTTP_STATUS_UNAUTHORIZED && http->digest_tries >= 3)
   {
     DEBUG_printf(("1cupsDoAuthentication: Too many authentication tries (%d)",
                  http->digest_tries));
 
-    http->status = HTTP_AUTHORIZATION_CANCELED;
+    http->status = HTTP_STATUS_CUPS_AUTHORIZATION_CANCELED;
     return (-1);
   }
 
@@ -244,7 +244,7 @@ cupsDoAuthentication(
 
     if (_cupsSetNegotiateAuthString(http, method, resource))
     {
-      http->status = HTTP_AUTHORIZATION_CANCELED;
+      http->status = HTTP_STATUS_CUPS_AUTHORIZATION_CANCELED;
       return (-1);
     }
   }
@@ -287,7 +287,7 @@ cupsDoAuthentication(
   {
     DEBUG_printf(("1cupsDoAuthentication: Unknown auth type: \"%s\"",
                   www_auth));
-    http->status = HTTP_AUTHORIZATION_CANCELED;
+    http->status = HTTP_STATUS_CUPS_AUTHORIZATION_CANCELED;
     return (-1);
   }
 
index c9a0d797fa727493a80d8308c6b12361f1bdbd68..9131b3ca43c156b7891b60f2fbc9ebdc8b218f54 100644 (file)
@@ -3,7 +3,7 @@
  *
  *   Destination job support for CUPS.
  *
- *   Copyright 2012 by Apple Inc.
+ *   Copyright 2012-2013 by Apple Inc.
  *
  *   These coded instructions, statements, and computer programs are the
  *   property of Apple Inc. and are protected by Federal copyright
@@ -34,7 +34,7 @@
  *
  * The "job_id" is the number returned by cupsCreateDestJob.
  *
- * Returns IPP_OK on success and IPP_NOT_AUTHORIZED or IPP_FORBIDDEN on
+ * Returns IPP_STATUS_OK on success and IPP_NOT_AUTHORIZED or IPP_FORBIDDEN on
  * failure.
  *
  * @since CUPS 1.6/OS X 10.8@
@@ -45,7 +45,7 @@ cupsCancelDestJob(http_t      *http,  /* I - Connection to destination */
                   cups_dest_t *dest,   /* I - Destination */
                   int         job_id)  /* I - Job ID */
 {
-  return (IPP_NOT_FOUND);
+  return (IPP_STATUS_ERROR_NOT_FOUND);
 }
 
 
@@ -53,7 +53,7 @@ cupsCancelDestJob(http_t      *http,  /* I - Connection to destination */
  * 'cupsCloseDestJob()' - Close a job and start printing.
  *
  * Use when the last call to cupsStartDocument passed 0 for "last_document".
- * "job_id" is the job ID returned by cupsCreateDestJob. Returns @code IPP_OK@
+ * "job_id" is the job ID returned by cupsCreateDestJob. Returns @code IPP_STATUS_OK@
  * on success.
  *
  * @since CUPS 1.6/OS X 10.8@
@@ -81,9 +81,9 @@ cupsCloseDestJob(
 
   if (!http || !dest || !info || job_id <= 0)
   {
-    _cupsSetError(IPP_INTERNAL_ERROR, strerror(EINVAL), 0);
+    _cupsSetError(IPP_STATUS_ERROR_INTERNAL, strerror(EINVAL), 0);
     DEBUG_puts("1cupsCloseDestJob: Bad arguments.");
-    return (IPP_INTERNAL_ERROR);
+    return (IPP_STATUS_ERROR_INTERNAL);
   }
 
  /*
@@ -94,22 +94,22 @@ cupsCloseDestJob(
                                IPP_TAG_ENUM)) != NULL)
   {
     for (i = 0; i < attr->num_values; i ++)
-      if (attr->values[i].integer == IPP_CLOSE_JOB)
+      if (attr->values[i].integer == IPP_OP_CLOSE_JOB)
       {
-        request = ippNewRequest(IPP_CLOSE_JOB);
+        request = ippNewRequest(IPP_OP_CLOSE_JOB);
         break;
       }
   }
 
   if (!request)
-    request = ippNewRequest(IPP_SEND_DOCUMENT);
+    request = ippNewRequest(IPP_OP_SEND_DOCUMENT);
 
   if (!request)
   {
-    _cupsSetError(IPP_INTERNAL_ERROR, strerror(ENOMEM), 0);
+    _cupsSetError(IPP_STATUS_ERROR_INTERNAL, strerror(ENOMEM), 0);
     DEBUG_puts("1cupsCloseDestJob: Unable to create Close-Job/Send-Document "
                "request.");
-    return (IPP_INTERNAL_ERROR);
+    return (IPP_STATUS_ERROR_INTERNAL);
   }
 
   ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri",
@@ -118,7 +118,7 @@ cupsCloseDestJob(
                 job_id);
   ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "requesting-user-name",
                NULL, cupsUser());
-  if (ippGetOperation(request) == IPP_SEND_DOCUMENT)
+  if (ippGetOperation(request) == IPP_OP_SEND_DOCUMENT)
     ippAddBoolean(request, IPP_TAG_OPERATION, "last-document", 1);
 
  /*
@@ -137,7 +137,7 @@ cupsCloseDestJob(
 /*
  * 'cupsCreateDestJob()' - Create a job on a destination.
  *
- * Returns @code IPP_OK@ or @code IPP_OK_SUBST@ on success, saving the job ID
+ * Returns @code IPP_STATUS_OK@ or @code IPP_STATUS_OK_SUBST@ on success, saving the job ID
  * in the variable pointed to by "job_id".
  *
  * @since CUPS 1.6/OS X 10.8@
@@ -173,20 +173,20 @@ cupsCreateDestJob(
 
   if (!http || !dest || !info || !job_id)
   {
-    _cupsSetError(IPP_INTERNAL_ERROR, strerror(EINVAL), 0);
+    _cupsSetError(IPP_STATUS_ERROR_INTERNAL, strerror(EINVAL), 0);
     DEBUG_puts("1cupsCreateDestJob: Bad arguments.");
-    return (IPP_INTERNAL_ERROR);
+    return (IPP_STATUS_ERROR_INTERNAL);
   }
 
  /*
   * Build a Create-Job request...
   */
 
-  if ((request = ippNewRequest(IPP_CREATE_JOB)) == NULL)
+  if ((request = ippNewRequest(IPP_OP_CREATE_JOB)) == NULL)
   {
-    _cupsSetError(IPP_INTERNAL_ERROR, strerror(ENOMEM), 0);
+    _cupsSetError(IPP_STATUS_ERROR_INTERNAL, strerror(ENOMEM), 0);
     DEBUG_puts("1cupsCreateDestJob: Unable to create Create-Job request.");
-    return (IPP_INTERNAL_ERROR);
+    return (IPP_STATUS_ERROR_INTERNAL);
   }
 
   ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri",
@@ -229,7 +229,7 @@ cupsCreateDestJob(
 /*
  * 'cupsFinishDestDocument()' - Finish the current document.
  *
- * Returns @code IPP_OK@ or @code IPP_OK_SUBST@ on success.
+ * Returns @code IPP_STATUS_OK@ or @code IPP_STATUS_OK_SUBST@ on success.
  *
  * @since CUPS 1.6/OS X 10.8@
  */
@@ -250,9 +250,9 @@ cupsFinishDestDocument(
 
   if (!http || !dest || !info)
   {
-    _cupsSetError(IPP_INTERNAL_ERROR, strerror(EINVAL), 0);
+    _cupsSetError(IPP_STATUS_ERROR_INTERNAL, strerror(EINVAL), 0);
     DEBUG_puts("1cupsFinishDestDocument: Bad arguments.");
-    return (IPP_INTERNAL_ERROR);
+    return (IPP_STATUS_ERROR_INTERNAL);
   }
 
  /*
@@ -310,21 +310,21 @@ cupsStartDestDocument(
 
   if (!http || !dest || !info || job_id <= 0)
   {
-    _cupsSetError(IPP_INTERNAL_ERROR, strerror(EINVAL), 0);
+    _cupsSetError(IPP_STATUS_ERROR_INTERNAL, strerror(EINVAL), 0);
     DEBUG_puts("1cupsStartDestDocument: Bad arguments.");
-    return (HTTP_ERROR);
+    return (HTTP_STATUS_ERROR);
   }
 
  /*
   * Create a Send-Document request...
   */
 
-  if ((request = ippNewRequest(IPP_SEND_DOCUMENT)) == NULL)
+  if ((request = ippNewRequest(IPP_OP_SEND_DOCUMENT)) == NULL)
   {
-    _cupsSetError(IPP_INTERNAL_ERROR, strerror(ENOMEM), 0);
+    _cupsSetError(IPP_STATUS_ERROR_INTERNAL, strerror(ENOMEM), 0);
     DEBUG_puts("1cupsStartDestDocument: Unable to create Send-Document "
                "request.");
-    return (HTTP_ERROR);
+    return (HTTP_STATUS_ERROR);
   }
 
   ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri",
index fb52a9a69010f67f28ed390bf3bd138a2bb40f32..fefb0f9e20cf1b75fd4bf1875ed112059155fb0f 100644 (file)
@@ -3,7 +3,7 @@
  *
  *   Destination localization support for CUPS.
  *
- *   Copyright 2012 by Apple Inc.
+ *   Copyright 2012-2013 by Apple Inc.
  *
  *   These coded instructions, statements, and computer programs are the
  *   property of Apple Inc. and are protected by Federal copyright
@@ -178,7 +178,7 @@ cups_create_localizations(
   if (httpSeparateURI(HTTP_URI_CODING_ALL, attr->values[0].string.text,
                       scheme, sizeof(scheme), userpass, sizeof(userpass),
                       hostname, sizeof(hostname), &port, resource,
-                      sizeof(resource)) < HTTP_URI_OK)
+                      sizeof(resource)) < HTTP_URI_STATUS_OK)
   {
     DEBUG_printf(("4cups_create_localizations: Bad printer-strings-uri value "
                   "\"%s\".", attr->values[0].string.text));
@@ -203,11 +203,12 @@ cups_create_localizations(
     */
 
     if (!strcmp(scheme, "https"))
-      encryption = HTTP_ENCRYPT_ALWAYS;
+      encryption = HTTP_ENCRYPTION_ALWAYS;
     else
-      encryption = HTTP_ENCRYPT_IF_REQUESTED;
+      encryption = HTTP_ENCRYPTION_IF_REQUESTED;
 
-    if ((http2 = httpConnectEncrypt(hostname, port, encryption)) == NULL)
+    if ((http2 = httpConnect2(hostname, port, NULL, AF_UNSPEC, encryption, 1,
+                              30000, NULL)) == NULL)
     {
       DEBUG_printf(("4cups_create_localizations: Unable to connect to "
                     "%s:%d: %s", hostname, port, cupsLastErrorString()));
@@ -233,7 +234,7 @@ cups_create_localizations(
   DEBUG_printf(("4cups_create_localizations: GET %s = %s", resource,
                 httpStatus(status)));
 
-  if (status == HTTP_OK)
+  if (status == HTTP_STATUS_OK)
   {
    /*
     * Got the file, read it...
index 8477ab30ab8849d1d7f597979629c2a7d1baf4c4..873d2e2cd19c924df3a90a71dce369b7d337c7bf 100644 (file)
@@ -3,7 +3,7 @@
  *
  *   Destination option/media support for CUPS.
  *
- *   Copyright 2012 by Apple Inc.
+ *   Copyright 2012-2013 by Apple Inc.
  *
  *   These coded instructions, statements, and computer programs are the
  *   property of Apple Inc. and are protected by Federal copyright
@@ -620,7 +620,7 @@ cupsCopyDestInfo(
     * Send a Get-Printer-Attributes request...
     */
 
-    request = ippNewRequest(IPP_GET_PRINTER_ATTRIBUTES);
+    request = ippNewRequest(IPP_OP_GET_PRINTER_ATTRIBUTES);
     ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL,
                 uri);
     ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "requesting-user-name",
@@ -632,7 +632,7 @@ cupsCopyDestInfo(
     response = cupsDoRequest(http, request, resource);
     status   = cupsLastError();
 
-    if (status > IPP_OK_SUBST)
+    if (status > IPP_STATUS_OK_IGNORED_OR_SUBSTITUTED)
     {
       DEBUG_printf(("cupsCopyDestSupported: Get-Printer-Attributes for '%s' "
                    "returned %s (%s)", dest->name, ippErrorString(status),
@@ -641,9 +641,9 @@ cupsCopyDestInfo(
       ippDelete(response);
       response = NULL;
 
-      if (status == IPP_VERSION_NOT_SUPPORTED && version > 11)
+      if (status == IPP_STATUS_ERROR_VERSION_NOT_SUPPORTED && version > 11)
         version = 11;
-      else if (status == IPP_PRINTER_BUSY)
+      else if (status == IPP_STATUS_ERROR_BUSY)
       {
         sleep(delay);
 
@@ -666,7 +666,7 @@ cupsCopyDestInfo(
 
   if ((dinfo = calloc(1, sizeof(cups_dinfo_t))) == NULL)
   {
-    _cupsSetError(IPP_INTERNAL_ERROR, strerror(errno), 0);
+    _cupsSetError(IPP_STATUS_ERROR_INTERNAL, strerror(errno), 0);
     ippDelete(response);
     return (NULL);
   }
@@ -754,7 +754,7 @@ cupsGetDestMediaByName(
 
   if (!http || !dest || !dinfo || !media || !size)
   {
-    _cupsSetError(IPP_INTERNAL_ERROR, strerror(EINVAL), 0);
+    _cupsSetError(IPP_STATUS_ERROR_INTERNAL, strerror(EINVAL), 0);
     return (0);
   }
 
@@ -766,7 +766,7 @@ cupsGetDestMediaByName(
     if ((pwg = _pwgMediaForLegacy(media)) == NULL)
     {
       DEBUG_printf(("1cupsGetDestMediaByName: Unknown size '%s'.", media));
-      _cupsSetError(IPP_INTERNAL_ERROR, _("Unknown media size name."), 1);
+      _cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("Unknown media size name."), 1);
       return (0);
     }
 
@@ -822,7 +822,7 @@ cupsGetDestMediaBySize(
 
   if (!http || !dest || !dinfo || width <= 0 || length <= 0 || !size)
   {
-    _cupsSetError(IPP_INTERNAL_ERROR, strerror(EINVAL), 0);
+    _cupsSetError(IPP_STATUS_ERROR_INTERNAL, strerror(EINVAL), 0);
     return (0);
   }
 
@@ -834,7 +834,7 @@ cupsGetDestMediaBySize(
   {
     DEBUG_printf(("1cupsGetDestMediaBySize: Invalid size %dx%d.", width,
                   length));
-    _cupsSetError(IPP_INTERNAL_ERROR, _("Invalid media size."), 1);
+    _cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("Invalid media size."), 1);
     return (0);
   }
 
index 4ac40f16c00d4ccef5f95307fa2e8e155aeb1c31..3b14effd737db7f2ff4b3daafdbfed97979b1585 100644 (file)
@@ -635,7 +635,7 @@ cupsConnectDest(
     if (resource)
       *resource = '\0';
 
-    _cupsSetError(IPP_INTERNAL_ERROR, strerror(EINVAL), 0);
+    _cupsSetError(IPP_STATUS_ERROR_INTERNAL, strerror(EINVAL), 0);
     return (NULL);
   }
 
@@ -652,7 +652,7 @@ cupsConnectDest(
   if ((uri = cupsGetOption("printer-uri-supported", dest->num_options,
                            dest->options)) == NULL)
   {
-    _cupsSetError(IPP_INTERNAL_ERROR, strerror(ENOENT), 0);
+    _cupsSetError(IPP_STATUS_ERROR_INTERNAL, strerror(ENOENT), 0);
 
     if (cb)
       (*cb)(user_data, CUPS_DEST_FLAGS_UNCONNECTED | CUPS_DEST_FLAGS_ERROR,
@@ -672,9 +672,9 @@ cupsConnectDest(
 
   if (httpSeparateURI(HTTP_URI_CODING_ALL, uri, scheme, sizeof(scheme),
                       userpass, sizeof(userpass), hostname, sizeof(hostname),
-                      &port, resource, resourcesize) < HTTP_URI_OK)
+                      &port, resource, resourcesize) < HTTP_URI_STATUS_OK)
   {
-    _cupsSetError(IPP_INTERNAL_ERROR, _("Bad printer URI."), 1);
+    _cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("Bad printer URI."), 1);
 
     if (cb)
       (*cb)(user_data, CUPS_DEST_FLAGS_UNCONNECTED | CUPS_DEST_FLAGS_ERROR,
@@ -718,9 +718,9 @@ cupsConnectDest(
   */
 
   if (!strcmp(scheme, "ipps") || port == 443)
-    encryption = HTTP_ENCRYPT_ALWAYS;
+    encryption = HTTP_ENCRYPTION_ALWAYS;
   else
-    encryption = HTTP_ENCRYPT_IF_REQUESTED;
+    encryption = HTTP_ENCRYPTION_IF_REQUESTED;
 
   http = httpConnect2(hostname, port, addrlist, AF_UNSPEC, encryption, 1, 0,
                       NULL);
@@ -933,7 +933,7 @@ cupsEnumDests(
   * Get the list of local printers and pass them to the callback function...
   */
 
-  num_dests = _cupsGetDests(CUPS_HTTP_DEFAULT, CUPS_GET_PRINTERS, NULL, &dests,
+  num_dests = _cupsGetDests(CUPS_HTTP_DEFAULT, IPP_OP_CUPS_GET_PRINTERS, NULL, &dests,
                             type, mask);
 
   for (i = num_dests, dest = dests;
@@ -1301,7 +1301,7 @@ _cupsGetDestResource(
     if (resource)
       *resource = '\0';
 
-    _cupsSetError(IPP_INTERNAL_ERROR, strerror(EINVAL), 0);
+    _cupsSetError(IPP_STATUS_ERROR_INTERNAL, strerror(EINVAL), 0);
     return (NULL);
   }
 
@@ -1315,7 +1315,7 @@ _cupsGetDestResource(
     if (resource)
       *resource = '\0';
 
-    _cupsSetError(IPP_INTERNAL_ERROR, strerror(ENOENT), 0);
+    _cupsSetError(IPP_STATUS_ERROR_INTERNAL, strerror(ENOENT), 0);
 
     return (NULL);
   }
@@ -1330,9 +1330,9 @@ _cupsGetDestResource(
 
   if (httpSeparateURI(HTTP_URI_CODING_ALL, uri, scheme, sizeof(scheme),
                       userpass, sizeof(userpass), hostname, sizeof(hostname),
-                      &port, resource, resourcesize) < HTTP_URI_OK)
+                      &port, resource, resourcesize) < HTTP_URI_STATUS_OK)
   {
-    _cupsSetError(IPP_INTERNAL_ERROR, _("Bad printer URI."), 1);
+    _cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("Bad printer URI."), 1);
 
     return (NULL);
   }
@@ -1344,12 +1344,12 @@ _cupsGetDestResource(
 /*
  * '_cupsGetDests()' - Get destinations from a server.
  *
- * "op" is CUPS_GET_PRINTERS to get a full list, CUPS_GET_DEFAULT to get the
- * system-wide default printer, or IPP_GET_PRINTER_ATTRIBUTES for a known
+ * "op" is IPP_OP_CUPS_GET_PRINTERS to get a full list, IPP_OP_CUPS_GET_DEFAULT to get the
+ * system-wide default printer, or IPP_OP_GET_PRINTER_ATTRIBUTES for a known
  * printer.
  *
  * "name" is the name of an existing printer and is only used when "op" is
- * IPP_GET_PRINTER_ATTRIBUTES.
+ * IPP_OP_GET_PRINTER_ATTRIBUTES.
  *
  * "dest" is initialized to point to the array of destinations.
  *
@@ -1430,13 +1430,13 @@ _cupsGetDests(http_t       *http,       /* I  - Connection to server or
 #endif /* __APPLE__ */
 
  /*
-  * Build a CUPS_GET_PRINTERS or IPP_GET_PRINTER_ATTRIBUTES request, which
+  * Build a IPP_OP_CUPS_GET_PRINTERS or IPP_OP_GET_PRINTER_ATTRIBUTES request, which
   * require the following attributes:
   *
   *    attributes-charset
   *    attributes-natural-language
   *    requesting-user-name
-  *    printer-uri [for IPP_GET_PRINTER_ATTRIBUTES]
+  *    printer-uri [for IPP_OP_GET_PRINTER_ATTRIBUTES]
   */
 
   request = ippNewRequest(op);
@@ -1448,7 +1448,7 @@ _cupsGetDests(http_t       *http, /* I  - Connection to server or
   ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME,
                "requesting-user-name", NULL, cupsUser());
 
-  if (name && op != CUPS_GET_DEFAULT)
+  if (name && op != IPP_OP_CUPS_GET_DEFAULT)
   {
     httpAssembleURIf(HTTP_URI_CODING_ALL, uri, sizeof(uri), "ipp", NULL,
                      "localhost", ippPort(), "/printers/%s", name);
@@ -1681,7 +1681,7 @@ cupsGetDests2(http_t      *http,  /* I - Connection to server or @code CUPS_HTTP_
 
   if (!dests)
   {
-    _cupsSetError(IPP_INTERNAL_ERROR, _("Bad NULL dests pointer"), 1);
+    _cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("Bad NULL dests pointer"), 1);
     return (0);
   }
 
@@ -1690,9 +1690,9 @@ cupsGetDests2(http_t      *http,  /* I - Connection to server or @code CUPS_HTTP_
   */
 
   *dests    = (cups_dest_t *)0;
-  num_dests = _cupsGetDests(http, CUPS_GET_PRINTERS, NULL, dests, 0, 0);
+  num_dests = _cupsGetDests(http, IPP_OP_CUPS_GET_PRINTERS, NULL, dests, 0, 0);
 
-  if (cupsLastError() >= IPP_REDIRECTION_OTHER_SITE)
+  if (cupsLastError() >= IPP_STATUS_REDIRECTION_OTHER_SITE)
   {
     cupsFreeDests(num_dests, *dests);
     *dests = (cups_dest_t *)0;
@@ -1813,7 +1813,7 @@ cupsGetDests2(http_t      *http,  /* I - Connection to server or @code CUPS_HTTP_
   */
 
   if (num_dests > 0)
-    _cupsSetError(IPP_OK, NULL, 0);
+    _cupsSetError(IPP_STATUS_OK, NULL, 0);
 
   return (num_dests);
 }
@@ -1850,7 +1850,7 @@ cupsGetNamedDest(http_t     *http,        /* I - Connection to server or @code CUPS_HTT
                defname[256];           /* Default printer name */
   const char   *home = getenv("HOME"); /* Home directory */
   int          set_as_default = 0;     /* Set returned destination as default */
-  ipp_op_t     op = IPP_GET_PRINTER_ATTRIBUTES;
+  ipp_op_t     op = IPP_OP_GET_PRINTER_ATTRIBUTES;
                                        /* IPP operation to get server ops */
   _cups_globals_t *cg = _cupsGlobals();        /* Pointer to library globals */
 
@@ -1904,7 +1904,7 @@ cupsGetNamedDest(http_t     *http,        /* I - Connection to server or @code CUPS_HTT
       * No locally-set default destination, ask the server...
       */
 
-      op = CUPS_GET_DEFAULT;
+      op = IPP_OP_CUPS_GET_DEFAULT;
     }
   }
 
@@ -1914,7 +1914,7 @@ cupsGetNamedDest(http_t     *http,        /* I - Connection to server or @code CUPS_HTT
 
   if (!_cupsGetDests(http, op, name, &dest, 0, 0))
   {
-    if (op == CUPS_GET_DEFAULT || (name && !set_as_default))
+    if (op == IPP_OP_CUPS_GET_DEFAULT || (name && !set_as_default))
       return (NULL);
 
    /*
@@ -1922,7 +1922,7 @@ cupsGetNamedDest(http_t     *http,        /* I - Connection to server or @code CUPS_HTT
     * configuration file does not exist.  Find out the real default.
     */
 
-    if (!_cupsGetDests(http, CUPS_GET_DEFAULT, NULL, &dest, 0, 0))
+    if (!_cupsGetDests(http, IPP_OP_CUPS_GET_DEFAULT, NULL, &dest, 0, 0))
       return (NULL);
   }
 
@@ -2099,9 +2099,9 @@ cupsSetDests2(http_t      *http,  /* I - Connection to server or @code CUPS_HTTP_
   * Get the server destinations...
   */
 
-  num_temps = _cupsGetDests(http, CUPS_GET_PRINTERS, NULL, &temps, 0, 0);
+  num_temps = _cupsGetDests(http, IPP_OP_CUPS_GET_PRINTERS, NULL, &temps, 0, 0);
 
-  if (cupsLastError() >= IPP_REDIRECTION_OTHER_SITE)
+  if (cupsLastError() >= IPP_STATUS_REDIRECTION_OTHER_SITE)
   {
     cupsFreeDests(num_temps, temps);
     return (-1);
@@ -3407,7 +3407,7 @@ cups_dnssd_resolve(
                             _HTTP_RESOLVE_FQDN, cups_dnssd_resolve_cb,
                             &resolve)) == NULL)
   {
-    _cupsSetError(IPP_INTERNAL_ERROR, _("Unable to resolve printer URI."), 1);
+    _cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("Unable to resolve printer URI."), 1);
 
     if (cb)
       (*cb)(user_data, CUPS_DEST_FLAGS_UNCONNECTED | CUPS_DEST_FLAGS_ERROR,
index adb377a758a38e72c1d11e6040ff57f32c40060c..62516a01dc646f3a50776caab9974b7f3a59d673 100644 (file)
@@ -3,7 +3,7 @@
  *
  *   Option encoding routines for CUPS.
  *
- *   Copyright 2007-2012 by Apple Inc.
+ *   Copyright 2007-2013 by Apple Inc.
  *   Copyright 1997-2007 by Easy Software Products.
  *
  *   These coded instructions, statements, and computer programs are the
 
 static const ipp_op_t ipp_job_creation[] =
 {
-  IPP_PRINT_JOB,
-  IPP_PRINT_URI,
-  IPP_CREATE_JOB,
+  IPP_OP_PRINT_JOB,
+  IPP_OP_PRINT_URI,
+  IPP_OP_CREATE_JOB,
   IPP_OP_CUPS_NONE
 };
 
 static const ipp_op_t ipp_doc_creation[] =
 {
-  IPP_PRINT_JOB,
-  IPP_PRINT_URI,
-  IPP_SEND_DOCUMENT,
-  IPP_SEND_URI,
+  IPP_OP_PRINT_JOB,
+  IPP_OP_PRINT_URI,
+  IPP_OP_SEND_DOCUMENT,
+  IPP_OP_SEND_URI,
   IPP_OP_CUPS_NONE
 };
 
 static const ipp_op_t ipp_sub_creation[] =
 {
-  IPP_PRINT_JOB,
-  IPP_PRINT_URI,
-  IPP_CREATE_JOB,
-  IPP_CREATE_PRINTER_SUBSCRIPTION,
-  IPP_CREATE_JOB_SUBSCRIPTION,
+  IPP_OP_PRINT_JOB,
+  IPP_OP_PRINT_URI,
+  IPP_OP_CREATE_JOB,
+  IPP_OP_CREATE_PRINTER_SUBSCRIPTION,
+  IPP_OP_CREATE_JOB_SUBSCRIPTION,
   IPP_OP_CUPS_NONE
 };
 
 static const ipp_op_t ipp_all_print[] =
 {
-  IPP_PRINT_JOB,
-  IPP_PRINT_URI,
-  IPP_CREATE_JOB,
-  IPP_SEND_DOCUMENT,
-  IPP_SEND_URI,
+  IPP_OP_PRINT_JOB,
+  IPP_OP_PRINT_URI,
+  IPP_OP_CREATE_JOB,
+  IPP_OP_SEND_DOCUMENT,
+  IPP_OP_SEND_URI,
   IPP_OP_CUPS_NONE
 };
 
 static const ipp_op_t ipp_all_limit[] =
 {
-  IPP_GET_JOBS,
-  IPP_GET_PRINTER_ATTRIBUTES,
-  CUPS_GET_PRINTERS,
-  CUPS_GET_CLASSES,
-  CUPS_GET_DEVICES,
-  CUPS_GET_PPDS,
+  IPP_OP_GET_JOBS,
+  IPP_OP_GET_PRINTER_ATTRIBUTES,
+  IPP_OP_CUPS_GET_PRINTERS,
+  IPP_OP_CUPS_GET_CLASSES,
+  IPP_OP_CUPS_GET_DEVICES,
+  IPP_OP_CUPS_GET_PPDS,
   IPP_OP_CUPS_NONE
 };
 
 static const ipp_op_t ipp_set_printer[] =
 {
-  IPP_SET_PRINTER_ATTRIBUTES,
-  CUPS_ADD_MODIFY_PRINTER,
-  CUPS_ADD_MODIFY_CLASS,
+  IPP_OP_SET_PRINTER_ATTRIBUTES,
+  IPP_OP_CUPS_ADD_MODIFY_PRINTER,
+  IPP_OP_CUPS_ADD_MODIFY_CLASS,
   IPP_OP_CUPS_NONE
 };
 
 static const ipp_op_t cups_am_class[] =
 {
-  CUPS_ADD_MODIFY_CLASS,
+  IPP_OP_CUPS_ADD_MODIFY_CLASS,
   IPP_OP_CUPS_NONE
 };
 
 static const ipp_op_t cups_am_printer[] =
 {
-  CUPS_ADD_MODIFY_PRINTER,
+  IPP_OP_CUPS_ADD_MODIFY_PRINTER,
   IPP_OP_CUPS_NONE
 };
 
 static const ipp_op_t cups_schemes[] =
 {
-  CUPS_GET_DEVICES,
-  CUPS_GET_PPDS,
+  IPP_OP_CUPS_GET_DEVICES,
+  IPP_OP_CUPS_GET_PPDS,
   IPP_OP_CUPS_NONE
 };
 
 static const ipp_op_t cups_get_ppds[] =
 {
-  CUPS_GET_PPDS,
+  IPP_OP_CUPS_GET_PPDS,
   IPP_OP_CUPS_NONE
 };
 
 static const ipp_op_t cups_ppd_name[] =
 {
-  CUPS_ADD_MODIFY_PRINTER,
-  CUPS_GET_PPD,
+  IPP_OP_CUPS_ADD_MODIFY_PRINTER,
+  IPP_OP_CUPS_GET_PPD,
   IPP_OP_CUPS_NONE
 };
 
@@ -423,8 +423,8 @@ cupsEncodeOptions2(
   op = ippGetOperation(ipp);
 
   if (group_tag == IPP_TAG_OPERATION &&
-      (op == IPP_PRINT_JOB || op == IPP_PRINT_URI ||
-       op == IPP_SEND_DOCUMENT || op == IPP_SEND_URI))
+      (op == IPP_OP_PRINT_JOB || op == IPP_OP_PRINT_URI ||
+       op == IPP_OP_SEND_DOCUMENT || op == IPP_OP_SEND_URI))
   {
    /*
     * Handle the document format stuff first...
index c1f5a294a21db8f689d2434ca176a4e6053e4a0a..0d539785851df02f4d332241c2afc38e07ec156d 100644 (file)
@@ -3,7 +3,7 @@
  *
  *   cupsGetDevices implementation for CUPS.
  *
- *   Copyright 2008-2012 by Apple Inc.
+ *   Copyright 2008-2013 by Apple Inc.
  *
  *   These coded instructions, statements, and computer programs are the
  *   property of Apple Inc. and are protected by Federal copyright
@@ -71,19 +71,19 @@ cupsGetDevices(
                user_data));
 
   if (!callback)
-    return (IPP_INTERNAL_ERROR);
+    return (IPP_STATUS_ERROR_INTERNAL);
 
   if (!http)
     http = _cupsConnect();
 
   if (!http)
-    return (IPP_SERVICE_UNAVAILABLE);
+    return (IPP_STATUS_ERROR_SERVICE_UNAVAILABLE);
 
  /*
   * Create a CUPS-Get-Devices request...
   */
 
-  request = ippNewRequest(CUPS_GET_DEVICES);
+  request = ippNewRequest(IPP_OP_CUPS_GET_DEVICES);
 
   if (timeout > 0)
     ippAddInteger(request, IPP_TAG_OPERATION, IPP_TAG_INTEGER, "timeout",
@@ -115,14 +115,14 @@ cupsGetDevices(
     status = cupsSendRequest(http, request, "/", ippLength(request));
 
     DEBUG_puts("2cupsGetDevices: Waiting for response status...");
-    while (status == HTTP_CONTINUE)
+    while (status == HTTP_STATUS_CONTINUE)
       status = httpUpdate(http);
 
-    if (status != HTTP_OK)
+    if (status != HTTP_STATUS_OK)
     {
       httpFlush(http);
 
-      if (status == HTTP_UNAUTHORIZED)
+      if (status == HTTP_STATUS_UNAUTHORIZED)
       {
        /*
        * See if we can do authentication...
@@ -131,16 +131,16 @@ cupsGetDevices(
        DEBUG_puts("2cupsGetDevices: Need authorization...");
 
        if (!cupsDoAuthentication(http, "POST", "/"))
-         httpReconnect(http);
+         httpReconnect2(http, 30000, NULL);
        else
        {
-         status = HTTP_AUTHORIZATION_CANCELED;
+         status = HTTP_STATUS_CUPS_AUTHORIZATION_CANCELED;
          break;
        }
       }
 
 #ifdef HAVE_SSL
-      else if (status == HTTP_UPGRADE_REQUIRED)
+      else if (status == HTTP_STATUS_UPGRADE_REQUIRED)
       {
        /*
        * Force a reconnect with encryption...
@@ -148,19 +148,20 @@ cupsGetDevices(
 
        DEBUG_puts("2cupsGetDevices: Need encryption...");
 
-       if (!httpReconnect(http))
-         httpEncryption(http, HTTP_ENCRYPT_REQUIRED);
+       if (!httpReconnect2(http, 30000, NULL))
+         httpEncryption(http, HTTP_ENCRYPTION_REQUIRED);
       }
 #endif /* HAVE_SSL */
     }
   }
-  while (status == HTTP_UNAUTHORIZED || status == HTTP_UPGRADE_REQUIRED);
+  while (status == HTTP_STATUS_UNAUTHORIZED ||
+         status == HTTP_STATUS_UPGRADE_REQUIRED);
 
   DEBUG_printf(("2cupsGetDevices: status=%d", status));
 
   ippDelete(request);
 
-  if (status != HTTP_OK)
+  if (status != HTTP_STATUS_OK)
   {
     _cupsSetHTTPError(status);
     return (cupsLastError());
@@ -186,7 +187,7 @@ cupsGetDevices(
 
   do
   {
-    if ((state = ippRead(http, response)) == IPP_ERROR)
+    if ((state = ippRead(http, response)) == IPP_STATE_ERROR)
       break;
 
     DEBUG_printf(("2cupsGetDevices: state=%d, response->last=%p", state,
@@ -240,7 +241,7 @@ cupsGetDevices(
         device_uri = attr->values[0].string.text;
     }
   }
-  while (state != IPP_DATA);
+  while (state != IPP_STATE_DATA);
 
   DEBUG_printf(("2cupsGetDevices: state=%d, response->last=%p", state,
                response->last));
@@ -257,8 +258,8 @@ cupsGetDevices(
   httpBlocking(http, blocking);
   httpFlush(http);
 
-  if (status == HTTP_ERROR)
-    _cupsSetError(IPP_INTERNAL_ERROR, strerror(http->error), 0);
+  if (status == HTTP_STATUS_ERROR)
+    _cupsSetError(IPP_STATUS_ERROR_INTERNAL, strerror(http->error), 0);
   else
   {
     attr = ippFindAttribute(response, "status-message", IPP_TAG_TEXT);
index c15f3f9691d6728a4231c54e079a4ada95e096d7..4a09099eeeed4553af8db48c544f854b159217e4 100644 (file)
@@ -3,7 +3,7 @@
  *
  *   Get/put file functions for CUPS.
  *
- *   Copyright 2007-2012 by Apple Inc.
+ *   Copyright 2007-2013 by Apple Inc.
  *   Copyright 1997-2006 by Easy Software Products.
  *
  *   These coded instructions, statements, and computer programs are the
@@ -39,7 +39,7 @@
 /*
  * 'cupsGetFd()' - Get a file from the server.
  *
- * This function returns @code HTTP_OK@ when the file is successfully retrieved.
+ * This function returns @code HTTP_STATUS_OK@ when the file is successfully retrieved.
  *
  * @since CUPS 1.1.20/OS X 10.4@
  */
@@ -68,12 +68,12 @@ cupsGetFd(http_t     *http,         /* I - Connection to server or @code CUPS_HTTP_DEFA
     if (http)
       http->error = EINVAL;
 
-    return (HTTP_ERROR);
+    return (HTTP_STATUS_ERROR);
   }
 
   if (!http)
     if ((http = _cupsConnect()) == NULL)
-      return (HTTP_SERVICE_UNAVAILABLE);
+      return (HTTP_STATUS_SERVICE_UNAVAILABLE);
 
  /*
   * Then send GET requests to the HTTP server...
@@ -90,21 +90,21 @@ cupsGetFd(http_t     *http,         /* I - Connection to server or @code CUPS_HTTP_DEFA
 
     if (httpGet(http, resource))
     {
-      if (httpReconnect(http))
+      if (httpReconnect2(http, 30000, NULL))
       {
-        status = HTTP_ERROR;
+        status = HTTP_STATUS_ERROR;
        break;
       }
       else
       {
-        status = HTTP_UNAUTHORIZED;
+        status = HTTP_STATUS_UNAUTHORIZED;
         continue;
       }
     }
 
-    while ((status = httpUpdate(http)) == HTTP_CONTINUE);
+    while ((status = httpUpdate(http)) == HTTP_STATUS_CONTINUE);
 
-    if (status == HTTP_UNAUTHORIZED)
+    if (status == HTTP_STATUS_UNAUTHORIZED)
     {
      /*
       * Flush any error message...
@@ -118,46 +118,46 @@ cupsGetFd(http_t     *http,               /* I - Connection to server or @code CUPS_HTTP_DEFA
 
       if (cupsDoAuthentication(http, "GET", resource))
       {
-        status = HTTP_AUTHORIZATION_CANCELED;
+        status = HTTP_STATUS_CUPS_AUTHORIZATION_CANCELED;
         break;
       }
 
-      if (httpReconnect(http))
+      if (httpReconnect2(http, 30000, NULL))
       {
-        status = HTTP_ERROR;
+        status = HTTP_STATUS_ERROR;
         break;
       }
 
       continue;
     }
 #ifdef HAVE_SSL
-    else if (status == HTTP_UPGRADE_REQUIRED)
+    else if (status == HTTP_STATUS_UPGRADE_REQUIRED)
     {
       /* Flush any error message... */
       httpFlush(http);
 
       /* Reconnect... */
-      if (httpReconnect(http))
+      if (httpReconnect2(http, 30000, NULL))
       {
-        status = HTTP_ERROR;
+        status = HTTP_STATUS_ERROR;
         break;
       }
 
       /* Upgrade with encryption... */
-      httpEncryption(http, HTTP_ENCRYPT_REQUIRED);
+      httpEncryption(http, HTTP_ENCRYPTION_REQUIRED);
 
       /* Try again, this time with encryption enabled... */
       continue;
     }
 #endif /* HAVE_SSL */
   }
-  while (status == HTTP_UNAUTHORIZED || status == HTTP_UPGRADE_REQUIRED);
+  while (status == HTTP_STATUS_UNAUTHORIZED || status == HTTP_STATUS_UPGRADE_REQUIRED);
 
  /*
   * See if we actually got the file or an error...
   */
 
-  if (status == HTTP_OK)
+  if (status == HTTP_STATUS_OK)
   {
    /*
     * Yes, copy the file...
@@ -185,7 +185,7 @@ cupsGetFd(http_t     *http,         /* I - Connection to server or @code CUPS_HTTP_DEFA
 /*
  * 'cupsGetFile()' - Get a file from the server.
  *
- * This function returns @code HTTP_OK@ when the file is successfully retrieved.
+ * This function returns @code HTTP_STATUS_OK@ when the file is successfully retrieved.
  *
  * @since CUPS 1.1.20/OS X 10.4@
  */
@@ -208,7 +208,7 @@ cupsGetFile(http_t     *http,               /* I - Connection to server or @code CUPS_HTTP_DE
     if (http)
       http->error = EINVAL;
 
-    return (HTTP_ERROR);
+    return (HTTP_STATUS_ERROR);
   }
 
  /*
@@ -223,7 +223,7 @@ cupsGetFile(http_t     *http,               /* I - Connection to server or @code CUPS_HTTP_DE
 
     http->error = errno;
 
-    return (HTTP_ERROR);
+    return (HTTP_STATUS_ERROR);
   }
 
  /*
@@ -238,7 +238,7 @@ cupsGetFile(http_t     *http,               /* I - Connection to server or @code CUPS_HTTP_DE
 
   close(fd);
 
-  if (status != HTTP_OK)
+  if (status != HTTP_STATUS_OK)
     unlink(filename);
 
  /*
@@ -252,7 +252,7 @@ cupsGetFile(http_t     *http,               /* I - Connection to server or @code CUPS_HTTP_DE
 /*
  * 'cupsPutFd()' - Put a file on the server.
  *
- * This function returns @code HTTP_CREATED@ when the file is stored
+ * This function returns @code HTTP_STATUS_CREATED@ when the file is stored
  * successfully.
  *
  * @since CUPS 1.1.20/OS X 10.4@
@@ -281,12 +281,12 @@ cupsPutFd(http_t     *http,               /* I - Connection to server or @code CUPS_HTTP_DEFA
     if (http)
       http->error = EINVAL;
 
-    return (HTTP_ERROR);
+    return (HTTP_STATUS_ERROR);
   }
 
   if (!http)
     if ((http = _cupsConnect()) == NULL)
-      return (HTTP_SERVICE_UNAVAILABLE);
+      return (HTTP_STATUS_SERVICE_UNAVAILABLE);
 
  /*
   * Then send PUT requests to the HTTP server...
@@ -302,18 +302,18 @@ cupsPutFd(http_t     *http,               /* I - Connection to server or @code CUPS_HTTP_DEFA
     httpClearFields(http);
     httpSetField(http, HTTP_FIELD_AUTHORIZATION, http->authstring);
     httpSetField(http, HTTP_FIELD_TRANSFER_ENCODING, "chunked");
-    httpSetExpect(http, HTTP_CONTINUE);
+    httpSetExpect(http, HTTP_STATUS_CONTINUE);
 
     if (httpPut(http, resource))
     {
-      if (httpReconnect(http))
+      if (httpReconnect2(http, 30000, NULL))
       {
-        status = HTTP_ERROR;
+        status = HTTP_STATUS_ERROR;
        break;
       }
       else
       {
-        status = HTTP_UNAUTHORIZED;
+        status = HTTP_STATUS_UNAUTHORIZED;
         continue;
       }
     }
@@ -325,9 +325,9 @@ cupsPutFd(http_t     *http,         /* I - Connection to server or @code CUPS_HTTP_DEFA
     if (httpWait(http, 1000))
       status = httpUpdate(http);
     else
-      status = HTTP_CONTINUE;
+      status = HTTP_STATUS_CONTINUE;
 
-    if (status == HTTP_CONTINUE)
+    if (status == HTTP_STATUS_CONTINUE)
     {
      /*
       * Copy the file...
@@ -338,21 +338,21 @@ cupsPutFd(http_t     *http,               /* I - Connection to server or @code CUPS_HTTP_DEFA
       while ((bytes = read(fd, buffer, sizeof(buffer))) > 0)
        if (httpCheck(http))
        {
-          if ((status = httpUpdate(http)) != HTTP_CONTINUE)
+          if ((status = httpUpdate(http)) != HTTP_STATUS_CONTINUE)
             break;
        }
        else
           httpWrite2(http, buffer, bytes);
     }
 
-    if (status == HTTP_CONTINUE)
+    if (status == HTTP_STATUS_CONTINUE)
     {
       httpWrite2(http, buffer, 0);
 
-      while ((status = httpUpdate(http)) == HTTP_CONTINUE);
+      while ((status = httpUpdate(http)) == HTTP_STATUS_CONTINUE);
     }
 
-    if (status == HTTP_ERROR && !retries)
+    if (status == HTTP_STATUS_ERROR && !retries)
     {
       DEBUG_printf(("2cupsPutFd: retry on status %d", status));
 
@@ -362,9 +362,9 @@ cupsPutFd(http_t     *http,         /* I - Connection to server or @code CUPS_HTTP_DEFA
       httpFlush(http);
 
       /* Reconnect... */
-      if (httpReconnect(http))
+      if (httpReconnect2(http, 30000, NULL))
       {
-        status = HTTP_ERROR;
+        status = HTTP_STATUS_ERROR;
         break;
       }
 
@@ -374,7 +374,7 @@ cupsPutFd(http_t     *http,         /* I - Connection to server or @code CUPS_HTTP_DEFA
 
     DEBUG_printf(("2cupsPutFd: status=%d", status));
 
-    if (status == HTTP_UNAUTHORIZED)
+    if (status == HTTP_STATUS_UNAUTHORIZED)
     {
      /*
       * Flush any error message...
@@ -388,47 +388,47 @@ cupsPutFd(http_t     *http,               /* I - Connection to server or @code CUPS_HTTP_DEFA
 
       if (cupsDoAuthentication(http, "PUT", resource))
       {
-        status = HTTP_AUTHORIZATION_CANCELED;
+        status = HTTP_STATUS_CUPS_AUTHORIZATION_CANCELED;
         break;
       }
 
-      if (httpReconnect(http))
+      if (httpReconnect2(http, 30000, NULL))
       {
-        status = HTTP_ERROR;
+        status = HTTP_STATUS_ERROR;
         break;
       }
 
       continue;
     }
 #ifdef HAVE_SSL
-    else if (status == HTTP_UPGRADE_REQUIRED)
+    else if (status == HTTP_STATUS_UPGRADE_REQUIRED)
     {
       /* Flush any error message... */
       httpFlush(http);
 
       /* Reconnect... */
-      if (httpReconnect(http))
+      if (httpReconnect2(http, 30000, NULL))
       {
-        status = HTTP_ERROR;
+        status = HTTP_STATUS_ERROR;
         break;
       }
 
       /* Upgrade with encryption... */
-      httpEncryption(http, HTTP_ENCRYPT_REQUIRED);
+      httpEncryption(http, HTTP_ENCRYPTION_REQUIRED);
 
       /* Try again, this time with encryption enabled... */
       continue;
     }
 #endif /* HAVE_SSL */
   }
-  while (status == HTTP_UNAUTHORIZED || status == HTTP_UPGRADE_REQUIRED ||
-         (status == HTTP_ERROR && retries < 2));
+  while (status == HTTP_STATUS_UNAUTHORIZED || status == HTTP_STATUS_UPGRADE_REQUIRED ||
+         (status == HTTP_STATUS_ERROR && retries < 2));
 
  /*
   * See if we actually put the file or an error...
   */
 
-  if (status != HTTP_CREATED)
+  if (status != HTTP_STATUS_CREATED)
   {
     _cupsSetHTTPError(status);
     httpFlush(http);
@@ -467,7 +467,7 @@ cupsPutFile(http_t     *http,               /* I - Connection to server or @code CUPS_HTTP_DE
     if (http)
       http->error = EINVAL;
 
-    return (HTTP_ERROR);
+    return (HTTP_STATUS_ERROR);
   }
 
  /*
@@ -482,7 +482,7 @@ cupsPutFile(http_t     *http,               /* I - Connection to server or @code CUPS_HTTP_DE
 
     http->error = errno;
 
-    return (HTTP_ERROR);
+    return (HTTP_STATUS_ERROR);
   }
 
  /*
index fd5da4bbe3f1d79fcc073f7be57b8f4b9a7dc325..240e56cd549983a0fe7991ebb61cb08b82dc973d 100644 (file)
@@ -3,7 +3,7 @@
  *
  *   HTTP address list routines for CUPS.
  *
- *   Copyright 2007-2012 by Apple Inc.
+ *   Copyright 2007-2013 by Apple Inc.
  *   Copyright 1997-2007 by Easy Software Products, all rights reserved.
  *
  *   These coded instructions, statements, and computer programs are the
@@ -95,7 +95,7 @@ httpAddrConnect2(
   if (!sock)
   {
     errno = EINVAL;
-    _cupsSetError(IPP_INTERNAL_ERROR, strerror(errno), 0);
+    _cupsSetError(IPP_STATUS_ERROR_INTERNAL, strerror(errno), 0);
     return (NULL);
   }
 
@@ -309,9 +309,9 @@ httpAddrConnect2(
 
   if (!addrlist)
 #ifdef WIN32
-    _cupsSetError(IPP_SERVICE_UNAVAILABLE, "Connection failed", 0);
+    _cupsSetError(IPP_STATUS_ERROR_SERVICE_UNAVAILABLE, "Connection failed", 0);
 #else
-    _cupsSetError(IPP_SERVICE_UNAVAILABLE, strerror(errno), 0);
+    _cupsSetError(IPP_STATUS_ERROR_SERVICE_UNAVAILABLE, strerror(errno), 0);
 #endif /* WIN32 */
 
   return (addrlist);
@@ -549,7 +549,7 @@ httpAddrGetList(const char *hostname,       /* I - Hostname, IP address, or NULL for p
          if (!temp)
          {
            httpAddrFreeList(first);
-           _cupsSetError(IPP_INTERNAL_ERROR, strerror(errno), 0);
+           _cupsSetError(IPP_STATUS_ERROR_INTERNAL, strerror(errno), 0);
            return (NULL);
          }
 
@@ -584,7 +584,7 @@ httpAddrGetList(const char *hostname,       /* I - Hostname, IP address, or NULL for p
       if (error == EAI_FAIL)
         cg->need_res_init = 1;
 
-      _cupsSetError(IPP_INTERNAL_ERROR, gai_strerror(error), 0);
+      _cupsSetError(IPP_STATUS_ERROR_INTERNAL, gai_strerror(error), 0);
     }
 
 #else
@@ -708,7 +708,7 @@ httpAddrGetList(const char *hostname,       /* I - Hostname, IP address, or NULL for p
         if (h_errno == NO_RECOVERY)
           cg->need_res_init = 1;
 
-       _cupsSetError(IPP_INTERNAL_ERROR, hstrerror(h_errno), 0);
+       _cupsSetError(IPP_STATUS_ERROR_INTERNAL, hstrerror(h_errno), 0);
       }
     }
 #endif /* HAVE_GETADDRINFO */
@@ -748,7 +748,7 @@ httpAddrGetList(const char *hostname,       /* I - Hostname, IP address, or NULL for p
     {
       httpAddrFreeList(first);
 
-      _cupsSetError(IPP_INTERNAL_ERROR, _("Unknown service name."), 1);
+      _cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("Unknown service name."), 1);
       return (NULL);
     }
 
@@ -771,7 +771,7 @@ httpAddrGetList(const char *hostname,       /* I - Hostname, IP address, or NULL for p
        temp = (http_addrlist_t *)calloc(1, sizeof(http_addrlist_t));
        if (!temp)
        {
-         _cupsSetError(IPP_INTERNAL_ERROR, strerror(errno), 0);
+         _cupsSetError(IPP_STATUS_ERROR_INTERNAL, strerror(errno), 0);
          httpAddrFreeList(first);
          return (NULL);
        }
@@ -800,7 +800,7 @@ httpAddrGetList(const char *hostname,       /* I - Hostname, IP address, or NULL for p
        temp = (http_addrlist_t *)calloc(1, sizeof(http_addrlist_t));
        if (!temp)
        {
-         _cupsSetError(IPP_INTERNAL_ERROR, strerror(errno), 0);
+         _cupsSetError(IPP_STATUS_ERROR_INTERNAL, strerror(errno), 0);
          httpAddrFreeList(first);
          return (NULL);
        }
@@ -832,7 +832,7 @@ httpAddrGetList(const char *hostname,       /* I - Hostname, IP address, or NULL for p
        temp = (http_addrlist_t *)calloc(1, sizeof(http_addrlist_t));
        if (!temp)
        {
-         _cupsSetError(IPP_INTERNAL_ERROR, strerror(errno), 0);
+         _cupsSetError(IPP_STATUS_ERROR_INTERNAL, strerror(errno), 0);
          httpAddrFreeList(first);
          return (NULL);
        }
@@ -856,7 +856,7 @@ httpAddrGetList(const char *hostname,       /* I - Hostname, IP address, or NULL for p
        temp = (http_addrlist_t *)calloc(1, sizeof(http_addrlist_t));
        if (!temp)
        {
-         _cupsSetError(IPP_INTERNAL_ERROR, strerror(errno), 0);
+         _cupsSetError(IPP_STATUS_ERROR_INTERNAL, strerror(errno), 0);
          httpAddrFreeList(first);
          return (NULL);
        }
index fe2041c8a3060654930b57e40fe231ecf9d6c77c..e75881efbdadca2ccfbd781137444d787344de40 100644 (file)
@@ -193,7 +193,7 @@ httpAssembleURI(
     if (uri)
       *uri = '\0';
 
-    return (HTTP_URI_BAD_ARGUMENTS);
+    return (HTTP_URI_STATUS_BAD_ARGUMENTS);
   }
 
  /*
@@ -391,7 +391,7 @@ httpAssembleURI(
 
   *ptr = '\0';
 
-  return (HTTP_URI_OK);
+  return (HTTP_URI_STATUS_OK);
 
  /*
   * Clear the URI string and return an overflow error; I don't usually
@@ -401,7 +401,7 @@ httpAssembleURI(
   assemble_overflow:
 
   *uri = '\0';
-  return (HTTP_URI_OVERFLOW);
+  return (HTTP_URI_STATUS_OVERFLOW);
 }
 
 
@@ -444,7 +444,7 @@ httpAssembleURIf(
     if (uri)
       *uri = '\0';
 
-    return (HTTP_URI_BAD_ARGUMENTS);
+    return (HTTP_URI_STATUS_BAD_ARGUMENTS);
   }
 
  /*
@@ -458,7 +458,7 @@ httpAssembleURIf(
   if (bytes >= sizeof(resource))
   {
     *uri = '\0';
-    return (HTTP_URI_OVERFLOW);
+    return (HTTP_URI_STATUS_OVERFLOW);
   }
   else
     return (httpAssembleURI(encoding,  uri, urilen, scheme, username, host,
@@ -978,16 +978,16 @@ httpSeparateURI(
   if (!uri || !port || !scheme || schemelen <= 0 || !username ||
       usernamelen <= 0 || !host || hostlen <= 0 || !resource ||
       resourcelen <= 0)
-    return (HTTP_URI_BAD_ARGUMENTS);
+    return (HTTP_URI_STATUS_BAD_ARGUMENTS);
 
   if (!*uri)
-    return (HTTP_URI_BAD_URI);
+    return (HTTP_URI_STATUS_BAD_URI);
 
  /*
   * Grab the scheme portion of the URI...
   */
 
-  status = HTTP_URI_OK;
+  status = HTTP_URI_STATUS_OK;
 
   if (!strncmp(uri, "//", 2))
   {
@@ -996,7 +996,7 @@ httpSeparateURI(
     */
 
     strlcpy(scheme, "ipp", schemelen);
-    status = HTTP_URI_MISSING_SCHEME;
+    status = HTTP_URI_STATUS_MISSING_SCHEME;
   }
   else if (*uri == '/')
   {
@@ -1005,7 +1005,7 @@ httpSeparateURI(
     */
 
     strlcpy(scheme, "file", schemelen);
-    status = HTTP_URI_MISSING_SCHEME;
+    status = HTTP_URI_STATUS_MISSING_SCHEME;
   }
   else
   {
@@ -1027,7 +1027,7 @@ httpSeparateURI(
     if (*uri != ':')
     {
       *scheme = '\0';
-      return (HTTP_URI_BAD_SCHEME);
+      return (HTTP_URI_STATUS_BAD_SCHEME);
     }
 
     uri ++;
@@ -1048,7 +1048,7 @@ httpSeparateURI(
   else if (!strcmp(scheme, "socket"))  /* Not yet registered with IANA... */
     *port = 9100;
   else if (strcmp(scheme, "file") && strcmp(scheme, "mailto"))
-    status = HTTP_URI_UNKNOWN_SCHEME;
+    status = HTTP_URI_STATUS_UNKNOWN_SCHEME;
 
  /*
   * Now see if we have a hostname...
@@ -1078,7 +1078,7 @@ httpSeparateURI(
       if (!uri)
       {
         *username = '\0';
-        return (HTTP_URI_BAD_USERNAME);
+        return (HTTP_URI_STATUS_BAD_USERNAME);
       }
 
       uri ++;
@@ -1104,7 +1104,7 @@ httpSeparateURI(
       if (!uri)
       {
         *host = '\0';
-        return (HTTP_URI_BAD_HOSTNAME);
+        return (HTTP_URI_STATUS_BAD_HOSTNAME);
       }
 
      /*
@@ -1114,7 +1114,7 @@ httpSeparateURI(
       if (*uri != ']')
       {
         *host = '\0';
-        return (HTTP_URI_BAD_HOSTNAME);
+        return (HTTP_URI_STATUS_BAD_HOSTNAME);
       }
 
       uri ++;
@@ -1132,7 +1132,7 @@ httpSeparateURI(
        else if (*ptr != ':' && *ptr != '.' && !isxdigit(*ptr & 255))
        {
          *host = '\0';
-         return (HTTP_URI_BAD_HOSTNAME);
+         return (HTTP_URI_STATUS_BAD_HOSTNAME);
        }
     }
     else
@@ -1152,7 +1152,7 @@ httpSeparateURI(
                         "!$&'()*+,;=\\", *ptr))
        {
          *host = '\0';
-         return (HTTP_URI_BAD_HOSTNAME);
+         return (HTTP_URI_STATUS_BAD_HOSTNAME);
        }
 
      /*
@@ -1165,7 +1165,7 @@ httpSeparateURI(
       if (!uri)
       {
         *host = '\0';
-        return (HTTP_URI_BAD_HOSTNAME);
+        return (HTTP_URI_STATUS_BAD_HOSTNAME);
       }
     }
 
@@ -1177,7 +1177,7 @@ httpSeparateURI(
     if (!strcmp(scheme, "file") && strcmp(host, "localhost") && host[0])
     {
       *host = '\0';
-      return (HTTP_URI_BAD_HOSTNAME);
+      return (HTTP_URI_STATUS_BAD_HOSTNAME);
     }
 
    /*
@@ -1193,7 +1193,7 @@ httpSeparateURI(
       if (!isdigit(uri[1] & 255))
       {
         *port = 0;
-        return (HTTP_URI_BAD_PORT);
+        return (HTTP_URI_STATUS_BAD_PORT);
       }
 
       *port = strtol(uri + 1, (char **)&uri, 10);
@@ -1201,7 +1201,7 @@ httpSeparateURI(
       if (*uri != '/' && *uri)
       {
         *port = 0;
-        return (HTTP_URI_BAD_PORT);
+        return (HTTP_URI_STATUS_BAD_PORT);
       }
     }
   }
@@ -1216,7 +1216,7 @@ httpSeparateURI(
     * Hostname but no path...
     */
 
-    status    = HTTP_URI_MISSING_RESOURCE;
+    status    = HTTP_URI_STATUS_MISSING_RESOURCE;
     *resource = '/';
 
    /*
@@ -1250,7 +1250,7 @@ httpSeparateURI(
   if (!uri)
   {
     *resource = '\0';
-    return (HTTP_URI_BAD_RESOURCE);
+    return (HTTP_URI_STATUS_BAD_RESOURCE);
   }
 
  /*
@@ -1280,74 +1280,74 @@ httpStatus(http_status_t status)        /* I - HTTP status code */
 
   switch (status)
   {
-    case HTTP_CONTINUE :
+    case HTTP_STATUS_CONTINUE :
         s = _("Continue");
        break;
-    case HTTP_SWITCHING_PROTOCOLS :
+    case HTTP_STATUS_SWITCHING_PROTOCOLS :
         s = _("Switching Protocols");
        break;
-    case HTTP_OK :
+    case HTTP_STATUS_OK :
         s = _("OK");
        break;
-    case HTTP_CREATED :
+    case HTTP_STATUS_CREATED :
         s = _("Created");
        break;
-    case HTTP_ACCEPTED :
+    case HTTP_STATUS_ACCEPTED :
         s = _("Accepted");
        break;
-    case HTTP_NO_CONTENT :
+    case HTTP_STATUS_NO_CONTENT :
         s = _("No Content");
        break;
-    case HTTP_MOVED_PERMANENTLY :
+    case HTTP_STATUS_MOVED_PERMANENTLY :
         s = _("Moved Permanently");
        break;
-    case HTTP_SEE_OTHER :
+    case HTTP_STATUS_SEE_OTHER :
         s = _("See Other");
        break;
-    case HTTP_NOT_MODIFIED :
+    case HTTP_STATUS_NOT_MODIFIED :
         s = _("Not Modified");
        break;
-    case HTTP_BAD_REQUEST :
+    case HTTP_STATUS_BAD_REQUEST :
         s = _("Bad Request");
        break;
-    case HTTP_UNAUTHORIZED :
-    case HTTP_AUTHORIZATION_CANCELED :
+    case HTTP_STATUS_UNAUTHORIZED :
+    case HTTP_STATUS_CUPS_AUTHORIZATION_CANCELED :
         s = _("Unauthorized");
        break;
-    case HTTP_FORBIDDEN :
+    case HTTP_STATUS_FORBIDDEN :
         s = _("Forbidden");
        break;
-    case HTTP_NOT_FOUND :
+    case HTTP_STATUS_NOT_FOUND :
         s = _("Not Found");
        break;
-    case HTTP_REQUEST_TOO_LARGE :
+    case HTTP_STATUS_REQUEST_TOO_LARGE :
         s = _("Request Entity Too Large");
        break;
-    case HTTP_URI_TOO_LONG :
+    case HTTP_STATUS_URI_TOO_LONG :
         s = _("URI Too Long");
        break;
-    case HTTP_UPGRADE_REQUIRED :
+    case HTTP_STATUS_UPGRADE_REQUIRED :
         s = _("Upgrade Required");
        break;
-    case HTTP_NOT_IMPLEMENTED :
+    case HTTP_STATUS_NOT_IMPLEMENTED :
         s = _("Not Implemented");
        break;
-    case HTTP_NOT_SUPPORTED :
+    case HTTP_STATUS_NOT_SUPPORTED :
         s = _("Not Supported");
        break;
-    case HTTP_EXPECTATION_FAILED :
+    case HTTP_STATUS_EXPECTATION_FAILED :
         s = _("Expectation Failed");
        break;
-    case HTTP_SERVICE_UNAVAILABLE :
+    case HTTP_STATUS_SERVICE_UNAVAILABLE :
         s = _("Service Unavailable");
        break;
-    case HTTP_SERVER_ERROR :
+    case HTTP_STATUS_SERVER_ERROR :
         s = _("Internal Server Error");
        break;
-    case HTTP_PKI_ERROR :
+    case HTTP_STATUS_CUPS_PKI_ERROR :
         s = _("SSL/TLS Negotiation Error");
        break;
-    case HTTP_WEBIF_DISABLED :
+    case HTTP_STATUS_CUPS_WEBIF_DISABLED :
         s = _("Web Interface is Disabled");
        break;
 
@@ -1451,12 +1451,12 @@ _httpResolveURI(
   if ((status = httpSeparateURI(HTTP_URI_CODING_ALL, uri, scheme,
                                 sizeof(scheme), userpass, sizeof(userpass),
                                hostname, sizeof(hostname), &port, resource,
-                               sizeof(resource))) < HTTP_URI_OK)
+                               sizeof(resource))) < HTTP_URI_STATUS_OK)
 #else
   if (httpSeparateURI(HTTP_URI_CODING_ALL, uri, scheme,
                      sizeof(scheme), userpass, sizeof(userpass),
                      hostname, sizeof(hostname), &port, resource,
-                     sizeof(resource)) < HTTP_URI_OK)
+                     sizeof(resource)) < HTTP_URI_STATUS_OK)
 #endif /* DEBUG */
   {
     if (options & _HTTP_RESOLVE_STDERR)
index 4db3e6ee9c15252467e862449876e8df909009c5..145f87e7450b531f69381042b79023ad7a8d0b21 100644 (file)
@@ -591,7 +591,7 @@ http_t *                            /* O - New HTTP connection */
 httpConnect(const char *host,          /* I - Host to connect to */
             int        port)           /* I - Port number */
 {
-  return (httpConnect2(host, port, NULL, AF_UNSPEC, HTTP_ENCRYPT_IF_REQUESTED,
+  return (httpConnect2(host, port, NULL, AF_UNSPEC, HTTP_ENCRYPTION_IF_REQUESTED,
                        1, 30000, NULL));
 }
 
@@ -804,7 +804,7 @@ int                                 /* O - Status of call (0 = success) */
 httpDelete(http_t     *http,           /* I - Connection to server */
            const char *uri)            /* I - URI to delete */
 {
-  return (http_send(http, HTTP_DELETE, uri));
+  return (http_send(http, HTTP_STATE_DELETE, uri));
 }
 
 
@@ -846,15 +846,15 @@ httpEncryption(http_t            *http,   /* I - Connection to server */
 
   http->encryption = e;
 
-  if ((http->encryption == HTTP_ENCRYPT_ALWAYS && !http->tls) ||
-      (http->encryption == HTTP_ENCRYPT_NEVER && http->tls))
-    return (httpReconnect(http));
-  else if (http->encryption == HTTP_ENCRYPT_REQUIRED && !http->tls)
+  if ((http->encryption == HTTP_ENCRYPTION_ALWAYS && !http->tls) ||
+      (http->encryption == HTTP_ENCRYPTION_NEVER && http->tls))
+    return (httpReconnect2(http, 30000, NULL));
+  else if (http->encryption == HTTP_ENCRYPTION_REQUIRED && !http->tls)
     return (http_upgrade(http));
   else
     return (0);
 #else
-  if (e == HTTP_ENCRYPT_ALWAYS || e == HTTP_ENCRYPT_REQUIRED)
+  if (e == HTTP_ENCRYPTION_ALWAYS || e == HTTP_ENCRYPTION_REQUIRED)
     return (-1);
   else
     return (0);
@@ -1056,7 +1056,7 @@ int                                       /* O - Status of call (0 = success) */
 httpGet(http_t     *http,              /* I - Connection to server */
         const char *uri)               /* I - URI to get */
 {
-  return (http_send(http, HTTP_GET, uri));
+  return (http_send(http, HTTP_STATE_GET, uri));
 }
 
 
@@ -1338,7 +1338,7 @@ httpGetLength2(http_t *http)              /* I - Connection to server */
       * and 2^31-1 for other successful requests...
       */
 
-      if (http->status >= HTTP_MULTIPLE_CHOICES ||
+      if (http->status >= HTTP_STATUS_MULTIPLE_CHOICES ||
           http->state == HTTP_STATE_OPTIONS ||
           (http->state == HTTP_STATE_GET && http->mode == _HTTP_MODE_SERVER) ||
           http->state == HTTP_STATE_HEAD ||
@@ -1728,7 +1728,7 @@ httpHead(http_t     *http,                /* I - Connection to server */
          const char *uri)              /* I - URI for head */
 {
   DEBUG_printf(("httpHead(http=%p, uri=\"%s\")", http, uri));
-  return (http_send(http, HTTP_HEAD, uri));
+  return (http_send(http, HTTP_STATE_HEAD, uri));
 }
 
 
@@ -1822,7 +1822,7 @@ int                                       /* O - Status of call (0 = success) */
 httpOptions(http_t     *http,          /* I - Connection to server */
             const char *uri)           /* I - URI for options */
 {
-  return (http_send(http, HTTP_OPTIONS, uri));
+  return (http_send(http, HTTP_STATE_OPTIONS, uri));
 }
 
 
@@ -2095,7 +2095,7 @@ int                                       /* O - Status of call (0 = success) */
 httpPost(http_t     *http,             /* I - Connection to server */
          const char *uri)              /* I - URI for post */
 {
-  return (http_send(http, HTTP_POST, uri));
+  return (http_send(http, HTTP_STATE_POST, uri));
 }
 
 
@@ -2149,7 +2149,7 @@ httpPut(http_t     *http,         /* I - Connection to server */
         const char *uri)               /* I - URI to put */
 {
   DEBUG_printf(("httpPut(http=%p, uri=\"%s\")", http, uri));
-  return (http_send(http, HTTP_PUT, uri));
+  return (http_send(http, HTTP_STATE_PUT, uri));
 }
 
 
@@ -2693,7 +2693,7 @@ httpReconnect2(http_t *http,              /* I - Connection to server */
 
   if (!http)
   {
-    _cupsSetError(IPP_INTERNAL_ERROR, strerror(EINVAL), 0);
+    _cupsSetError(IPP_STATUS_ERROR_INTERNAL, strerror(EINVAL), 0);
     return (-1);
   }
 
@@ -2777,7 +2777,7 @@ httpReconnect2(http_t *http,              /* I - Connection to server */
   http->error    = 0;
 
 #ifdef HAVE_SSL
-  if (http->encryption == HTTP_ENCRYPT_ALWAYS)
+  if (http->encryption == HTTP_ENCRYPTION_ALWAYS)
   {
    /*
     * Always do encryption via SSL.
@@ -2794,7 +2794,7 @@ httpReconnect2(http_t *http,              /* I - Connection to server */
       return (-1);
     }
   }
-  else if (http->encryption == HTTP_ENCRYPT_REQUIRED)
+  else if (http->encryption == HTTP_ENCRYPTION_REQUIRED)
     return (http_upgrade(http));
 #endif /* HAVE_SSL */
 
@@ -3160,7 +3160,7 @@ int                                       /* O - Status of call (0 = success) */
 httpTrace(http_t     *http,            /* I - Connection to server */
           const char *uri)             /* I - URI for trace */
 {
-  return (http_send(http, HTTP_TRACE, uri));
+  return (http_send(http, HTTP_STATE_TRACE, uri));
 }
 
 
@@ -3213,11 +3213,11 @@ _httpUpdate(http_t        *http,        /* I - Connection to server */
       return (0);
     }
 
-    if (http->status < HTTP_BAD_REQUEST)
+    if (http->status < HTTP_STATUS_BAD_REQUEST)
       http->digest_tries = 0;
 
 #ifdef HAVE_SSL
-    if (http->status == HTTP_SWITCHING_PROTOCOLS && !http->tls)
+    if (http->status == HTTP_STATUS_SWITCHING_PROTOCOLS && !http->tls)
     {
       if (http_setup_ssl(http) != 0)
       {
@@ -3877,7 +3877,7 @@ httpWriteResponse(http_t        *http,    /* I - HTTP connection */
   if (!http->fields[HTTP_FIELD_DATE][0])
     httpSetField(http, HTTP_FIELD_DATE, httpGetDateString(time(NULL)));
 
-  if (status >= HTTP_BAD_REQUEST && http->keep_alive)
+  if (status >= HTTP_STATUS_BAD_REQUEST && http->keep_alive)
   {
     http->keep_alive = 0;
     httpSetField(http, HTTP_FIELD_KEEP_ALIVE, "");
@@ -4256,10 +4256,12 @@ http_content_coding_start(
   }
   else if (!strcmp(value, "x-gzip") || !strcmp(value, "gzip"))
   {
-    if (http->state == HTTP_GET_SEND || http->state == HTTP_POST_SEND)
+    if (http->state == HTTP_STATE_GET_SEND ||
+        http->state == HTTP_STATE_POST_SEND)
       coding = http->mode == _HTTP_MODE_SERVER ? _HTTP_CODING_GZIP :
                                                  _HTTP_CODING_GUNZIP;
-    else if (http->state == HTTP_STATE_POST_RECV || http->state == HTTP_PUT_RECV)
+    else if (http->state == HTTP_STATE_POST_RECV ||
+             http->state == HTTP_STATE_PUT_RECV)
       coding = http->mode == _HTTP_MODE_CLIENT ? _HTTP_CODING_GZIP :
                                                  _HTTP_CODING_GUNZIP;
     else
@@ -4270,10 +4272,12 @@ http_content_coding_start(
   }
   else if (!strcmp(value, "x-deflate") || !strcmp(value, "deflate"))
   {
-    if (http->state == HTTP_GET_SEND || http->state == HTTP_POST_SEND)
+    if (http->state == HTTP_STATE_GET_SEND ||
+        http->state == HTTP_STATE_POST_SEND)
       coding = http->mode == _HTTP_MODE_SERVER ? _HTTP_CODING_DEFLATE :
                                                  _HTTP_CODING_INFLATE;
-    else if (http->state == HTTP_STATE_POST_RECV || http->state == HTTP_PUT_RECV)
+    else if (http->state == HTTP_STATE_POST_RECV ||
+             http->state == HTTP_STATE_PUT_RECV)
       coding = http->mode == _HTTP_MODE_CLIENT ? _HTTP_CODING_DEFLATE :
                                                  _HTTP_CODING_INFLATE;
     else
@@ -4407,7 +4411,7 @@ http_create(
 
   if ((http = calloc(sizeof(http_t), 1)) == NULL)
   {
-    _cupsSetError(IPP_INTERNAL_ERROR, strerror(errno), 0);
+    _cupsSetError(IPP_STATUS_ERROR_INTERNAL, strerror(errno), 0);
     httpAddrFreeList(addrlist);
     return (NULL);
   }
@@ -4912,8 +4916,8 @@ http_send(http_t       *http,             /* I - Connection to server */
   */
 
   if (http->fd < 0 || http->status == HTTP_STATUS_ERROR ||
-      http->status >= HTTP_BAD_REQUEST)
-    if (httpReconnect(http))
+      http->status >= HTTP_STATUS_BAD_REQUEST)
+    if (httpReconnect2(http, 30000, NULL))
       return (-1);
 
  /*
@@ -4923,7 +4927,7 @@ http_send(http_t       *http,             /* I - Connection to server */
   if (http->wused)
   {
     if (httpFlushWrite(http) < 0)
-      if (httpReconnect(http))
+      if (httpReconnect2(http, 30000, NULL))
         return (-1);
   }
 
@@ -4934,13 +4938,13 @@ http_send(http_t       *http,           /* I - Connection to server */
   http->state         = request;
   http->data_encoding = HTTP_ENCODING_FIELDS;
 
-  if (request == HTTP_POST || request == HTTP_PUT)
+  if (request == HTTP_STATE_POST || request == HTTP_STATE_PUT)
     http->state ++;
 
   http->status = HTTP_STATUS_CONTINUE;
 
 #ifdef HAVE_SSL
-  if (http->encryption == HTTP_ENCRYPT_REQUIRED && !http->tls)
+  if (http->encryption == HTTP_ENCRYPTION_REQUIRED && !http->tls)
   {
     httpSetField(http, HTTP_FIELD_CONNECTION, "Upgrade");
     httpSetField(http, HTTP_FIELD_UPGRADE, "TLS/1.2,TLS/1.1,TLS/1.0");
@@ -5518,7 +5522,7 @@ http_setup_ssl(http_t *http)              /* I - Connection to server */
       message = _("Unable to establish a secure connection to host.");
 #endif /* HAVE_CSSMERRORSTRING */
 
-    _cupsSetError(IPP_PKI_ERROR, message, 1);
+    _cupsSetError(IPP_STATUS_ERROR_CUPS_PKI, message, 1);
 
     return (-1);
   }
index 67703c9189660bd27e451d24ae600bd59d71bc63..07029d192cdebfd8951d0fd863138a59b6171d2a 100644 (file)
@@ -284,10 +284,10 @@ typedef enum http_status_e                /**** HTTP status codes ****/
   HTTP_STATUS_GATEWAY_TIMEOUT,         /* Gateway connection timed out */
   HTTP_STATUS_NOT_SUPPORTED,           /* HTTP version not supported */
 
-  CUPS_STATUS_AUTHORIZATION_CANCELED = 1000,
+  HTTP_STATUS_CUPS_AUTHORIZATION_CANCELED = 1000,
                                        /* User canceled authorization @since CUPS 1.4@ */
-  CUPS_STATUS_PKI_ERROR,               /* Error negotiating a secure connection @since CUPS 1.5/OS X 10.7@ */
-  CUPS_STATUS_WEBIF_DISABLED           /* Web interface is disabled @private@ */
+  HTTP_STATUS_CUPS_PKI_ERROR,          /* Error negotiating a secure connection @since CUPS 1.5/OS X 10.7@ */
+  HTTP_STATUS_CUPS_WEBIF_DISABLED      /* Web interface is disabled @private@ */
 
 #  ifndef _CUPS_NO_DEPRECATED
 /* Old names for this enumeration */
@@ -338,9 +338,9 @@ typedef enum http_status_e          /**** HTTP status codes ****/
 #    define HTTP_GATEWAY_TIMEOUT       HTTP_STATUS_GATEWAY_TIMEOUT
 #    define HTTP_NOT_SUPPORTED         HTTP_STATUS_NOT_SUPPORTED
 
-#    define HTTP_AUTHORIZATION_CANCELED        CUPS_STATUS_AUTHORIZATION_CANCELED
-#    define HTTP_PKI_ERROR             CUPS_STATUS_PKI_ERROR
-#    define HTTP_WEBIF_DISABLED                CUPS_STATUS_WEBIF_DISABLED
+#    define HTTP_AUTHORIZATION_CANCELED        HTTP_STATUS_CUPS_AUTHORIZATION_CANCELED
+#    define HTTP_PKI_ERROR             HTTP_STATUS_CUPS_PKI_ERROR
+#    define HTTP_WEBIF_DISABLED                HTTP_STATUS_CUPS_WEBIF_DISABLED
 #  endif /* !_CUPS_NO_DEPRECATED */
 } http_status_t;
 
index d6d90ae47c24abd5cbf7d9a3e623f10aa11a6089..62eb0b19c9c221706f91e4560ed4ea1063b5c2f2 100644 (file)
@@ -590,7 +590,7 @@ ippAttributeString(
         bufptr ++;
     }
 
-    switch (attr->value_tag & ~IPP_TAG_COPY)
+    switch (attr->value_tag & ~IPP_TAG_CUPS_CONST)
     {
       case IPP_TAG_ENUM :
           ptr = ippEnumString(attr->name, val->integer);
@@ -1577,7 +1577,7 @@ ippCreateRequestedArray(ipp_t *request)   /* I - IPP request */
     * default to "all"...
     */
 
-    if (ippGetOperation(request) == IPP_GET_JOBS)
+    if (ippGetOperation(request) == IPP_OP_GET_JOBS)
     {
       ra = cupsArrayNew((cups_array_func_t)strcmp, NULL);
       cupsArrayAdd(ra, "job-id");
@@ -1732,8 +1732,8 @@ ippEnumString(const char *attrname,       /* I - Attribute name */
                                  sizeof(ipp_job_collation_types[0]))))
     return (ipp_job_collation_types[enumvalue - 3]);
   else if (!strcmp(attrname, "job-state") &&
-          enumvalue >= IPP_JOB_PENDING && enumvalue <= IPP_JOB_COMPLETED)
-    return (ipp_job_states[enumvalue - IPP_JOB_PENDING]);
+          enumvalue >= IPP_JSTATE_PENDING && enumvalue <= IPP_JSTATE_COMPLETED)
+    return (ipp_job_states[enumvalue - IPP_JSTATE_PENDING]);
   else if (!strcmp(attrname, "operations-supported"))
     return (ippOpString((ipp_op_t)enumvalue));
   else if ((!strcmp(attrname, "orientation-requested") ||
@@ -1753,8 +1753,8 @@ ippEnumString(const char *attrname,       /* I - Attribute name */
                                  sizeof(ipp_print_qualities[0]))))
     return (ipp_print_qualities[enumvalue - 3]);
   else if (!strcmp(attrname, "printer-state") &&
-           enumvalue >= IPP_PRINTER_IDLE && enumvalue <= IPP_PRINTER_STOPPED)
-    return (ipp_printer_states[enumvalue - IPP_PRINTER_IDLE]);
+           enumvalue >= IPP_PSTATE_IDLE && enumvalue <= IPP_PSTATE_STOPPED)
+    return (ipp_printer_states[enumvalue - IPP_PSTATE_IDLE]);
 
  /*
   * Not a standard enum value, just return the decimal equivalent...
@@ -1964,7 +1964,7 @@ ippOpString(ipp_op_t op)          /* I - Operation ID */
   else if (op == IPP_OP_PRIVATE)
     return ("windows-ext");
   else if (op >= IPP_OP_CUPS_GET_DEFAULT && op <= IPP_OP_CUPS_GET_PPD)
-    return (ipp_cups_ops[op - CUPS_GET_DEFAULT]);
+    return (ipp_cups_ops[op - IPP_OP_CUPS_GET_DEFAULT]);
   else if (op == IPP_OP_CUPS_GET_DOCUMENT)
     return (ipp_cups_ops2[0]);
 
@@ -2063,7 +2063,7 @@ ippSetPort(int p)                 /* I - Port number to use */
 const char *                           /* O - Tag name */
 ippTagString(ipp_tag_t tag)            /* I - Tag value */
 {
-  tag &= IPP_TAG_MASK;
+  tag &= IPP_TAG_CUPS_MASK;
 
   if (tag < (ipp_tag_t)(sizeof(ipp_tag_names) / sizeof(ipp_tag_names[0])))
     return (ipp_tag_names[tag]);
index 8c15b48ad6056d813b0dd60b569dbf70445a176c..905df5fdc1a5d4644b4e7b482a61a2ccd9bd91fe 100644 (file)
@@ -503,7 +503,7 @@ ippAddInteger(ipp_t      *ipp,              /* I - IPP message */
                 "name=\"%s\", value=%d)", ipp, group, ippTagString(group),
                value_tag, ippTagString(value_tag), name, value));
 
-  value_tag &= IPP_TAG_MASK;
+  value_tag &= IPP_TAG_CUPS_MASK;
 
  /*
   * Special-case for legacy usage: map out-of-band attributes to new ippAddOutOfBand
@@ -575,7 +575,7 @@ ippAddIntegers(ipp_t      *ipp,             /* I - IPP message */
                group, ippTagString(group), value_tag, ippTagString(value_tag), name,
                num_values, values));
 
-  value_tag &= IPP_TAG_MASK;
+  value_tag &= IPP_TAG_CUPS_MASK;
 
  /*
   * Range check input...
@@ -702,7 +702,7 @@ ippAddOutOfBand(ipp_t      *ipp,    /* I - IPP message */
                 "name=\"%s\")", ipp, group, ippTagString(group), value_tag,
                 ippTagString(value_tag), name));
 
-  value_tag &= IPP_TAG_MASK;
+  value_tag &= IPP_TAG_CUPS_MASK;
 
  /*
   * Range check input...
@@ -1029,7 +1029,7 @@ ippAddString(ipp_t      *ipp,             /* I - IPP message */
   * Range check input...
   */
 
-  temp_tag = (ipp_tag_t)((int)value_tag & IPP_TAG_MASK);
+  temp_tag = (ipp_tag_t)((int)value_tag & IPP_TAG_CUPS_MASK);
 
 #if 0
   if (!ipp || !name || group < IPP_TAG_ZERO ||
@@ -1051,13 +1051,13 @@ ippAddString(ipp_t      *ipp,           /* I - IPP message */
   * See if we need to map charset, language, or locale values...
   */
 
-  if (language && ((int)value_tag & IPP_TAG_COPY) &&
+  if (language && ((int)value_tag & IPP_TAG_CUPS_CONST) &&
       strcmp(language, ipp_lang_code(language, code, sizeof(code))))
     value_tag = temp_tag;              /* Don't do a fast copy */
-  else if (value && value_tag == (ipp_tag_t)(IPP_TAG_CHARSET | IPP_TAG_COPY) &&
+  else if (value && value_tag == (ipp_tag_t)(IPP_TAG_CHARSET | IPP_TAG_CUPS_CONST) &&
            strcmp(value, ipp_get_code(value, code, sizeof(code))))
     value_tag = temp_tag;              /* Don't do a fast copy */
-  else if (value && value_tag == (ipp_tag_t)(IPP_TAG_LANGUAGE | IPP_TAG_COPY) &&
+  else if (value && value_tag == (ipp_tag_t)(IPP_TAG_LANGUAGE | IPP_TAG_CUPS_CONST) &&
            strcmp(value, ipp_lang_code(value, code, sizeof(code))))
     value_tag = temp_tag;              /* Don't do a fast copy */
 
@@ -1072,7 +1072,7 @@ ippAddString(ipp_t      *ipp,             /* I - IPP message */
   * Initialize the attribute data...
   */
 
-  if ((int)value_tag & IPP_TAG_COPY)
+  if ((int)value_tag & IPP_TAG_CUPS_CONST)
   {
     attr->values[0].string.language = (char *)language;
     attr->values[0].string.text     = (char *)value;
@@ -1364,7 +1364,7 @@ ippAddStrings(
   * Range check input...
   */
 
-  temp_tag = (ipp_tag_t)((int)value_tag & IPP_TAG_MASK);
+  temp_tag = (ipp_tag_t)((int)value_tag & IPP_TAG_CUPS_MASK);
 
 #if 0
   if (!ipp || !name || group < IPP_TAG_ZERO ||
@@ -1388,10 +1388,10 @@ ippAddStrings(
   * See if we need to map charset, language, or locale values...
   */
 
-  if (language && ((int)value_tag & IPP_TAG_COPY) &&
+  if (language && ((int)value_tag & IPP_TAG_CUPS_CONST) &&
       strcmp(language, ipp_lang_code(language, code, sizeof(code))))
     value_tag = temp_tag;              /* Don't do a fast copy */
-  else if (values && value_tag == (ipp_tag_t)(IPP_TAG_CHARSET | IPP_TAG_COPY))
+  else if (values && value_tag == (ipp_tag_t)(IPP_TAG_CHARSET | IPP_TAG_CUPS_CONST))
   {
     for (i = 0; i < num_values; i ++)
       if (strcmp(values[i], ipp_get_code(values[i], code, sizeof(code))))
@@ -1400,7 +1400,7 @@ ippAddStrings(
         break;
       }
   }
-  else if (values && value_tag == (ipp_tag_t)(IPP_TAG_LANGUAGE | IPP_TAG_COPY))
+  else if (values && value_tag == (ipp_tag_t)(IPP_TAG_LANGUAGE | IPP_TAG_CUPS_CONST))
   {
     for (i = 0; i < num_values; i ++)
       if (strcmp(values[i], ipp_lang_code(values[i], code, sizeof(code))))
@@ -1429,7 +1429,7 @@ ippAddStrings(
     {
       if (value == attr->values)
       {
-        if ((int)value_tag & IPP_TAG_COPY)
+        if ((int)value_tag & IPP_TAG_CUPS_CONST)
           value->string.language = (char *)language;
         else
           value->string.language = _cupsStrAlloc(ipp_lang_code(language, code,
@@ -1441,7 +1441,7 @@ ippAddStrings(
 
     if (values)
     {
-      if ((int)value_tag & IPP_TAG_COPY)
+      if ((int)value_tag & IPP_TAG_CUPS_CONST)
         value->string.text = (char *)*values++;
       else if (value_tag == IPP_TAG_CHARSET)
        value->string.text = _cupsStrAlloc(ipp_get_code(*values++, code, sizeof(code)));
@@ -1621,9 +1621,9 @@ ippCopyAttribute(
   * Copy it...
   */
 
-  quickcopy = quickcopy ? IPP_TAG_COPY : 0;
+  quickcopy = quickcopy ? IPP_TAG_CUPS_CONST : 0;
 
-  switch (srcattr->value_tag & ~IPP_TAG_COPY)
+  switch (srcattr->value_tag & ~IPP_TAG_CUPS_CONST)
   {
     case IPP_TAG_ZERO :
         dstattr = ippAddSeparator(dst);
@@ -1676,7 +1676,7 @@ ippCopyAttribute(
               i --, srcval ++, dstval ++)
            dstval->string.text = srcval->string.text;
         }
-       else if (srcattr->value_tag & IPP_TAG_COPY)
+       else if (srcattr->value_tag & IPP_TAG_CUPS_CONST)
        {
          for (i = srcattr->num_values, srcval = srcattr->values,
                   dstval = dstattr->values;
@@ -1753,7 +1753,7 @@ ippCopyAttribute(
            dstval->string.text     = srcval->string.text;
           }
         }
-       else if (srcattr->value_tag & IPP_TAG_COPY)
+       else if (srcattr->value_tag & IPP_TAG_CUPS_CONST)
        {
          for (i = srcattr->num_values, srcval = srcattr->values,
                   dstval = dstattr->values;
@@ -2149,7 +2149,7 @@ ippFindNextAttribute(ipp_t      *ipp,     /* I - IPP message */
     DEBUG_printf(("4ippFindAttribute: attr=%p, name=\"%s\"", attr,
                   attr->name));
 
-    value_tag = (ipp_tag_t)(attr->value_tag & IPP_TAG_MASK);
+    value_tag = (ipp_tag_t)(attr->value_tag & IPP_TAG_CUPS_MASK);
 
     if (attr->name != NULL && _cups_strcasecmp(attr->name, name) == 0 &&
         (value_tag == type || type == IPP_TAG_ZERO ||
@@ -2520,7 +2520,7 @@ ippGetState(ipp_t *ipp)                   /* I - IPP message */
   */
 
   if (!ipp)
-    return (IPP_IDLE);
+    return (IPP_STATE_IDLE);
 
  /*
   * Return the value...
@@ -2544,7 +2544,7 @@ ippGetStatusCode(ipp_t *ipp)              /* I - IPP response or event message */
   */
 
   if (!ipp)
-    return (IPP_INTERNAL_ERROR);
+    return (IPP_STATUS_ERROR_INTERNAL);
 
  /*
   * Return the value...
@@ -2608,7 +2608,7 @@ ippGetValueTag(ipp_attribute_t *attr)     /* I - IPP attribute */
   * Return the value...
   */
 
-  return (attr->value_tag & IPP_TAG_MASK);
+  return (attr->value_tag & IPP_TAG_CUPS_MASK);
 }
 
 
@@ -2895,7 +2895,7 @@ ippRead(http_t *http,                     /* I - HTTP connection */
                 http, ipp, CUPS_LLCAST (http ? http->data_remaining : -1)));
 
   if (!http)
-    return (IPP_ERROR);
+    return (IPP_STATE_ERROR);
 
   DEBUG_printf(("2ippRead: http->state=%d, http->used=%d", http->state,
                 http->used));
@@ -2947,23 +2947,23 @@ ippReadIO(void       *src,              /* I - Data source */
 
   DEBUG_printf(("ippReadIO(src=%p, cb=%p, blocking=%d, parent=%p, ipp=%p)",
                 src, cb, blocking, parent, ipp));
-  DEBUG_printf(("2ippReadIO: ipp->state=%d", ipp ? ipp->state : IPP_ERROR));
+  DEBUG_printf(("2ippReadIO: ipp->state=%d", ipp ? ipp->state : IPP_STATE_ERROR));
 
   if (!src || !ipp)
-    return (IPP_ERROR);
+    return (IPP_STATE_ERROR);
 
   if ((buffer = (unsigned char *)_cupsBufferGet(IPP_BUF_SIZE)) == NULL)
   {
     DEBUG_puts("1ippReadIO: Unable to get read buffer.");
-    return (IPP_ERROR);
+    return (IPP_STATE_ERROR);
   }
 
   switch (ipp->state)
   {
-    case IPP_IDLE :
+    case IPP_STATE_IDLE :
         ipp->state ++; /* Avoid common problem... */
 
-    case IPP_HEADER :
+    case IPP_STATE_HEADER :
         if (parent == NULL)
        {
         /*
@@ -2974,7 +2974,7 @@ ippReadIO(void       *src,                /* I - Data source */
          {
            DEBUG_puts("1ippReadIO: Unable to read header.");
            _cupsBufferRelease((char *)buffer);
-           return (IPP_ERROR);
+           return (IPP_STATE_ERROR);
          }
 
         /*
@@ -2994,7 +2994,7 @@ ippReadIO(void       *src,                /* I - Data source */
                        ipp->request.any.request_id));
         }
 
-        ipp->state   = IPP_ATTRIBUTE;
+        ipp->state   = IPP_STATE_ATTRIBUTE;
        ipp->current = NULL;
        ipp->curtag  = IPP_TAG_ZERO;
        ipp->prev    = ipp->last;
@@ -3006,14 +3006,14 @@ ippReadIO(void       *src,              /* I - Data source */
         if (!blocking)
          break;
 
-    case IPP_ATTRIBUTE :
+    case IPP_STATE_ATTRIBUTE :
         for (;;)
        {
          if ((*cb)(src, buffer, 1) < 1)
          {
            DEBUG_puts("1ippReadIO: Callback returned EOF/error");
            _cupsBufferRelease((char *)buffer);
-           return (IPP_ERROR);
+           return (IPP_STATE_ERROR);
          }
 
          DEBUG_printf(("2ippReadIO: ipp->current=%p, ipp->prev=%p",
@@ -3034,22 +3034,22 @@ ippReadIO(void       *src,              /* I - Data source */
            {
              DEBUG_puts("1ippReadIO: Callback returned EOF/error");
              _cupsBufferRelease((char *)buffer);
-             return (IPP_ERROR);
+             return (IPP_STATE_ERROR);
            }
 
            tag = (ipp_tag_t)((((((buffer[0] << 8) | buffer[1]) << 8) |
                                buffer[2]) << 8) | buffer[3]);
 
-            if (tag & IPP_TAG_COPY)
+            if (tag & IPP_TAG_CUPS_CONST)
             {
              /*
               * Fail if the high bit is set in the tag...
               */
 
-             _cupsSetError(IPP_INTERNAL_ERROR, _("IPP extension tag larger than 0x7FFFFFFF."), 1);
+             _cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("IPP extension tag larger than 0x7FFFFFFF."), 1);
              DEBUG_printf(("1ippReadIO: bad tag 0x%x.", tag));
              _cupsBufferRelease((char *)buffer);
-             return (IPP_ERROR);
+             return (IPP_STATE_ERROR);
             }
           }
 
@@ -3061,7 +3061,7 @@ ippReadIO(void       *src,                /* I - Data source */
 
             DEBUG_puts("2ippReadIO: IPP_TAG_END.");
 
-           ipp->state = IPP_DATA;
+           ipp->state = IPP_STATE_DATA;
            break;
          }
           else if (tag < IPP_TAG_UNSUPPORTED_VALUE)
@@ -3093,17 +3093,17 @@ ippReadIO(void       *src,              /* I - Data source */
          {
            DEBUG_puts("1ippReadIO: unable to read name length.");
            _cupsBufferRelease((char *)buffer);
-           return (IPP_ERROR);
+           return (IPP_STATE_ERROR);
          }
 
           n = (buffer[0] << 8) | buffer[1];
 
           if (n >= IPP_BUF_SIZE)
          {
-           _cupsSetError(IPP_INTERNAL_ERROR, _("IPP name larger than 32767 bytes."), 1);
+           _cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("IPP name larger than 32767 bytes."), 1);
            DEBUG_printf(("1ippReadIO: bad name length %d.", n));
            _cupsBufferRelease((char *)buffer);
-           return (IPP_ERROR);
+           return (IPP_STATE_ERROR);
          }
 
           DEBUG_printf(("2ippReadIO: name length=%d", n));
@@ -3117,14 +3117,14 @@ ippReadIO(void       *src,              /* I - Data source */
 
             if (ipp->current == NULL)
            {
-             _cupsSetError(IPP_INTERNAL_ERROR, _("IPP attribute has no name."), 1);
+             _cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("IPP attribute has no name."), 1);
              DEBUG_puts("1ippReadIO: Attribute without name and no current.");
              _cupsBufferRelease((char *)buffer);
-             return (IPP_ERROR);
+             return (IPP_STATE_ERROR);
            }
 
             attr      = ipp->current;
-           value_tag = (ipp_tag_t)(attr->value_tag & IPP_TAG_MASK);
+           value_tag = (ipp_tag_t)(attr->value_tag & IPP_TAG_CUPS_MASK);
 
           /*
            * Make sure we aren't adding a new value of a different
@@ -3153,14 +3153,14 @@ ippReadIO(void       *src,              /* I - Data source */
                  (tag < IPP_TAG_TEXT || tag > IPP_TAG_MIMETYPE) &&
                  tag != IPP_TAG_NOVALUE)
              {
-               _cupsSetError(IPP_INTERNAL_ERROR,
+               _cupsSetError(IPP_STATUS_ERROR_INTERNAL,
                              _("IPP 1setOf attribute with incompatible value "
                                "tags."), 1);
                DEBUG_printf(("1ippReadIO: 1setOf value tag %x(%s) != %x(%s)",
                              value_tag, ippTagString(value_tag), tag,
                              ippTagString(tag)));
                _cupsBufferRelease((char *)buffer);
-               return (IPP_ERROR);
+               return (IPP_STATE_ERROR);
              }
 
               if (value_tag != tag)
@@ -3180,14 +3180,14 @@ ippReadIO(void       *src,              /* I - Data source */
 
              if (tag != IPP_TAG_INTEGER && tag != IPP_TAG_RANGE)
              {
-               _cupsSetError(IPP_INTERNAL_ERROR,
+               _cupsSetError(IPP_STATUS_ERROR_INTERNAL,
                              _("IPP 1setOf attribute with incompatible value "
                                "tags."), 1);
                DEBUG_printf(("1ippReadIO: 1setOf value tag %x(%s) != %x(%s)",
                              value_tag, ippTagString(value_tag), tag,
                              ippTagString(tag)));
                _cupsBufferRelease((char *)buffer);
-               return (IPP_ERROR);
+               return (IPP_STATE_ERROR);
              }
 
               if (value_tag == IPP_TAG_INTEGER && tag == IPP_TAG_RANGE)
@@ -3203,14 +3203,14 @@ ippReadIO(void       *src,              /* I - Data source */
             }
            else if (value_tag != tag)
            {
-             _cupsSetError(IPP_INTERNAL_ERROR,
+             _cupsSetError(IPP_STATUS_ERROR_INTERNAL,
                            _("IPP 1setOf attribute with incompatible value "
                              "tags."), 1);
              DEBUG_printf(("1ippReadIO: value tag %x(%s) != %x(%s)",
                            value_tag, ippTagString(value_tag), tag,
                            ippTagString(tag)));
              _cupsBufferRelease((char *)buffer);
-             return (IPP_ERROR);
+             return (IPP_STATE_ERROR);
             }
 
            /*
@@ -3220,7 +3220,7 @@ ippReadIO(void       *src,                /* I - Data source */
            if ((value = ipp_set_value(ipp, &attr, attr->num_values)) == NULL)
            {
              _cupsBufferRelease((char *)buffer);
-             return (IPP_ERROR);
+             return (IPP_STATE_ERROR);
            }
          }
          else if (tag == IPP_TAG_MEMBERNAME)
@@ -3231,10 +3231,10 @@ ippReadIO(void       *src,              /* I - Data source */
 
            if (n)
            {
-             _cupsSetError(IPP_INTERNAL_ERROR, _("IPP member name is not empty."), 1);
+             _cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("IPP member name is not empty."), 1);
              DEBUG_puts("1ippReadIO: member name not empty.");
              _cupsBufferRelease((char *)buffer);
-             return (IPP_ERROR);
+             return (IPP_STATE_ERROR);
            }
 
             if (ipp->current)
@@ -3243,10 +3243,10 @@ ippReadIO(void       *src,              /* I - Data source */
            attr = ipp->current = ipp_add_attr(ipp, NULL, ipp->curtag, IPP_TAG_ZERO, 1);
            if (!attr)
            {
-             _cupsSetHTTPError(HTTP_ERROR);
+             _cupsSetHTTPError(HTTP_STATUS_ERROR);
              DEBUG_puts("1ippReadIO: unable to allocate attribute.");
              _cupsBufferRelease((char *)buffer);
-             return (IPP_ERROR);
+             return (IPP_STATE_ERROR);
            }
 
            DEBUG_printf(("2ippReadIO: membername, ipp->current=%p, ipp->prev=%p",
@@ -3264,7 +3264,7 @@ ippReadIO(void       *src,                /* I - Data source */
            {
              DEBUG_puts("1ippReadIO: unable to read name.");
              _cupsBufferRelease((char *)buffer);
-             return (IPP_ERROR);
+             return (IPP_STATE_ERROR);
            }
 
            buffer[n] = '\0';
@@ -3275,10 +3275,10 @@ ippReadIO(void       *src,              /* I - Data source */
            if ((attr = ipp->current = ipp_add_attr(ipp, (char *)buffer, ipp->curtag, tag,
                                                    1)) == NULL)
            {
-             _cupsSetHTTPError(HTTP_ERROR);
+             _cupsSetHTTPError(HTTP_STATUS_ERROR);
              DEBUG_puts("1ippReadIO: unable to allocate attribute.");
              _cupsBufferRelease((char *)buffer);
-             return (IPP_ERROR);
+             return (IPP_STATE_ERROR);
            }
 
            DEBUG_printf(("2ippReadIO: name=\"%s\", ipp->current=%p, "
@@ -3296,7 +3296,7 @@ ippReadIO(void       *src,                /* I - Data source */
          {
            DEBUG_puts("1ippReadIO: unable to read value length.");
            _cupsBufferRelease((char *)buffer);
-           return (IPP_ERROR);
+           return (IPP_STATE_ERROR);
          }
 
          n = (buffer[0] << 8) | buffer[1];
@@ -3304,11 +3304,11 @@ ippReadIO(void       *src,              /* I - Data source */
 
          if (n >= IPP_BUF_SIZE)
          {
-           _cupsSetError(IPP_INTERNAL_ERROR,
+           _cupsSetError(IPP_STATUS_ERROR_INTERNAL,
                          _("IPP value larger than 32767 bytes."), 1);
            DEBUG_printf(("1ippReadIO: bad value length %d.", n));
            _cupsBufferRelease((char *)buffer);
-           return (IPP_ERROR);
+           return (IPP_STATE_ERROR);
          }
 
          switch (tag)
@@ -3318,21 +3318,21 @@ ippReadIO(void       *src,              /* I - Data source */
                if (n != 4)
                {
                  if (tag == IPP_TAG_INTEGER)
-                   _cupsSetError(IPP_INTERNAL_ERROR,
+                   _cupsSetError(IPP_STATUS_ERROR_INTERNAL,
                                  _("IPP integer value not 4 bytes."), 1);
                  else
-                   _cupsSetError(IPP_INTERNAL_ERROR,
+                   _cupsSetError(IPP_STATUS_ERROR_INTERNAL,
                                  _("IPP enum value not 4 bytes."), 1);
                  DEBUG_printf(("1ippReadIO: bad integer value length %d.", n));
                  _cupsBufferRelease((char *)buffer);
-                 return (IPP_ERROR);
+                 return (IPP_STATE_ERROR);
                }
 
                if ((*cb)(src, buffer, 4) < 4)
                {
                  DEBUG_puts("1ippReadIO: Unable to read integer value.");
                  _cupsBufferRelease((char *)buffer);
-                 return (IPP_ERROR);
+                 return (IPP_STATE_ERROR);
                }
 
                n = (((((buffer[0] << 8) | buffer[1]) << 8) | buffer[2]) << 8) |
@@ -3347,18 +3347,18 @@ ippReadIO(void       *src,              /* I - Data source */
            case IPP_TAG_BOOLEAN :
                if (n != 1)
                {
-                 _cupsSetError(IPP_INTERNAL_ERROR, _("IPP boolean value not 1 byte."),
+                 _cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("IPP boolean value not 1 byte."),
                                1);
                  DEBUG_printf(("1ippReadIO: bad boolean value length %d.", n));
                  _cupsBufferRelease((char *)buffer);
-                 return (IPP_ERROR);
+                 return (IPP_STATE_ERROR);
                }
 
                if ((*cb)(src, buffer, 1) < 1)
                {
                  DEBUG_puts("1ippReadIO: Unable to read boolean value.");
                  _cupsBufferRelease((char *)buffer);
-                 return (IPP_ERROR);
+                 return (IPP_STATE_ERROR);
                }
 
                 value->boolean = buffer[0];
@@ -3396,7 +3396,7 @@ ippReadIO(void       *src,                /* I - Data source */
                  {
                    DEBUG_puts("1ippReadIO: unable to read string value.");
                    _cupsBufferRelease((char *)buffer);
-                   return (IPP_ERROR);
+                   return (IPP_STATE_ERROR);
                  }
                }
 
@@ -3408,35 +3408,35 @@ ippReadIO(void       *src,              /* I - Data source */
            case IPP_TAG_DATE :
                if (n != 11)
                {
-                 _cupsSetError(IPP_INTERNAL_ERROR, _("IPP date value not 11 bytes."), 1);
+                 _cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("IPP date value not 11 bytes."), 1);
                  DEBUG_printf(("1ippReadIO: bad date value length %d.", n));
                  _cupsBufferRelease((char *)buffer);
-                 return (IPP_ERROR);
+                 return (IPP_STATE_ERROR);
                }
 
                if ((*cb)(src, value->date, 11) < 11)
                {
                  DEBUG_puts("1ippReadIO: Unable to read date value.");
                  _cupsBufferRelease((char *)buffer);
-                 return (IPP_ERROR);
+                 return (IPP_STATE_ERROR);
                }
                break;
 
            case IPP_TAG_RESOLUTION :
                if (n != 9)
                {
-                 _cupsSetError(IPP_INTERNAL_ERROR,
+                 _cupsSetError(IPP_STATUS_ERROR_INTERNAL,
                                _("IPP resolution value not 9 bytes."), 1);
                  DEBUG_printf(("1ippReadIO: bad resolution value length %d.", n));
                  _cupsBufferRelease((char *)buffer);
-                 return (IPP_ERROR);
+                 return (IPP_STATE_ERROR);
                }
 
                if ((*cb)(src, buffer, 9) < 9)
                {
                  DEBUG_puts("1ippReadIO: Unable to read resolution value.");
                  _cupsBufferRelease((char *)buffer);
-                 return (IPP_ERROR);
+                 return (IPP_STATE_ERROR);
                }
 
                 value->resolution.xres =
@@ -3452,19 +3452,19 @@ ippReadIO(void       *src,              /* I - Data source */
            case IPP_TAG_RANGE :
                if (n != 8)
                {
-                 _cupsSetError(IPP_INTERNAL_ERROR,
+                 _cupsSetError(IPP_STATUS_ERROR_INTERNAL,
                                _("IPP rangeOfInteger value not 8 bytes."), 1);
                  DEBUG_printf(("1ippReadIO: bad rangeOfInteger value length "
                                "%d.", n));
                  _cupsBufferRelease((char *)buffer);
-                 return (IPP_ERROR);
+                 return (IPP_STATE_ERROR);
                }
 
                if ((*cb)(src, buffer, 8) < 8)
                {
                  DEBUG_puts("1ippReadIO: Unable to read range value.");
                  _cupsBufferRelease((char *)buffer);
-                 return (IPP_ERROR);
+                 return (IPP_STATE_ERROR);
                }
 
                 value->range.lower =
@@ -3480,17 +3480,17 @@ ippReadIO(void       *src,              /* I - Data source */
                if (n < 4)
                {
                  if (tag == IPP_TAG_TEXTLANG)
-                   _cupsSetError(IPP_INTERNAL_ERROR,
+                   _cupsSetError(IPP_STATUS_ERROR_INTERNAL,
                                  _("IPP textWithLanguage value less than "
                                    "minimum 4 bytes."), 1);
                  else
-                   _cupsSetError(IPP_INTERNAL_ERROR,
+                   _cupsSetError(IPP_STATUS_ERROR_INTERNAL,
                                  _("IPP nameWithLanguage value less than "
                                    "minimum 4 bytes."), 1);
                  DEBUG_printf(("1ippReadIO: bad stringWithLanguage value "
                                "length %d.", n));
                  _cupsBufferRelease((char *)buffer);
-                 return (IPP_ERROR);
+                 return (IPP_STATE_ERROR);
                }
 
                if ((*cb)(src, buffer, n) < n)
@@ -3498,7 +3498,7 @@ ippReadIO(void       *src,                /* I - Data source */
                  DEBUG_puts("1ippReadIO: Unable to read string w/language "
                             "value.");
                  _cupsBufferRelease((char *)buffer);
-                 return (IPP_ERROR);
+                 return (IPP_STATE_ERROR);
                }
 
                 bufptr = buffer;
@@ -3518,21 +3518,21 @@ ippReadIO(void       *src,              /* I - Data source */
                if ((bufptr + 2 + n) >= (buffer + IPP_BUF_SIZE) ||
                    n >= sizeof(string))
                {
-                 _cupsSetError(IPP_INTERNAL_ERROR,
+                 _cupsSetError(IPP_STATUS_ERROR_INTERNAL,
                                _("IPP language length overflows value."), 1);
                  DEBUG_printf(("1ippReadIO: bad language value length %d.",
                                n));
                  _cupsBufferRelease((char *)buffer);
-                 return (IPP_ERROR);
+                 return (IPP_STATE_ERROR);
                }
                else if (n >= IPP_MAX_LANGUAGE)
                {
-                 _cupsSetError(IPP_INTERNAL_ERROR,
+                 _cupsSetError(IPP_STATUS_ERROR_INTERNAL,
                                _("IPP language length too large."), 1);
                  DEBUG_printf(("1ippReadIO: bad language value length %d.",
                                n));
                  _cupsBufferRelease((char *)buffer);
-                 return (IPP_ERROR);
+                 return (IPP_STATE_ERROR);
                }
 
                memcpy(string, bufptr + 2, n);
@@ -3545,11 +3545,11 @@ ippReadIO(void       *src,              /* I - Data source */
 
                if ((bufptr + 2 + n) >= (buffer + IPP_BUF_SIZE))
                {
-                 _cupsSetError(IPP_INTERNAL_ERROR,
+                 _cupsSetError(IPP_STATUS_ERROR_INTERNAL,
                                _("IPP string length overflows value."), 1);
                  DEBUG_printf(("1ippReadIO: bad string value length %d.", n));
                  _cupsBufferRelease((char *)buffer);
-                 return (IPP_ERROR);
+                 return (IPP_STATE_ERROR);
                }
 
                bufptr[2 + n] = '\0';
@@ -3565,19 +3565,19 @@ ippReadIO(void       *src,              /* I - Data source */
 
                 if (n > 0)
                {
-                 _cupsSetError(IPP_INTERNAL_ERROR,
+                 _cupsSetError(IPP_STATUS_ERROR_INTERNAL,
                                _("IPP begCollection value not 0 bytes."), 1);
                  DEBUG_puts("1ippReadIO: begCollection tag with value length "
                             "> 0.");
                  _cupsBufferRelease((char *)buffer);
-                 return (IPP_ERROR);
+                 return (IPP_STATE_ERROR);
                }
 
-               if (ippReadIO(src, cb, 1, ipp, value->collection) == IPP_ERROR)
+               if (ippReadIO(src, cb, 1, ipp, value->collection) == IPP_STATE_ERROR)
                {
                  DEBUG_puts("1ippReadIO: Unable to read collection value.");
                  _cupsBufferRelease((char *)buffer);
-                 return (IPP_ERROR);
+                 return (IPP_STATE_ERROR);
                }
                 break;
 
@@ -3586,15 +3586,15 @@ ippReadIO(void       *src,              /* I - Data source */
 
                 if (n > 0)
                {
-                 _cupsSetError(IPP_INTERNAL_ERROR,
+                 _cupsSetError(IPP_STATUS_ERROR_INTERNAL,
                                _("IPP endCollection value not 0 bytes."), 1);
                  DEBUG_puts("1ippReadIO: endCollection tag with value length "
                             "> 0.");
-                 return (IPP_ERROR);
+                 return (IPP_STATE_ERROR);
                }
 
                DEBUG_puts("1ippReadIO: endCollection tag...");
-               return (ipp->state = IPP_DATA);
+               return (ipp->state = IPP_STATE_DATA);
 
             case IPP_TAG_MEMBERNAME :
               /*
@@ -3604,25 +3604,25 @@ ippReadIO(void       *src,              /* I - Data source */
 
                 if (!attr)
                 {
-                 _cupsSetError(IPP_INTERNAL_ERROR,
+                 _cupsSetError(IPP_STATUS_ERROR_INTERNAL,
                                _("IPP memberName with no attribute."), 1);
                  DEBUG_puts("1ippReadIO: Member name without attribute.");
                  _cupsBufferRelease((char *)buffer);
-                 return (IPP_ERROR);
+                 return (IPP_STATE_ERROR);
                 }
                else if (n == 0)
                {
-                 _cupsSetError(IPP_INTERNAL_ERROR,
+                 _cupsSetError(IPP_STATUS_ERROR_INTERNAL,
                                _("IPP memberName value is empty."), 1);
                  DEBUG_puts("1ippReadIO: Empty member name value.");
                  _cupsBufferRelease((char *)buffer);
-                 return (IPP_ERROR);
+                 return (IPP_STATE_ERROR);
                }
                else if ((*cb)(src, buffer, n) < n)
                {
                  DEBUG_puts("1ippReadIO: Unable to read member name value.");
                  _cupsBufferRelease((char *)buffer);
-                 return (IPP_ERROR);
+                 return (IPP_STATE_ERROR);
                }
 
                buffer[n] = '\0';
@@ -3642,12 +3642,12 @@ ippReadIO(void       *src,              /* I - Data source */
             default : /* Other unsupported values */
                 if (tag == IPP_TAG_STRING && n > IPP_MAX_LENGTH)
                {
-                 _cupsSetError(IPP_INTERNAL_ERROR,
+                 _cupsSetError(IPP_STATUS_ERROR_INTERNAL,
                                _("IPP octetString length too large."), 1);
                  DEBUG_printf(("1ippReadIO: bad octetString value length %d.",
                                n));
                  _cupsBufferRelease((char *)buffer);
-                 return (IPP_ERROR);
+                 return (IPP_STATE_ERROR);
                }
 
                 value->unknown.length = n;
@@ -3656,17 +3656,17 @@ ippReadIO(void       *src,              /* I - Data source */
                {
                  if ((value->unknown.data = malloc(n)) == NULL)
                  {
-                   _cupsSetHTTPError(HTTP_ERROR);
+                   _cupsSetHTTPError(HTTP_STATUS_ERROR);
                    DEBUG_puts("1ippReadIO: Unable to allocate value");
                    _cupsBufferRelease((char *)buffer);
-                   return (IPP_ERROR);
+                   return (IPP_STATE_ERROR);
                  }
 
                  if ((*cb)(src, value->unknown.data, n) < n)
                  {
                    DEBUG_puts("1ippReadIO: Unable to read unsupported value.");
                    _cupsBufferRelease((char *)buffer);
-                   return (IPP_ERROR);
+                   return (IPP_STATE_ERROR);
                  }
                }
                else
@@ -3683,7 +3683,7 @@ ippReadIO(void       *src,                /* I - Data source */
        }
         break;
 
-    case IPP_DATA :
+    case IPP_STATE_DATA :
         break;
 
     default :
@@ -4220,7 +4220,7 @@ ippSetString(ipp_t           *ipp,        /* IO - IPP message */
     if (element > 0)
       value->string.language = (*attr)->values[0].string.language;
 
-    if ((int)((*attr)->value_tag) & IPP_TAG_COPY)
+    if ((int)((*attr)->value_tag) & IPP_TAG_CUPS_CONST)
       value->string.text = (char *)strvalue;
     else if ((temp = _cupsStrAlloc(strvalue)) != NULL)
     {
@@ -4478,7 +4478,7 @@ ippSetValueTag(
   * Otherwise implement changes as needed...
   */
 
-  temp_tag = (ipp_tag_t)((int)((*attr)->value_tag) & IPP_TAG_MASK);
+  temp_tag = (ipp_tag_t)((int)((*attr)->value_tag) & IPP_TAG_CUPS_MASK);
 
   switch (value_tag)
   {
@@ -4524,7 +4524,7 @@ ippSetValueTag(
             temp_tag != IPP_TAG_MIMETYPE)
           return (0);
 
-        (*attr)->value_tag = (ipp_tag_t)(IPP_TAG_NAME | ((*attr)->value_tag & IPP_TAG_COPY));
+        (*attr)->value_tag = (ipp_tag_t)(IPP_TAG_NAME | ((*attr)->value_tag & IPP_TAG_CUPS_CONST));
         break;
 
     case IPP_TAG_NAMELANG :
@@ -4565,7 +4565,7 @@ ippSetValueTag(
              i --, value ++)
           value->string.language = (*attr)->values[0].string.language;
 
-        if ((int)(*attr)->value_tag & IPP_TAG_COPY)
+        if ((int)(*attr)->value_tag & IPP_TAG_CUPS_CONST)
         {
          /*
           * Make copies of all values...
@@ -5108,14 +5108,14 @@ ippValidateAttribute(
                                       hostname, sizeof(hostname),
                                       &port, resource, sizeof(resource));
 
-         if (uri_status < HTTP_URI_OK)
+         if (uri_status < HTTP_URI_STATUS_OK)
          {
            ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST,
                          _("\"%s\": Bad URI value \"%s\" - %s "
                            "(RFC 2911 section 4.1.5)."), attr->name,
                          attr->values[i].string.text,
                          uri_status_strings[uri_status -
-                                            HTTP_URI_OVERFLOW]);
+                                            HTTP_URI_STATUS_OVERFLOW]);
            return (0);
          }
 
@@ -5351,7 +5351,7 @@ ippWrite(http_t *http,                    /* I - HTTP connection */
   DEBUG_printf(("ippWrite(http=%p, ipp=%p)", http, ipp));
 
   if (!http)
-    return (IPP_ERROR);
+    return (IPP_STATE_ERROR);
 
   return (ippWriteIO(http, (ipp_iocb_t)httpWrite2, http->blocking, NULL, ipp));
 }
@@ -5369,7 +5369,7 @@ ippWriteFile(int   fd,                    /* I - HTTP data */
 {
   DEBUG_printf(("ippWriteFile(fd=%d, ipp=%p)", fd, ipp));
 
-  ipp->state = IPP_IDLE;
+  ipp->state = IPP_STATE_IDLE;
 
   return (ippWriteIO(&fd, (ipp_iocb_t)ipp_write_file, 1, NULL, ipp));
 }
@@ -5400,20 +5400,20 @@ ippWriteIO(void       *dst,             /* I - Destination */
                 dst, cb, blocking, parent, ipp));
 
   if (!dst || !ipp)
-    return (IPP_ERROR);
+    return (IPP_STATE_ERROR);
 
   if ((buffer = (unsigned char *)_cupsBufferGet(IPP_BUF_SIZE)) == NULL)
   {
     DEBUG_puts("1ippWriteIO: Unable to get write buffer");
-    return (IPP_ERROR);
+    return (IPP_STATE_ERROR);
   }
 
   switch (ipp->state)
   {
-    case IPP_IDLE :
+    case IPP_STATE_IDLE :
         ipp->state ++; /* Avoid common problem... */
 
-    case IPP_HEADER :
+    case IPP_STATE_HEADER :
         if (parent == NULL)
        {
         /*
@@ -5446,7 +5446,7 @@ ippWriteIO(void       *dst,               /* I - Destination */
          {
            DEBUG_puts("1ippWriteIO: Could not write IPP header...");
            _cupsBufferRelease((char *)buffer);
-           return (IPP_ERROR);
+           return (IPP_STATE_ERROR);
          }
        }
 
@@ -5455,7 +5455,7 @@ ippWriteIO(void       *dst,               /* I - Destination */
        * in the request/response, with no current group.
        */
 
-        ipp->state   = IPP_ATTRIBUTE;
+        ipp->state   = IPP_STATE_ATTRIBUTE;
        ipp->current = ipp->attrs;
        ipp->curtag  = IPP_TAG_ZERO;
 
@@ -5468,7 +5468,7 @@ ippWriteIO(void       *dst,               /* I - Destination */
         if (!blocking)
          break;
 
-    case IPP_ATTRIBUTE :
+    case IPP_STATE_ATTRIBUTE :
         while (ipp->current != NULL)
        {
         /*
@@ -5525,7 +5525,7 @@ ippWriteIO(void       *dst,               /* I - Destination */
            {
              DEBUG_printf(("1ippWriteIO: Attribute name too long (%d)", n));
              _cupsBufferRelease((char *)buffer);
-             return (IPP_ERROR);
+             return (IPP_STATE_ERROR);
            }
 
            /*
@@ -5564,7 +5564,7 @@ ippWriteIO(void       *dst,               /* I - Destination */
            {
              DEBUG_printf(("1ippWriteIO: Attribute name too long (%d)", n));
              _cupsBufferRelease((char *)buffer);
-             return (IPP_ERROR);
+             return (IPP_STATE_ERROR);
            }
 
            /*
@@ -5607,7 +5607,7 @@ ippWriteIO(void       *dst,               /* I - Destination */
          * Now write the attribute value(s)...
          */
 
-         switch (attr->value_tag & ~IPP_TAG_COPY)
+         switch (attr->value_tag & ~IPP_TAG_CUPS_CONST)
          {
            case IPP_TAG_UNSUPPORTED_VALUE :
            case IPP_TAG_DEFAULT :
@@ -5633,7 +5633,7 @@ ippWriteIO(void       *dst,               /* I - Destination */
                      DEBUG_puts("1ippWriteIO: Could not write IPP "
                                 "attribute...");
                      _cupsBufferRelease((char *)buffer);
-                     return (IPP_ERROR);
+                     return (IPP_STATE_ERROR);
                    }
 
                    bufptr = buffer;
@@ -5679,7 +5679,7 @@ ippWriteIO(void       *dst,               /* I - Destination */
                      DEBUG_puts("1ippWriteIO: Could not write IPP "
                                 "attribute...");
                      _cupsBufferRelease((char *)buffer);
-                     return (IPP_ERROR);
+                     return (IPP_STATE_ERROR);
                    }
 
                    bufptr = buffer;
@@ -5740,7 +5740,7 @@ ippWriteIO(void       *dst,               /* I - Destination */
                        DEBUG_puts("1ippWriteIO: Could not write IPP "
                                   "attribute...");
                        _cupsBufferRelease((char *)buffer);
-                       return (IPP_ERROR);
+                       return (IPP_STATE_ERROR);
                      }
 
                      bufptr = buffer;
@@ -5760,7 +5760,7 @@ ippWriteIO(void       *dst,               /* I - Destination */
                  {
                    DEBUG_printf(("1ippWriteIO: String too long (%d)", n));
                    _cupsBufferRelease((char *)buffer);
-                   return (IPP_ERROR);
+                   return (IPP_STATE_ERROR);
                  }
 
                   DEBUG_printf(("2ippWriteIO: writing string=%d,\"%s\"", n,
@@ -5773,7 +5773,7 @@ ippWriteIO(void       *dst,               /* I - Destination */
                      DEBUG_puts("1ippWriteIO: Could not write IPP "
                                 "attribute...");
                      _cupsBufferRelease((char *)buffer);
-                     return (IPP_ERROR);
+                     return (IPP_STATE_ERROR);
                    }
 
                    bufptr = buffer;
@@ -5812,7 +5812,7 @@ ippWriteIO(void       *dst,               /* I - Destination */
                      DEBUG_puts("1ippWriteIO: Could not write IPP "
                                 "attribute...");
                      _cupsBufferRelease((char *)buffer);
-                     return (IPP_ERROR);
+                     return (IPP_STATE_ERROR);
                    }
 
                    bufptr = buffer;
@@ -5857,7 +5857,7 @@ ippWriteIO(void       *dst,               /* I - Destination */
                      DEBUG_puts("1ippWriteIO: Could not write IPP "
                                 "attribute...");
                      _cupsBufferRelease((char *)buffer);
-                     return (IPP_ERROR);
+                     return (IPP_STATE_ERROR);
                    }
 
                    bufptr = buffer;
@@ -5910,7 +5910,7 @@ ippWriteIO(void       *dst,               /* I - Destination */
                      DEBUG_puts("1ippWriteIO: Could not write IPP "
                                 "attribute...");
                      _cupsBufferRelease((char *)buffer);
-                     return (IPP_ERROR);
+                     return (IPP_STATE_ERROR);
                    }
 
                    bufptr = buffer;
@@ -5969,7 +5969,7 @@ ippWriteIO(void       *dst,               /* I - Destination */
                        DEBUG_puts("1ippWriteIO: Could not write IPP "
                                   "attribute...");
                        _cupsBufferRelease((char *)buffer);
-                       return (IPP_ERROR);
+                       return (IPP_STATE_ERROR);
                      }
 
                      bufptr = buffer;
@@ -6003,7 +6003,7 @@ ippWriteIO(void       *dst,               /* I - Destination */
                    DEBUG_printf(("1ippWriteIO: text/nameWithLanguage value "
                                  "too long (%d)", n));
                    _cupsBufferRelease((char *)buffer);
-                   return (IPP_ERROR);
+                   return (IPP_STATE_ERROR);
                   }
 
                   if ((int)(IPP_BUF_SIZE - (bufptr - buffer)) < (n + 2))
@@ -6013,7 +6013,7 @@ ippWriteIO(void       *dst,               /* I - Destination */
                      DEBUG_puts("1ippWriteIO: Could not write IPP "
                                 "attribute...");
                      _cupsBufferRelease((char *)buffer);
-                     return (IPP_ERROR);
+                     return (IPP_STATE_ERROR);
                    }
 
                    bufptr = buffer;
@@ -6076,7 +6076,7 @@ ippWriteIO(void       *dst,               /* I - Destination */
                      DEBUG_puts("1ippWriteIO: Could not write IPP "
                                 "attribute...");
                      _cupsBufferRelease((char *)buffer);
-                     return (IPP_ERROR);
+                     return (IPP_STATE_ERROR);
                    }
 
                    bufptr = buffer;
@@ -6106,7 +6106,7 @@ ippWriteIO(void       *dst,               /* I - Destination */
                    DEBUG_puts("1ippWriteIO: Could not write IPP "
                               "attribute...");
                    _cupsBufferRelease((char *)buffer);
-                   return (IPP_ERROR);
+                   return (IPP_STATE_ERROR);
                  }
 
                  bufptr = buffer;
@@ -6115,14 +6115,14 @@ ippWriteIO(void       *dst,             /* I - Destination */
                  * Then write the collection attribute...
                  */
 
-                  value->collection->state = IPP_IDLE;
+                  value->collection->state = IPP_STATE_IDLE;
 
                  if (ippWriteIO(dst, cb, 1, ipp,
-                                value->collection) == IPP_ERROR)
+                                value->collection) == IPP_STATE_ERROR)
                  {
                    DEBUG_puts("1ippWriteIO: Unable to write collection value");
                    _cupsBufferRelease((char *)buffer);
-                   return (IPP_ERROR);
+                   return (IPP_STATE_ERROR);
                  }
                }
                break;
@@ -6146,7 +6146,7 @@ ippWriteIO(void       *dst,               /* I - Destination */
                        DEBUG_puts("1ippWriteIO: Could not write IPP "
                                   "attribute...");
                        _cupsBufferRelease((char *)buffer);
-                       return (IPP_ERROR);
+                       return (IPP_STATE_ERROR);
                      }
 
                      bufptr = buffer;
@@ -6171,7 +6171,7 @@ ippWriteIO(void       *dst,               /* I - Destination */
                    DEBUG_printf(("1ippWriteIO: Data length too long (%d)",
                                  n));
                    _cupsBufferRelease((char *)buffer);
-                   return (IPP_ERROR);
+                   return (IPP_STATE_ERROR);
                  }
 
                   if ((int)(IPP_BUF_SIZE - (bufptr - buffer)) < (n + 2))
@@ -6181,7 +6181,7 @@ ippWriteIO(void       *dst,               /* I - Destination */
                      DEBUG_puts("1ippWriteIO: Could not write IPP "
                                 "attribute...");
                      _cupsBufferRelease((char *)buffer);
-                     return (IPP_ERROR);
+                     return (IPP_STATE_ERROR);
                    }
 
                    bufptr = buffer;
@@ -6211,7 +6211,7 @@ ippWriteIO(void       *dst,               /* I - Destination */
            {
              DEBUG_puts("1ippWriteIO: Could not write IPP attribute...");
              _cupsBufferRelease((char *)buffer);
-             return (IPP_ERROR);
+             return (IPP_STATE_ERROR);
            }
 
            DEBUG_printf(("2ippWriteIO: wrote %d bytes",
@@ -6252,14 +6252,14 @@ ippWriteIO(void       *dst,             /* I - Destination */
          {
            DEBUG_puts("1ippWriteIO: Could not write IPP end-tag...");
            _cupsBufferRelease((char *)buffer);
-           return (IPP_ERROR);
+           return (IPP_STATE_ERROR);
          }
 
-         ipp->state = IPP_DATA;
+         ipp->state = IPP_STATE_DATA;
        }
         break;
 
-    case IPP_DATA :
+    case IPP_STATE_DATA :
         break;
 
     default :
@@ -6357,7 +6357,7 @@ ipp_free_values(ipp_attribute_t *attr,    /* I - Attribute to free values from */
   DEBUG_printf(("4ipp_free_values(attr=%p, element=%d, count=%d)", attr,
                 element, count));
 
-  if (!(attr->value_tag & IPP_TAG_COPY))
+  if (!(attr->value_tag & IPP_TAG_CUPS_CONST))
   {
    /*
     * Free values as needed...
@@ -6572,7 +6572,7 @@ ipp_length(ipp_t *ipp,                    /* I - IPP message or collection */
     if (collection)
       bytes += 5;                      /* Add membername overhead */
 
-    switch (attr->value_tag & ~IPP_TAG_COPY)
+    switch (attr->value_tag & ~IPP_TAG_CUPS_CONST)
     {
       case IPP_TAG_UNSUPPORTED_VALUE :
       case IPP_TAG_DEFAULT :
@@ -6694,7 +6694,7 @@ ipp_read_http(http_t      *http,  /* I - Client connection */
     DEBUG_printf(("9ipp_read_http: tbytes=%d, http->state=%d", tbytes,
                   http->state));
 
-    if (http->state == HTTP_WAITING)
+    if (http->state == HTTP_STATE_WAITING)
       break;
 
     if (http->used == 0 && !http->blocking)
@@ -6838,7 +6838,7 @@ ipp_set_value(ipp_t           *ipp,       /* IO - IPP message */
   if ((temp = realloc(temp, sizeof(ipp_attribute_t) +
                            (alloc_values - 1) * sizeof(_ipp_value_t))) == NULL)
   {
-    _cupsSetHTTPError(HTTP_ERROR);
+    _cupsSetHTTPError(HTTP_STATUS_ERROR);
     DEBUG_puts("4ipp_set_value: Unable to resize attribute.");
     return (NULL);
   }
@@ -6881,7 +6881,7 @@ ipp_set_value(ipp_t           *ipp,       /* IO - IPP message */
        */
 
        *attr = temp;
-       _cupsSetError(IPP_INTERNAL_ERROR,
+       _cupsSetError(IPP_STATUS_ERROR_INTERNAL,
                      _("IPP attribute is not a member of the message."), 1);
        DEBUG_puts("4ipp_set_value: Unable to find attribute in message.");
        return (NULL);
index d199883b64417d1067afb0f460a6934db8085588..69363aa1530a2f08fecdb10144f2192f9abb3249 100644 (file)
@@ -3,7 +3,7 @@
  *
  *   Notification routines for CUPS.
  *
- *   Copyright 2007-2012 by Apple Inc.
+ *   Copyright 2007-2013 by Apple Inc.
  *   Copyright 2005-2006 by Easy Software Products.
  *
  *   These coded instructions, statements, and computer programs are the
@@ -83,25 +83,25 @@ cupsNotifySubject(cups_lang_t *lang,        /* I - Language data */
 
     switch (job_state->values[0].integer)
     {
-      case IPP_JOB_PENDING :
+      case IPP_JSTATE_PENDING :
           state = _cupsLangString(lang, _("pending"));
          break;
-      case IPP_JOB_HELD :
+      case IPP_JSTATE_HELD :
           state = _cupsLangString(lang, _("held"));
          break;
-      case IPP_JOB_PROCESSING :
+      case IPP_JSTATE_PROCESSING :
           state = _cupsLangString(lang, _("processing"));
          break;
-      case IPP_JOB_STOPPED :
+      case IPP_JSTATE_STOPPED :
           state = _cupsLangString(lang, _("stopped"));
          break;
-      case IPP_JOB_CANCELED :
+      case IPP_JSTATE_CANCELED :
           state = _cupsLangString(lang, _("canceled"));
          break;
-      case IPP_JOB_ABORTED :
+      case IPP_JSTATE_ABORTED :
           state = _cupsLangString(lang, _("aborted"));
          break;
-      case IPP_JOB_COMPLETED :
+      case IPP_JSTATE_COMPLETED :
           state = _cupsLangString(lang, _("completed"));
          break;
       default :
@@ -127,13 +127,13 @@ cupsNotifySubject(cups_lang_t *lang,      /* I - Language data */
 
     switch (printer_state->values[0].integer)
     {
-      case IPP_PRINTER_IDLE :
+      case IPP_PSTATE_IDLE :
           state = _cupsLangString(lang, _("idle"));
          break;
-      case IPP_PRINTER_PROCESSING :
+      case IPP_PSTATE_PROCESSING :
           state = _cupsLangString(lang, _("processing"));
          break;
-      case IPP_PRINTER_STOPPED :
+      case IPP_PSTATE_STOPPED :
           state = _cupsLangString(lang, _("stopped"));
          break;
       default :
index 9fe3d6c7de50268ebd6fe8545c48f24fda92df20..c1febfa9d4919d9efacf22ddd1511372bc921ae6 100644 (file)
@@ -3,7 +3,7 @@
  *
  *   PPD cache implementation for CUPS.
  *
- *   Copyright 2010-2012 by Apple Inc.
+ *   Copyright 2010-2013 by Apple Inc.
  *
  *   These coded instructions, statements, and computer programs are the
  *   property of Apple Inc. and are protected by Federal copyright
@@ -118,7 +118,7 @@ _ppdCacheCreateWithFile(
 
   if (!filename)
   {
-    _cupsSetError(IPP_INTERNAL_ERROR, strerror(EINVAL), 0);
+    _cupsSetError(IPP_STATUS_ERROR_INTERNAL, strerror(EINVAL), 0);
     return (NULL);
   }
 
@@ -128,7 +128,7 @@ _ppdCacheCreateWithFile(
 
   if ((fp = cupsFileOpen(filename, "r")) == NULL)
   {
-    _cupsSetError(IPP_INTERNAL_ERROR, strerror(errno), 0);
+    _cupsSetError(IPP_STATUS_ERROR_INTERNAL, strerror(errno), 0);
     return (NULL);
   }
 
@@ -138,7 +138,7 @@ _ppdCacheCreateWithFile(
 
   if (!cupsFileGets(fp, line, sizeof(line)))
   {
-    _cupsSetError(IPP_INTERNAL_ERROR, strerror(errno), 0);
+    _cupsSetError(IPP_STATUS_ERROR_INTERNAL, strerror(errno), 0);
     DEBUG_puts("_ppdCacheCreateWithFile: Unable to read first line.");
     cupsFileClose(fp);
     return (NULL);
@@ -146,7 +146,7 @@ _ppdCacheCreateWithFile(
 
   if (strncmp(line, "#CUPS-PPD-CACHE-", 16))
   {
-    _cupsSetError(IPP_INTERNAL_ERROR, _("Bad PPD cache file."), 1);
+    _cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("Bad PPD cache file."), 1);
     DEBUG_printf(("_ppdCacheCreateWithFile: Wrong first line \"%s\".", line));
     cupsFileClose(fp);
     return (NULL);
@@ -154,7 +154,7 @@ _ppdCacheCreateWithFile(
 
   if (atoi(line + 16) != _PPD_CACHE_VERSION)
   {
-    _cupsSetError(IPP_INTERNAL_ERROR, _("Out of date PPD cache file."), 1);
+    _cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("Out of date PPD cache file."), 1);
     DEBUG_printf(("_ppdCacheCreateWithFile: Cache file has version %s, "
                   "expected %d.", line + 16, _PPD_CACHE_VERSION));
     cupsFileClose(fp);
@@ -167,7 +167,7 @@ _ppdCacheCreateWithFile(
 
   if ((pc = calloc(1, sizeof(_ppd_cache_t))) == NULL)
   {
-    _cupsSetError(IPP_INTERNAL_ERROR, strerror(errno), 0);
+    _cupsSetError(IPP_STATUS_ERROR_INTERNAL, strerror(errno), 0);
     DEBUG_puts("_ppdCacheCreateWithFile: Unable to allocate _ppd_cache_t.");
     goto create_error;
   }
@@ -193,7 +193,7 @@ _ppdCacheCreateWithFile(
     {
       DEBUG_printf(("_ppdCacheCreateWithFile: Missing value on line %d.",
                     linenum));
-      _cupsSetError(IPP_INTERNAL_ERROR, _("Bad PPD cache file."), 1);
+      _cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("Bad PPD cache file."), 1);
       goto create_error;
     }
     else if (!_cups_strcasecmp(line, "Filter"))
@@ -231,13 +231,13 @@ _ppdCacheCreateWithFile(
       if (attrs && *attrs)
       {
         DEBUG_puts("_ppdCacheCreateWithFile: IPP listed multiple times.");
-       _cupsSetError(IPP_INTERNAL_ERROR, _("Bad PPD cache file."), 1);
+       _cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("Bad PPD cache file."), 1);
        goto create_error;
       }
       else if (length <= 0)
       {
         DEBUG_puts("_ppdCacheCreateWithFile: Bad IPP length.");
-       _cupsSetError(IPP_INTERNAL_ERROR, _("Bad PPD cache file."), 1);
+       _cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("Bad PPD cache file."), 1);
        goto create_error;
       }
 
@@ -250,10 +250,10 @@ _ppdCacheCreateWithFile(
         *attrs = ippNew();
 
         if (ippReadIO(fp, (ipp_iocb_t)cupsFileRead, 1, NULL,
-                     *attrs) != IPP_DATA)
+                     *attrs) != IPP_STATE_DATA)
        {
          DEBUG_puts("_ppdCacheCreateWithFile: Bad IPP data.");
-         _cupsSetError(IPP_INTERNAL_ERROR, _("Bad PPD cache file."), 1);
+         _cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("Bad PPD cache file."), 1);
          goto create_error;
        }
       }
@@ -269,7 +269,7 @@ _ppdCacheCreateWithFile(
       if (cupsFileTell(fp) != (pos + length))
       {
         DEBUG_puts("_ppdCacheCreateWithFile: Bad IPP data.");
-       _cupsSetError(IPP_INTERNAL_ERROR, _("Bad PPD cache file."), 1);
+       _cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("Bad PPD cache file."), 1);
        goto create_error;
       }
     }
@@ -278,7 +278,7 @@ _ppdCacheCreateWithFile(
       if (num_bins > 0)
       {
         DEBUG_puts("_ppdCacheCreateWithFile: NumBins listed multiple times.");
-       _cupsSetError(IPP_INTERNAL_ERROR, _("Bad PPD cache file."), 1);
+       _cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("Bad PPD cache file."), 1);
        goto create_error;
       }
 
@@ -286,7 +286,7 @@ _ppdCacheCreateWithFile(
       {
         DEBUG_printf(("_ppdCacheCreateWithFile: Bad NumBins value %d on line "
                      "%d.", num_sizes, linenum));
-       _cupsSetError(IPP_INTERNAL_ERROR, _("Bad PPD cache file."), 1);
+       _cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("Bad PPD cache file."), 1);
        goto create_error;
       }
 
@@ -294,7 +294,7 @@ _ppdCacheCreateWithFile(
       {
         DEBUG_printf(("_ppdCacheCreateWithFile: Unable to allocate %d bins.",
                      num_sizes));
-       _cupsSetError(IPP_INTERNAL_ERROR, strerror(errno), 0);
+       _cupsSetError(IPP_STATUS_ERROR_INTERNAL, strerror(errno), 0);
        goto create_error;
       }
     }
@@ -303,7 +303,7 @@ _ppdCacheCreateWithFile(
       if (sscanf(value, "%127s%40s", pwg_keyword, ppd_keyword) != 2)
       {
         DEBUG_printf(("_ppdCacheCreateWithFile: Bad Bin on line %d.", linenum));
-       _cupsSetError(IPP_INTERNAL_ERROR, _("Bad PPD cache file."), 1);
+       _cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("Bad PPD cache file."), 1);
        goto create_error;
       }
 
@@ -311,7 +311,7 @@ _ppdCacheCreateWithFile(
       {
         DEBUG_printf(("_ppdCacheCreateWithFile: Too many Bin's on line %d.",
                      linenum));
-       _cupsSetError(IPP_INTERNAL_ERROR, _("Bad PPD cache file."), 1);
+       _cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("Bad PPD cache file."), 1);
        goto create_error;
       }
 
@@ -326,7 +326,7 @@ _ppdCacheCreateWithFile(
       if (num_sizes > 0)
       {
         DEBUG_puts("_ppdCacheCreateWithFile: NumSizes listed multiple times.");
-       _cupsSetError(IPP_INTERNAL_ERROR, _("Bad PPD cache file."), 1);
+       _cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("Bad PPD cache file."), 1);
        goto create_error;
       }
 
@@ -334,7 +334,7 @@ _ppdCacheCreateWithFile(
       {
         DEBUG_printf(("_ppdCacheCreateWithFile: Bad NumSizes value %d on line "
                      "%d.", num_sizes, linenum));
-       _cupsSetError(IPP_INTERNAL_ERROR, _("Bad PPD cache file."), 1);
+       _cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("Bad PPD cache file."), 1);
        goto create_error;
       }
 
@@ -344,7 +344,7 @@ _ppdCacheCreateWithFile(
        {
          DEBUG_printf(("_ppdCacheCreateWithFile: Unable to allocate %d sizes.",
                        num_sizes));
-         _cupsSetError(IPP_INTERNAL_ERROR, strerror(errno), 0);
+         _cupsSetError(IPP_STATUS_ERROR_INTERNAL, strerror(errno), 0);
          goto create_error;
        }
       }
@@ -355,7 +355,7 @@ _ppdCacheCreateWithFile(
       {
         DEBUG_printf(("_ppdCacheCreateWithFile: Too many Size's on line %d.",
                      linenum));
-       _cupsSetError(IPP_INTERNAL_ERROR, _("Bad PPD cache file."), 1);
+       _cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("Bad PPD cache file."), 1);
        goto create_error;
       }
 
@@ -367,7 +367,7 @@ _ppdCacheCreateWithFile(
       {
         DEBUG_printf(("_ppdCacheCreateWithFile: Bad Size on line %d.",
                      linenum));
-       _cupsSetError(IPP_INTERNAL_ERROR, _("Bad PPD cache file."), 1);
+       _cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("Bad PPD cache file."), 1);
        goto create_error;
       }
 
@@ -382,7 +382,7 @@ _ppdCacheCreateWithFile(
       {
         DEBUG_printf(("_ppdCacheCreateWithFile: Too many CustomSize's on line "
                      "%d.", linenum));
-       _cupsSetError(IPP_INTERNAL_ERROR, _("Bad PPD cache file."), 1);
+       _cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("Bad PPD cache file."), 1);
        goto create_error;
       }
 
@@ -394,7 +394,7 @@ _ppdCacheCreateWithFile(
       {
         DEBUG_printf(("_ppdCacheCreateWithFile: Bad CustomSize on line %d.",
                      linenum));
-       _cupsSetError(IPP_INTERNAL_ERROR, _("Bad PPD cache file."), 1);
+       _cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("Bad PPD cache file."), 1);
        goto create_error;
       }
 
@@ -416,7 +416,7 @@ _ppdCacheCreateWithFile(
       {
         DEBUG_puts("_ppdCacheCreateWithFile: NumSources listed multiple "
                   "times.");
-       _cupsSetError(IPP_INTERNAL_ERROR, _("Bad PPD cache file."), 1);
+       _cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("Bad PPD cache file."), 1);
        goto create_error;
       }
 
@@ -424,7 +424,7 @@ _ppdCacheCreateWithFile(
       {
         DEBUG_printf(("_ppdCacheCreateWithFile: Bad NumSources value %d on "
                      "line %d.", num_sources, linenum));
-       _cupsSetError(IPP_INTERNAL_ERROR, _("Bad PPD cache file."), 1);
+       _cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("Bad PPD cache file."), 1);
        goto create_error;
       }
 
@@ -432,7 +432,7 @@ _ppdCacheCreateWithFile(
       {
         DEBUG_printf(("_ppdCacheCreateWithFile: Unable to allocate %d sources.",
                      num_sources));
-       _cupsSetError(IPP_INTERNAL_ERROR, strerror(errno), 0);
+       _cupsSetError(IPP_STATUS_ERROR_INTERNAL, strerror(errno), 0);
        goto create_error;
       }
     }
@@ -442,7 +442,7 @@ _ppdCacheCreateWithFile(
       {
         DEBUG_printf(("_ppdCacheCreateWithFile: Bad Source on line %d.",
                      linenum));
-       _cupsSetError(IPP_INTERNAL_ERROR, _("Bad PPD cache file."), 1);
+       _cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("Bad PPD cache file."), 1);
        goto create_error;
       }
 
@@ -450,7 +450,7 @@ _ppdCacheCreateWithFile(
       {
         DEBUG_printf(("_ppdCacheCreateWithFile: Too many Source's on line %d.",
                      linenum));
-       _cupsSetError(IPP_INTERNAL_ERROR, _("Bad PPD cache file."), 1);
+       _cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("Bad PPD cache file."), 1);
        goto create_error;
       }
 
@@ -465,7 +465,7 @@ _ppdCacheCreateWithFile(
       if (num_types > 0)
       {
         DEBUG_puts("_ppdCacheCreateWithFile: NumTypes listed multiple times.");
-       _cupsSetError(IPP_INTERNAL_ERROR, _("Bad PPD cache file."), 1);
+       _cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("Bad PPD cache file."), 1);
        goto create_error;
       }
 
@@ -473,7 +473,7 @@ _ppdCacheCreateWithFile(
       {
         DEBUG_printf(("_ppdCacheCreateWithFile: Bad NumTypes value %d on "
                      "line %d.", num_types, linenum));
-       _cupsSetError(IPP_INTERNAL_ERROR, _("Bad PPD cache file."), 1);
+       _cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("Bad PPD cache file."), 1);
        goto create_error;
       }
 
@@ -481,7 +481,7 @@ _ppdCacheCreateWithFile(
       {
         DEBUG_printf(("_ppdCacheCreateWithFile: Unable to allocate %d types.",
                      num_types));
-       _cupsSetError(IPP_INTERNAL_ERROR, strerror(errno), 0);
+       _cupsSetError(IPP_STATUS_ERROR_INTERNAL, strerror(errno), 0);
        goto create_error;
       }
     }
@@ -491,7 +491,7 @@ _ppdCacheCreateWithFile(
       {
         DEBUG_printf(("_ppdCacheCreateWithFile: Bad Type on line %d.",
                      linenum));
-       _cupsSetError(IPP_INTERNAL_ERROR, _("Bad PPD cache file."), 1);
+       _cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("Bad PPD cache file."), 1);
        goto create_error;
       }
 
@@ -499,7 +499,7 @@ _ppdCacheCreateWithFile(
       {
         DEBUG_printf(("_ppdCacheCreateWithFile: Too many Type's on line %d.",
                      linenum));
-       _cupsSetError(IPP_INTERNAL_ERROR, _("Bad PPD cache file."), 1);
+       _cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("Bad PPD cache file."), 1);
        goto create_error;
       }
 
@@ -526,7 +526,7 @@ _ppdCacheCreateWithFile(
       {
         DEBUG_printf(("_ppdCacheCreateWithFile: Bad Preset on line %d.",
                      linenum));
-       _cupsSetError(IPP_INTERNAL_ERROR, _("Bad PPD cache file."), 1);
+       _cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("Bad PPD cache file."), 1);
        goto create_error;
       }
 
@@ -596,7 +596,7 @@ _ppdCacheCreateWithFile(
   {
     DEBUG_printf(("_ppdCacheCreateWithFile: Not enough sizes (%d < %d).",
                   pc->num_sizes, num_sizes));
-    _cupsSetError(IPP_INTERNAL_ERROR, _("Bad PPD cache file."), 1);
+    _cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("Bad PPD cache file."), 1);
     goto create_error;
   }
 
@@ -604,7 +604,7 @@ _ppdCacheCreateWithFile(
   {
     DEBUG_printf(("_ppdCacheCreateWithFile: Not enough sources (%d < %d).",
                   pc->num_sources, num_sources));
-    _cupsSetError(IPP_INTERNAL_ERROR, _("Bad PPD cache file."), 1);
+    _cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("Bad PPD cache file."), 1);
     goto create_error;
   }
 
@@ -612,7 +612,7 @@ _ppdCacheCreateWithFile(
   {
     DEBUG_printf(("_ppdCacheCreateWithFile: Not enough types (%d < %d).",
                   pc->num_types, num_types));
-    _cupsSetError(IPP_INTERNAL_ERROR, _("Bad PPD cache file."), 1);
+    _cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("Bad PPD cache file."), 1);
     goto create_error;
   }
 
@@ -1441,7 +1441,7 @@ _ppdCacheCreateWithPPD(ppd_file_t *ppd)   /* I - PPD file */
 
   create_error:
 
-  _cupsSetError(IPP_INTERNAL_ERROR, _("Out of memory."), 1);
+  _cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("Out of memory."), 1);
   _ppdCacheDestroy(pc);
 
   return (NULL);
@@ -1580,11 +1580,11 @@ _ppdCacheGetBin(
 
 int                                    /* O  - New number of options */
 _ppdCacheGetFinishingOptions(
-    _ppd_cache_t  *pc,                 /* I  - PPD cache and mapping data */
-    ipp_t         *job,                        /* I  - Job attributes or NULL */
-    ipp_finish_t  value,               /* I  - IPP finishings value of IPP_FINISHINGS_NONE */
-    int           num_options,         /* I  - Number of options */
-    cups_option_t **options)           /* IO - Options */
+    _ppd_cache_t     *pc,              /* I  - PPD cache and mapping data */
+    ipp_t            *job,             /* I  - Job attributes or NULL */
+    ipp_finishings_t value,            /* I  - IPP finishings value of IPP_FINISHINGS_NONE */
+    int              num_options,      /* I  - Number of options */
+    cups_option_t    **options)                /* IO - Options */
 {
   int                  i;              /* Looping var */
   _pwg_finishings_t    *f,             /* PWG finishings options */
@@ -2283,7 +2283,7 @@ _ppdCacheWriteFile(
 
   if (!pc || !filename)
   {
-    _cupsSetError(IPP_INTERNAL_ERROR, strerror(EINVAL), 0);
+    _cupsSetError(IPP_STATUS_ERROR_INTERNAL, strerror(EINVAL), 0);
     return (0);
   }
 
@@ -2294,7 +2294,7 @@ _ppdCacheWriteFile(
   snprintf(newfile, sizeof(newfile), "%s.N", filename);
   if ((fp = cupsFileOpen(newfile, "w9")) == NULL)
   {
-    _cupsSetError(IPP_INTERNAL_ERROR, strerror(errno), 0);
+    _cupsSetError(IPP_STATUS_ERROR_INTERNAL, strerror(errno), 0);
     return (0);
   }
 
@@ -2463,7 +2463,7 @@ _ppdCacheWriteFile(
   {
     cupsFilePrintf(fp, "IPP " CUPS_LLFMT "\n", CUPS_LLCAST ippLength(attrs));
 
-    attrs->state = IPP_IDLE;
+    attrs->state = IPP_STATE_IDLE;
     ippWriteIO(fp, (ipp_iocb_t)cupsFileWrite, 1, NULL, attrs);
   }
 
index 23514b440cd38930c2315de4494ddd9f24b652e8..28016d632437d9f6bb049295b156265291805733 100644 (file)
@@ -104,9 +104,9 @@ typedef enum _pwg_print_quality_e   /**** PWG print-quality values ****/
 
 typedef struct _pwg_finishings_s       /**** PWG finishings mapping data ****/
 {
-  ipp_finish_t value;                  /* finishings value */
-  int          num_options;            /* Number of options to apply */
-  cups_option_t        *options;               /* Options to apply */
+  ipp_finishings_t     value;          /* finishings value */
+  int                  num_options;    /* Number of options to apply */
+  cups_option_t                *options;       /* Options to apply */
 } _pwg_finishings_t;
 
 struct _ppd_cache_s                    /**** PPD cache and PWG conversion data ****/
@@ -161,12 +161,16 @@ extern _ppd_cache_t       *_ppdCacheCreateWithPPD(ppd_file_t *ppd);
 extern void            _ppdCacheDestroy(_ppd_cache_t *pc);
 extern const char      *_ppdCacheGetBin(_ppd_cache_t *pc,
                                         const char *output_bin);
-extern int             _ppdCacheGetFinishingOptions(_ppd_cache_t *pc, ipp_t *job,
-                                                    ipp_finish_t value, int num_options,
+extern int             _ppdCacheGetFinishingOptions(_ppd_cache_t *pc,
+                                                    ipp_t *job,
+                                                    ipp_finishings_t value,
+                                                    int num_options,
                                                     cups_option_t **options);
-extern int             _ppdCacheGetFinishingValues(_ppd_cache_t *pc, int num_options,
+extern int             _ppdCacheGetFinishingValues(_ppd_cache_t *pc,
+                                                   int num_options,
                                                    cups_option_t *options,
-                                                   int max_values, int *values);
+                                                   int max_values,
+                                                   int *values);
 extern const char      *_ppdCacheGetInputSlot(_ppd_cache_t *pc, ipp_t *job,
                                               const char *keyword);
 extern const char      *_ppdCacheGetMediaType(_ppd_cache_t *pc, ipp_t *job,
index 5802b84a10519d6b249fd2b56de1f0ee798f6341..1c2940bf8824089b429cdfa9ef56ababe3ad21a4 100644 (file)
@@ -462,20 +462,20 @@ _pwgInitSize(_pwg_size_t *size,           /* I - Size to initialize */
       }
       else if (!x_dimension)
       {
-       _cupsSetError(IPP_INTERNAL_ERROR,
+       _cupsSetError(IPP_STATUS_ERROR_INTERNAL,
                      _("Missing x-dimension in media-size."), 1);
         return (0);
       }
       else if (!y_dimension)
       {
-       _cupsSetError(IPP_INTERNAL_ERROR,
+       _cupsSetError(IPP_STATUS_ERROR_INTERNAL,
                      _("Missing y-dimension in media-size."), 1);
         return (0);
       }
     }
     else
     {
-      _cupsSetError(IPP_INTERNAL_ERROR, _("Missing media-size in media-col."),
+      _cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("Missing media-size in media-col."),
                     1);
       return (0);
     }
@@ -550,13 +550,13 @@ _pwgInitSize(_pwg_size_t *size,           /* I - Size to initialize */
       }
       else
       {
-        _cupsSetError(IPP_INTERNAL_ERROR, _("Unsupported media value."), 1);
+        _cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("Unsupported media value."), 1);
        return (0);
       }
     }
     else
     {
-      _cupsSetError(IPP_INTERNAL_ERROR, _("Missing media or media-col."), 1);
+      _cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("Missing media or media-col."), 1);
       return (0);
     }
   }
index 8fcb61971616efe6445f336bf6f260dc35ae9527..3aa1220db2e867f24e3ab55ecb9f2abc9e81e1d4 100644 (file)
@@ -82,7 +82,7 @@ cupsDoFileRequest(http_t     *http,   /* I - Connection to server or @code CUPS_HT
       * Can't get file information!
       */
 
-      _cupsSetError(errno == ENOENT ? IPP_NOT_FOUND : IPP_NOT_AUTHORIZED,
+      _cupsSetError(errno == ENOENT ? IPP_STATUS_ERROR_NOT_FOUND : IPP_STATUS_ERROR_NOT_AUTHORIZED,
                     NULL, 0);
 
       ippDelete(request);
@@ -146,7 +146,7 @@ cupsDoIORequest(http_t     *http,   /* I - Connection to server or @code CUPS_HTTP
   {
     ippDelete(request);
 
-    _cupsSetError(IPP_INTERNAL_ERROR, strerror(EINVAL), 0);
+    _cupsSetError(IPP_STATUS_ERROR_INTERNAL, strerror(EINVAL), 0);
 
     return (NULL);
   }
@@ -175,7 +175,7 @@ cupsDoIORequest(http_t     *http,   /* I - Connection to server or @code CUPS_HTTP
       * Can't get file information!
       */
 
-      _cupsSetError(errno == EBADF ? IPP_NOT_FOUND : IPP_NOT_AUTHORIZED,
+      _cupsSetError(errno == EBADF ? IPP_STATUS_ERROR_NOT_FOUND : IPP_STATUS_ERROR_NOT_AUTHORIZED,
                     NULL, 0);
 
       ippDelete(request);
@@ -195,7 +195,7 @@ cupsDoIORequest(http_t     *http,   /* I - Connection to server or @code CUPS_HTTP
 
       ippDelete(request);
 
-      _cupsSetError(IPP_NOT_POSSIBLE, strerror(EISDIR), 0);
+      _cupsSetError(IPP_STATUS_ERROR_NOT_POSSIBLE, strerror(EISDIR), 0);
 
       return (NULL);
     }
@@ -236,7 +236,7 @@ cupsDoIORequest(http_t     *http,   /* I - Connection to server or @code CUPS_HTTP
 
     DEBUG_printf(("2cupsDoIORequest: status=%d", status));
 
-    if (status == HTTP_CONTINUE && request->state == IPP_DATA && infile >= 0)
+    if (status == HTTP_STATUS_CONTINUE && request->state == IPP_STATE_DATA && infile >= 0)
     {
       DEBUG_puts("2cupsDoIORequest: file write...");
 
@@ -252,7 +252,7 @@ cupsDoIORequest(http_t     *http,   /* I - Connection to server or @code CUPS_HTTP
       while ((bytes = (int)read(infile, buffer, sizeof(buffer))) > 0)
       {
         if ((status = cupsWriteRequestData(http, buffer, bytes))
-                != HTTP_CONTINUE)
+                != HTTP_STATUS_CONTINUE)
          break;
       }
     }
@@ -261,7 +261,7 @@ cupsDoIORequest(http_t     *http,   /* I - Connection to server or @code CUPS_HTTP
     * Get the server's response...
     */
 
-    if (status != HTTP_ERROR)
+    if (status != HTTP_STATUS_ERROR)
     {
       response = cupsGetResponse(http, resource);
       status   = httpGetStatus(http);
@@ -269,9 +269,9 @@ cupsDoIORequest(http_t     *http,   /* I - Connection to server or @code CUPS_HTTP
 
     DEBUG_printf(("2cupsDoIORequest: status=%d", status));
 
-    if (status == HTTP_ERROR ||
-        (status >= HTTP_BAD_REQUEST && status != HTTP_UNAUTHORIZED &&
-        status != HTTP_UPGRADE_REQUIRED))
+    if (status == HTTP_STATUS_ERROR ||
+        (status >= HTTP_STATUS_BAD_REQUEST && status != HTTP_STATUS_UNAUTHORIZED &&
+        status != HTTP_STATUS_UPGRADE_REQUIRED))
     {
       _cupsSetHTTPError(status);
       break;
@@ -288,7 +288,7 @@ cupsDoIORequest(http_t     *http,   /* I - Connection to server or @code CUPS_HTTP
          break;
     }
 
-    if (http->state != HTTP_WAITING)
+    if (http->state != HTTP_STATE_WAITING)
     {
      /*
       * Flush any remaining data...
@@ -358,14 +358,14 @@ cupsGetResponse(http_t     *http, /* I - Connection to server or @code CUPS_HTTP
   if (!http)
     http = _cupsConnect();
 
-  if (!http || (http->state != HTTP_POST_RECV && http->state != HTTP_POST_SEND))
+  if (!http || (http->state != HTTP_STATE_POST_RECV && http->state != HTTP_STATE_POST_SEND))
     return (NULL);
 
  /*
   * Check for an unfinished chunked request...
   */
 
-  if (http->data_encoding == HTTP_ENCODE_CHUNKED)
+  if (http->data_encoding == HTTP_ENCODING_CHUNKED)
   {
    /*
     * Send a 0-length chunk to finish off the request...
@@ -392,7 +392,7 @@ cupsGetResponse(http_t     *http,   /* I - Connection to server or @code CUPS_HTTP
 
   DEBUG_printf(("2cupsGetResponse: status=%d", status));
 
-  if (status == HTTP_OK)
+  if (status == HTTP_STATUS_OK)
   {
    /*
     * Get the IPP response...
@@ -400,11 +400,11 @@ cupsGetResponse(http_t     *http, /* I - Connection to server or @code CUPS_HTTP
 
     response = ippNew();
 
-    while ((state = ippRead(http, response)) != IPP_DATA)
-      if (state == IPP_ERROR)
+    while ((state = ippRead(http, response)) != IPP_STATE_DATA)
+      if (state == IPP_STATE_ERROR)
        break;
 
-    if (state == IPP_ERROR)
+    if (state == IPP_STATE_ERROR)
     {
      /*
       * Flush remaining data and delete the response...
@@ -417,11 +417,11 @@ cupsGetResponse(http_t     *http, /* I - Connection to server or @code CUPS_HTTP
       ippDelete(response);
       response = NULL;
 
-      http->status = status = HTTP_ERROR;
+      http->status = status = HTTP_STATUS_ERROR;
       http->error  = EINVAL;
     }
   }
-  else if (status != HTTP_ERROR)
+  else if (status != HTTP_STATUS_ERROR)
   {
    /*
     * Flush any error message...
@@ -433,7 +433,7 @@ cupsGetResponse(http_t     *http,   /* I - Connection to server or @code CUPS_HTTP
     * Then handle encryption and authentication...
     */
 
-    if (status == HTTP_UNAUTHORIZED)
+    if (status == HTTP_STATUS_UNAUTHORIZED)
     {
      /*
       * See if we can do authentication...
@@ -442,13 +442,13 @@ cupsGetResponse(http_t     *http, /* I - Connection to server or @code CUPS_HTTP
       DEBUG_puts("2cupsGetResponse: Need authorization...");
 
       if (!cupsDoAuthentication(http, "POST", resource))
-        httpReconnect(http);
+        httpReconnect2(http, 30000, NULL);
       else
-        http->status = status = HTTP_AUTHORIZATION_CANCELED;
+        http->status = status = HTTP_STATUS_CUPS_AUTHORIZATION_CANCELED;
     }
 
 #ifdef HAVE_SSL
-    else if (status == HTTP_UPGRADE_REQUIRED)
+    else if (status == HTTP_STATUS_UPGRADE_REQUIRED)
     {
      /*
       * Force a reconnect with encryption...
@@ -456,8 +456,8 @@ cupsGetResponse(http_t     *http,   /* I - Connection to server or @code CUPS_HTTP
 
       DEBUG_puts("2cupsGetResponse: Need encryption...");
 
-      if (!httpReconnect(http))
-        httpEncryption(http, HTTP_ENCRYPT_REQUIRED);
+      if (!httpReconnect2(http, 30000, NULL))
+        httpEncryption(http, HTTP_ENCRYPTION_REQUIRED);
     }
 #endif /* HAVE_SSL */
   }
@@ -568,7 +568,7 @@ cupsReadResponseData(
 
     if ((http = cg->http) == NULL)
     {
-      _cupsSetError(IPP_INTERNAL_ERROR, _("No active connection"), 1);
+      _cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("No active connection"), 1);
       return (-1);
     }
   }
@@ -590,7 +590,7 @@ cupsReadResponseData(
  * response. Only one request can be sent/queued at a time per @code http_t@
  * connection.
  *
- * Returns the initial HTTP status code, which will be @code HTTP_CONTINUE@
+ * Returns the initial HTTP status code, which will be @code HTTP_STATUS_CONTINUE@
  * on a successful send of the request.
  *
  * Note: Unlike @link cupsDoFileRequest@, @link cupsDoIORequest@, and
@@ -622,9 +622,9 @@ cupsSendRequest(http_t     *http,   /* I - Connection to server or @code CUPS_HTTP
 
   if (!request || !resource)
   {
-    _cupsSetError(IPP_INTERNAL_ERROR, strerror(EINVAL), 0);
+    _cupsSetError(IPP_STATUS_ERROR_INTERNAL, strerror(EINVAL), 0);
 
-    return (HTTP_ERROR);
+    return (HTTP_STATUS_ERROR);
   }
 
  /*
@@ -633,24 +633,24 @@ cupsSendRequest(http_t     *http, /* I - Connection to server or @code CUPS_HTTP
 
   if (!http)
     if ((http = _cupsConnect()) == NULL)
-      return (HTTP_SERVICE_UNAVAILABLE);
+      return (HTTP_STATUS_SERVICE_UNAVAILABLE);
 
  /*
   * If the prior request was not flushed out, do so now...
   */
 
-  if (http->state == HTTP_GET_SEND ||
-      http->state == HTTP_POST_SEND)
+  if (http->state == HTTP_STATE_GET_SEND ||
+      http->state == HTTP_STATE_POST_SEND)
   {
     DEBUG_puts("2cupsSendRequest: Flush prior response.");
     httpFlush(http);
   }
-  else if (http->state != HTTP_WAITING)
+  else if (http->state != HTTP_STATE_WAITING)
   {
     DEBUG_printf(("1cupsSendRequest: Unknown HTTP state (%d), "
                   "reconnecting.", http->state));
-    if (httpReconnect(http))
-      return (HTTP_ERROR);
+    if (httpReconnect2(http, 30000, NULL))
+      return (HTTP_STATUS_ERROR);
   }
 
 #ifdef HAVE_SSL
@@ -662,10 +662,10 @@ cupsSendRequest(http_t     *http, /* I - Connection to server or @code CUPS_HTTP
 
   if (ippFindAttribute(request, "auth-info", IPP_TAG_TEXT) &&
       !httpAddrLocalhost(http->hostaddr) && !http->tls &&
-      httpEncryption(http, HTTP_ENCRYPT_REQUIRED))
+      httpEncryption(http, HTTP_ENCRYPTION_REQUIRED))
   {
     DEBUG_puts("1cupsSendRequest: Unable to encrypt connection.");
-    return (HTTP_SERVICE_UNAVAILABLE);
+    return (HTTP_STATUS_SERVICE_UNAVAILABLE);
   }
 #endif /* HAVE_SSL */
 
@@ -677,10 +677,10 @@ cupsSendRequest(http_t     *http, /* I - Connection to server or @code CUPS_HTTP
   {
     DEBUG_puts("2cupsSendRequest: Connection: close");
     httpClearFields(http);
-    if (httpReconnect(http))
+    if (httpReconnect2(http, 30000, NULL))
     {
       DEBUG_puts("1cupsSendRequest: Unable to reconnect.");
-      return (HTTP_SERVICE_UNAVAILABLE);
+      return (HTTP_STATUS_SERVICE_UNAVAILABLE);
     }
   }
 
@@ -688,7 +688,7 @@ cupsSendRequest(http_t     *http,   /* I - Connection to server or @code CUPS_HTTP
   * Loop until we can send the request without authorization problems.
   */
 
-  expect = HTTP_CONTINUE;
+  expect = HTTP_STATUS_CONTINUE;
 
   for (;;)
   {
@@ -728,10 +728,10 @@ cupsSendRequest(http_t     *http, /* I - Connection to server or @code CUPS_HTTP
     if (httpPost(http, resource))
     {
       DEBUG_puts("2cupsSendRequest: POST failed, reconnecting.");
-      if (httpReconnect(http))
+      if (httpReconnect2(http, 30000, NULL))
       {
         DEBUG_puts("1cupsSendRequest: Unable to reconnect.");
-        return (HTTP_SERVICE_UNAVAILABLE);
+        return (HTTP_STATUS_SERVICE_UNAVAILABLE);
       }
       else
         continue;
@@ -743,30 +743,30 @@ cupsSendRequest(http_t     *http, /* I - Connection to server or @code CUPS_HTTP
 
     DEBUG_puts("2cupsSendRequest: Writing IPP request...");
 
-    request->state = IPP_IDLE;
-    status         = HTTP_CONTINUE;
+    request->state = IPP_STATE_IDLE;
+    status         = HTTP_STATUS_CONTINUE;
     got_status     = 0;
 
-    while ((state = ippWrite(http, request)) != IPP_DATA)
-      if (state == IPP_ERROR)
+    while ((state = ippWrite(http, request)) != IPP_STATE_DATA)
+      if (state == IPP_STATE_ERROR)
        break;
       else if (httpCheck(http))
       {
         got_status = 1;
 
         _httpUpdate(http, &status);
-       if (status >= HTTP_MULTIPLE_CHOICES)
+       if (status >= HTTP_STATUS_MULTIPLE_CHOICES)
          break;
       }
 
-    if (state == IPP_ERROR)
+    if (state == IPP_STATE_ERROR)
     {
       DEBUG_puts("1cupsSendRequest: Unable to send IPP request.");
 
-      http->status = HTTP_ERROR;
-      http->state  = HTTP_WAITING;
+      http->status = HTTP_STATUS_ERROR;
+      http->state  = HTTP_STATE_WAITING;
 
-      return (HTTP_ERROR);
+      return (HTTP_STATUS_ERROR);
     }
 
    /*
@@ -775,7 +775,7 @@ cupsSendRequest(http_t     *http,   /* I - Connection to server or @code CUPS_HTTP
 
     if (!got_status)
     {
-      if (expect == HTTP_CONTINUE)
+      if (expect == HTTP_STATUS_CONTINUE)
       {
        DEBUG_puts("2cupsSendRequest: Waiting for 100-continue...");
 
@@ -819,16 +819,16 @@ cupsSendRequest(http_t     *http, /* I - Connection to server or @code CUPS_HTTP
       case HTTP_STATUS_UNAUTHORIZED :
           if (cupsDoAuthentication(http, "POST", resource))
          {
-            DEBUG_puts("1cupsSendRequest: Returning HTTP_AUTHORIZATION_CANCELED.");
-           return (HTTP_AUTHORIZATION_CANCELED);
+            DEBUG_puts("1cupsSendRequest: Returning HTTP_STATUS_CUPS_AUTHORIZATION_CANCELED.");
+           return (HTTP_STATUS_CUPS_AUTHORIZATION_CANCELED);
          }
 
-          DEBUG_puts("2cupsSendRequest: Reconnecting after HTTP_UNAUTHORIZED.");
+          DEBUG_puts("2cupsSendRequest: Reconnecting after HTTP_STATUS_UNAUTHORIZED.");
 
-         if (httpReconnect(http))
+         if (httpReconnect2(http, 30000, NULL))
          {
            DEBUG_puts("1cupsSendRequest: Unable to reconnect.");
-           return (HTTP_SERVICE_UNAVAILABLE);
+           return (HTTP_STATUS_SERVICE_UNAVAILABLE);
          }
          break;
 
@@ -840,19 +840,19 @@ cupsSendRequest(http_t     *http, /* I - Connection to server or @code CUPS_HTTP
          */
 
           DEBUG_puts("2cupsSendRequest: Reconnecting after "
-                    "HTTP_UPGRADE_REQUIRED.");
+                    "HTTP_STATUS_UPGRADE_REQUIRED.");
 
-         if (httpReconnect(http))
+         if (httpReconnect2(http, 30000, NULL))
          {
            DEBUG_puts("1cupsSendRequest: Unable to reconnect.");
-           return (HTTP_SERVICE_UNAVAILABLE);
+           return (HTTP_STATUS_SERVICE_UNAVAILABLE);
          }
 
          DEBUG_puts("2cupsSendRequest: Upgrading to TLS.");
-         if (httpEncryption(http, HTTP_ENCRYPT_REQUIRED))
+         if (httpEncryption(http, HTTP_ENCRYPTION_REQUIRED))
          {
            DEBUG_puts("1cupsSendRequest: Unable to encrypt connection.");
-           return (HTTP_SERVICE_UNAVAILABLE);
+           return (HTTP_STATUS_SERVICE_UNAVAILABLE);
          }
          break;
 #endif /* HAVE_SSL */
@@ -867,10 +867,10 @@ cupsSendRequest(http_t     *http, /* I - Connection to server or @code CUPS_HTTP
           DEBUG_puts("2cupsSendRequest: Reconnecting after "
                     "HTTP_EXPECTATION_FAILED.");
 
-         if (httpReconnect(http))
+         if (httpReconnect2(http, 30000, NULL))
          {
            DEBUG_puts("1cupsSendRequest: Unable to reconnect.");
-           return (HTTP_SERVICE_UNAVAILABLE);
+           return (HTTP_STATUS_SERVICE_UNAVAILABLE);
          }
          break;
 
@@ -894,7 +894,7 @@ cupsSendRequest(http_t     *http,   /* I - Connection to server or @code CUPS_HTTP
  * @since CUPS 1.4/OS X 10.6@
  */
 
-http_status_t                          /* O - @code HTTP_CONTINUE@ if OK or HTTP status on error */
+http_status_t                          /* O - @code HTTP_STATUS_CONTINUE@ if OK or HTTP status on error */
 cupsWriteRequestData(
     http_t     *http,                  /* I - Connection to server or @code CUPS_HTTP_DEFAULT@ */
     const char *buffer,                        /* I - Bytes to write */
@@ -917,9 +917,9 @@ cupsWriteRequestData(
 
     if ((http = cg->http) == NULL)
     {
-      _cupsSetError(IPP_INTERNAL_ERROR, _("No active connection"), 1);
-      DEBUG_puts("1cupsWriteRequestData: Returning HTTP_ERROR.");
-      return (HTTP_ERROR);
+      _cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("No active connection"), 1);
+      DEBUG_puts("1cupsWriteRequestData: Returning HTTP_STATUS_ERROR.");
+      return (HTTP_STATUS_ERROR);
     }
   }
 
@@ -931,9 +931,9 @@ cupsWriteRequestData(
 
   if (httpWrite2(http, buffer, length) < 0)
   {
-    DEBUG_puts("1cupsWriteRequestData: Returning HTTP_ERROR.");
-    _cupsSetError(IPP_INTERNAL_ERROR, strerror(http->error), 0);
-    return (HTTP_ERROR);
+    DEBUG_puts("1cupsWriteRequestData: Returning HTTP_STATUS_ERROR.");
+    _cupsSetError(IPP_STATUS_ERROR_INTERNAL, strerror(http->error), 0);
+    return (HTTP_STATUS_ERROR);
   }
 
  /*
@@ -953,7 +953,7 @@ cupsWriteRequestData(
       http_status_t    status;         /* Status from _httpUpdate */
 
       _httpUpdate(http, &status);
-      if (status >= HTTP_MULTIPLE_CHOICES)
+      if (status >= HTTP_STATUS_MULTIPLE_CHOICES)
       {
         _cupsSetHTTPError(status);
 
@@ -961,7 +961,7 @@ cupsWriteRequestData(
        {
          status = httpUpdate(http);
        }
-       while (status != HTTP_ERROR && http->state == HTTP_POST_RECV);
+       while (status != HTTP_STATUS_ERROR && http->state == HTTP_STATE_POST_RECV);
 
         httpFlush(http);
       }
@@ -971,8 +971,8 @@ cupsWriteRequestData(
     }
   }
 
-  DEBUG_puts("1cupsWriteRequestData: Returning HTTP_CONTINUE.");
-  return (HTTP_CONTINUE);
+  DEBUG_puts("1cupsWriteRequestData: Returning HTTP_STATUS_CONTINUE.");
+  return (HTTP_STATUS_CONTINUE);
 }
 
 
@@ -1001,7 +1001,7 @@ _cupsConnect(void)
     if (strcmp(cg->http->hostname, cg->server) ||
         cg->ipp_port != httpAddrPort(cg->http->hostaddr) ||
         (cg->http->encryption != cg->encryption &&
-        cg->http->encryption == HTTP_ENCRYPT_NEVER))
+        cg->http->encryption == HTTP_ENCRYPTION_NEVER))
     {
      /*
       * Need to close the current connection because something has changed...
@@ -1042,13 +1042,13 @@ _cupsConnect(void)
 
   if (!cg->http)
   {
-    if ((cg->http = httpConnectEncrypt(cupsServer(), ippPort(),
-                                       cupsEncryption())) == NULL)
+    if ((cg->http = httpConnect2(cupsServer(), ippPort(), NULL, AF_UNSPEC,
+                                cupsEncryption(), 1, 30000, NULL)) == NULL)
     {
       if (errno)
-        _cupsSetError(IPP_SERVICE_UNAVAILABLE, NULL, 0);
+        _cupsSetError(IPP_STATUS_ERROR_SERVICE_UNAVAILABLE, NULL, 0);
       else
-        _cupsSetError(IPP_SERVICE_UNAVAILABLE,
+        _cupsSetError(IPP_STATUS_ERROR_SERVICE_UNAVAILABLE,
                      _("Unable to connect to host."), 1);
     }
   }
@@ -1121,54 +1121,54 @@ _cupsSetHTTPError(http_status_t status) /* I - HTTP status code */
 {
   switch (status)
   {
-    case HTTP_NOT_FOUND :
-       _cupsSetError(IPP_NOT_FOUND, httpStatus(status), 0);
+    case HTTP_STATUS_NOT_FOUND :
+       _cupsSetError(IPP_STATUS_ERROR_NOT_FOUND, httpStatus(status), 0);
        break;
 
-    case HTTP_UNAUTHORIZED :
-       _cupsSetError(IPP_NOT_AUTHENTICATED, httpStatus(status), 0);
+    case HTTP_STATUS_UNAUTHORIZED :
+       _cupsSetError(IPP_STATUS_ERROR_NOT_AUTHENTICATED, httpStatus(status), 0);
        break;
 
-    case HTTP_AUTHORIZATION_CANCELED :
-       _cupsSetError(IPP_AUTHENTICATION_CANCELED, httpStatus(status), 0);
+    case HTTP_STATUS_CUPS_AUTHORIZATION_CANCELED :
+       _cupsSetError(IPP_STATUS_ERROR_CUPS_AUTHENTICATION_CANCELED, httpStatus(status), 0);
        break;
 
-    case HTTP_FORBIDDEN :
-       _cupsSetError(IPP_FORBIDDEN, httpStatus(status), 0);
+    case HTTP_STATUS_FORBIDDEN :
+       _cupsSetError(IPP_STATUS_ERROR_FORBIDDEN, httpStatus(status), 0);
        break;
 
-    case HTTP_BAD_REQUEST :
-       _cupsSetError(IPP_BAD_REQUEST, httpStatus(status), 0);
+    case HTTP_STATUS_BAD_REQUEST :
+       _cupsSetError(IPP_STATUS_ERROR_BAD_REQUEST, httpStatus(status), 0);
        break;
 
-    case HTTP_REQUEST_TOO_LARGE :
-       _cupsSetError(IPP_REQUEST_VALUE, httpStatus(status), 0);
+    case HTTP_STATUS_REQUEST_TOO_LARGE :
+       _cupsSetError(IPP_STATUS_ERROR_REQUEST_VALUE, httpStatus(status), 0);
        break;
 
-    case HTTP_NOT_IMPLEMENTED :
-       _cupsSetError(IPP_OPERATION_NOT_SUPPORTED, httpStatus(status), 0);
+    case HTTP_STATUS_NOT_IMPLEMENTED :
+       _cupsSetError(IPP_STATUS_ERROR_OPERATION_NOT_SUPPORTED, httpStatus(status), 0);
        break;
 
-    case HTTP_NOT_SUPPORTED :
-       _cupsSetError(IPP_VERSION_NOT_SUPPORTED, httpStatus(status), 0);
+    case HTTP_STATUS_NOT_SUPPORTED :
+       _cupsSetError(IPP_STATUS_ERROR_VERSION_NOT_SUPPORTED, httpStatus(status), 0);
        break;
 
-    case HTTP_UPGRADE_REQUIRED :
-       _cupsSetError(IPP_UPGRADE_REQUIRED, httpStatus(status), 0);
+    case HTTP_STATUS_UPGRADE_REQUIRED :
+       _cupsSetError(IPP_STATUS_ERROR_CUPS_UPGRADE_REQUIRED, httpStatus(status), 0);
         break;
 
-    case HTTP_PKI_ERROR :
-       _cupsSetError(IPP_PKI_ERROR, httpStatus(status), 0);
+    case HTTP_STATUS_CUPS_PKI_ERROR :
+       _cupsSetError(IPP_STATUS_ERROR_CUPS_PKI, httpStatus(status), 0);
         break;
 
-    case HTTP_ERROR :
-       _cupsSetError(IPP_INTERNAL_ERROR, strerror(errno), 0);
+    case HTTP_STATUS_ERROR :
+       _cupsSetError(IPP_STATUS_ERROR_INTERNAL, strerror(errno), 0);
         break;
 
     default :
        DEBUG_printf(("4_cupsSetHTTPError: HTTP error %d mapped to "
-                     "IPP_SERVICE_UNAVAILABLE!", status));
-       _cupsSetError(IPP_SERVICE_UNAVAILABLE, httpStatus(status), 0);
+                     "IPP_STATUS_ERROR_SERVICE_UNAVAILABLE!", status));
+       _cupsSetError(IPP_STATUS_ERROR_SERVICE_UNAVAILABLE, httpStatus(status), 0);
        break;
   }
 }
index 84772ffed3d5c45cceea962a8b5a7fa5182e21e1..28dafa7f263fe4235ececdecabdfec085a718921 100644 (file)
@@ -3,7 +3,7 @@
  *
  *   Admin function test program for CUPS.
  *
- *   Copyright 2007-2010 by Apple Inc.
+ *   Copyright 2007-2013 by Apple Inc.
  *   Copyright 2006 by Easy Software Products.
  *
  *   These coded instructions, statements, and computer programs are the
@@ -53,7 +53,8 @@ main(int  argc,                               /* I - Number of command-line args */
   * Connect to the server using the defaults...
   */
 
-  http = httpConnectEncrypt(cupsServer(), ippPort(), cupsEncryption());
+  http = httpConnect2(cupsServer(), ippPort(), NULL, AF_UNSPEC,
+                      cupsEncryption(), 1, 30000, NULL);
 
  /*
   * Set the current configuration if we have anything on the command-line...
index 18bb39cc4af0521f67949162709046fa27d98f7e..63e9478d6d67ad9a931ee7fa0b1cf2ac90824fdb 100644 (file)
@@ -3,7 +3,7 @@
  *
  *   CUPS API test program for CUPS.
  *
- *   Copyright 2007-2012 by Apple Inc.
+ *   Copyright 2007-2013 by Apple Inc.
  *   Copyright 2007 by Easy Software Products.
  *
  *   These coded instructions, statements, and computer programs are the
@@ -199,7 +199,7 @@ main(int  argc,                             /* I - Number of command-line arguments */
       interval = atoi(argv[4]);
 
       if (cupsStartDocument(CUPS_HTTP_DEFAULT, argv[1], job_id, argv[2],
-                           CUPS_FORMAT_AUTO, 1) != HTTP_CONTINUE)
+                           CUPS_FORMAT_AUTO, 1) != HTTP_STATUS_CONTINUE)
       {
        puts("Unable to start document!");
        return (1);
@@ -210,7 +210,7 @@ main(int  argc,                             /* I - Number of command-line arguments */
        printf("Writing %d bytes...\n", (int)bytes);
 
        if (cupsWriteRequestData(CUPS_HTTP_DEFAULT, buffer,
-                                bytes) != HTTP_CONTINUE)
+                                bytes) != HTTP_STATUS_CONTINUE)
        {
          puts("Unable to write bytes!");
          return (1);
@@ -222,7 +222,8 @@ main(int  argc,                             /* I - Number of command-line arguments */
 
       cupsFileClose(fp);
 
-      if (cupsFinishDocument(CUPS_HTTP_DEFAULT, argv[1]) > IPP_OK_SUBST)
+      if (cupsFinishDocument(CUPS_HTTP_DEFAULT,
+                             argv[1]) > IPP_STATUS_OK_IGNORED_OR_SUBSTITUTED)
       {
        puts("Unable to finish document!");
        return (1);
index efaab610228f0221a865052906b3d8df8eeb84ab..5b3cb28045e8e946677a83c192938b4292a5df83 100644 (file)
@@ -3,7 +3,7 @@
  *
  *   HTTP test program for CUPS.
  *
- *   Copyright 2007-2012 by Apple Inc.
+ *   Copyright 2007-2013 by Apple Inc.
  *   Copyright 1997-2006 by Easy Software Products.
  *
  *   These coded instructions, statements, and computer programs are the
@@ -51,93 +51,93 @@ typedef struct uri_test_s           /**** URI test cases ****/
 static uri_test_t      uri_tests[] =   /* URI test data */
                        {
                          /* Start with valid URIs */
-                         { HTTP_URI_OK, "file:/filename",
+                         { HTTP_URI_STATUS_OK, "file:/filename",
                            "file", "", "", "/filename", 0, 0 },
-                         { HTTP_URI_OK, "file:/filename%20with%20spaces",
+                         { HTTP_URI_STATUS_OK, "file:/filename%20with%20spaces",
                            "file", "", "", "/filename with spaces", 0, 0 },
-                         { HTTP_URI_OK, "file:///filename",
+                         { HTTP_URI_STATUS_OK, "file:///filename",
                            "file", "", "", "/filename", 0, 0 },
-                         { HTTP_URI_OK, "file:///filename%20with%20spaces",
+                         { HTTP_URI_STATUS_OK, "file:///filename%20with%20spaces",
                            "file", "", "", "/filename with spaces", 0, 0 },
-                         { HTTP_URI_OK, "file://localhost/filename",
+                         { HTTP_URI_STATUS_OK, "file://localhost/filename",
                            "file", "", "localhost", "/filename", 0, 0 },
-                         { HTTP_URI_OK, "file://localhost/filename%20with%20spaces",
+                         { HTTP_URI_STATUS_OK, "file://localhost/filename%20with%20spaces",
                            "file", "", "localhost", "/filename with spaces", 0, 0 },
-                         { HTTP_URI_OK, "http://server/",
+                         { HTTP_URI_STATUS_OK, "http://server/",
                            "http", "", "server", "/", 80, 0 },
-                         { HTTP_URI_OK, "http://username@server/",
+                         { HTTP_URI_STATUS_OK, "http://username@server/",
                            "http", "username", "server", "/", 80, 0 },
-                         { HTTP_URI_OK, "http://username:passwor%64@server/",
+                         { HTTP_URI_STATUS_OK, "http://username:passwor%64@server/",
                            "http", "username:password", "server", "/", 80, 0 },
-                         { HTTP_URI_OK, "http://username:passwor%64@server:8080/",
+                         { HTTP_URI_STATUS_OK, "http://username:passwor%64@server:8080/",
                            "http", "username:password", "server", "/", 8080, 8080 },
-                         { HTTP_URI_OK, "http://username:passwor%64@server:8080/directory/filename",
+                         { HTTP_URI_STATUS_OK, "http://username:passwor%64@server:8080/directory/filename",
                            "http", "username:password", "server", "/directory/filename", 8080, 8080 },
-                         { HTTP_URI_OK, "http://[2000::10:100]:631/ipp",
+                         { HTTP_URI_STATUS_OK, "http://[2000::10:100]:631/ipp",
                            "http", "", "2000::10:100", "/ipp", 631, 631 },
-                         { HTTP_URI_OK, "https://username:passwor%64@server/directory/filename",
+                         { HTTP_URI_STATUS_OK, "https://username:passwor%64@server/directory/filename",
                            "https", "username:password", "server", "/directory/filename", 443, 0 },
-                         { HTTP_URI_OK, "ipp://username:passwor%64@[::1]/ipp",
+                         { HTTP_URI_STATUS_OK, "ipp://username:passwor%64@[::1]/ipp",
                            "ipp", "username:password", "::1", "/ipp", 631, 0 },
-                         { HTTP_URI_OK, "lpd://server/queue?reserve=yes",
+                         { HTTP_URI_STATUS_OK, "lpd://server/queue?reserve=yes",
                            "lpd", "", "server", "/queue?reserve=yes", 515, 0 },
-                         { HTTP_URI_OK, "mailto:user@domain.com",
+                         { HTTP_URI_STATUS_OK, "mailto:user@domain.com",
                            "mailto", "", "", "user@domain.com", 0, 0 },
-                         { HTTP_URI_OK, "socket://server/",
+                         { HTTP_URI_STATUS_OK, "socket://server/",
                            "socket", "", "server", "/", 9100, 0 },
-                         { HTTP_URI_OK, "socket://192.168.1.1:9101/",
+                         { HTTP_URI_STATUS_OK, "socket://192.168.1.1:9101/",
                            "socket", "", "192.168.1.1", "/", 9101, 9101 },
-                         { HTTP_URI_OK, "ipp://username:password@[v1.fe80::200:1234:5678:9abc+eth0]:999/ipp",
+                         { HTTP_URI_STATUS_OK, "ipp://username:password@[v1.fe80::200:1234:5678:9abc+eth0]:999/ipp",
                            "ipp", "username:password", "fe80::200:1234:5678:9abc%eth0", "/ipp", 999, 999 },
-                         { HTTP_URI_OK, "http://server/admin?DEVICE_URI=usb://HP/Photosmart%25202600%2520series?serial=MY53OK70V10400",
+                         { HTTP_URI_STATUS_OK, "http://server/admin?DEVICE_URI=usb://HP/Photosmart%25202600%2520series?serial=MY53OK70V10400",
                            "http", "", "server", "/admin?DEVICE_URI=usb://HP/Photosmart%25202600%2520series?serial=MY53OK70V10400", 80, 0 },
-                         { HTTP_URI_OK, "lpd://Acme%20Laser%20(01%3A23%3A45).local._tcp._printer/",
+                         { HTTP_URI_STATUS_OK, "lpd://Acme%20Laser%20(01%3A23%3A45).local._tcp._printer/",
                            "lpd", "", "Acme Laser (01:23:45).local._tcp._printer", "/", 515, 0 },
-                         { HTTP_URI_OK, "ipp://HP%20Officejet%204500%20G510n-z%20%40%20Will's%20MacBook%20Pro%2015%22._ipp._tcp.local./",
+                         { HTTP_URI_STATUS_OK, "ipp://HP%20Officejet%204500%20G510n-z%20%40%20Will's%20MacBook%20Pro%2015%22._ipp._tcp.local./",
                            "ipp", "", "HP Officejet 4500 G510n-z @ Will's MacBook Pro 15\"._ipp._tcp.local.", "/", 631, 0 },
 
                          /* Missing scheme */
-                         { HTTP_URI_MISSING_SCHEME, "/path/to/file/index.html",
+                         { HTTP_URI_STATUS_MISSING_SCHEME, "/path/to/file/index.html",
                            "file", "", "", "/path/to/file/index.html", 0, 0 },
-                         { HTTP_URI_MISSING_SCHEME, "//server/ipp",
+                         { HTTP_URI_STATUS_MISSING_SCHEME, "//server/ipp",
                            "ipp", "", "server", "/ipp", 631, 0 },
 
                          /* Unknown scheme */
-                         { HTTP_URI_UNKNOWN_SCHEME, "vendor://server/resource",
+                         { HTTP_URI_STATUS_UNKNOWN_SCHEME, "vendor://server/resource",
                            "vendor", "", "server", "/resource", 0, 0 },
 
                          /* Missing resource */
-                         { HTTP_URI_MISSING_RESOURCE, "socket://[::192.168.2.1]",
+                         { HTTP_URI_STATUS_MISSING_RESOURCE, "socket://[::192.168.2.1]",
                            "socket", "", "::192.168.2.1", "/", 9100, 0 },
-                         { HTTP_URI_MISSING_RESOURCE, "socket://192.168.1.1:9101",
+                         { HTTP_URI_STATUS_MISSING_RESOURCE, "socket://192.168.1.1:9101",
                            "socket", "", "192.168.1.1", "/", 9101 },
 
                          /* Bad URI */
-                         { HTTP_URI_BAD_URI, "",
+                         { HTTP_URI_STATUS_BAD_URI, "",
                            "", "", "", "", 0, 0 },
 
                          /* Bad scheme */
-                         { HTTP_URI_BAD_SCHEME, "bad_scheme://server/resource",
+                         { HTTP_URI_STATUS_BAD_SCHEME, "bad_scheme://server/resource",
                            "", "", "", "", 0, 0 },
 
                          /* Bad username */
-                         { HTTP_URI_BAD_USERNAME, "http://username:passwor%6@server/resource",
+                         { HTTP_URI_STATUS_BAD_USERNAME, "http://username:passwor%6@server/resource",
                            "http", "", "", "", 80, 0 },
 
                          /* Bad hostname */
-                         { HTTP_URI_BAD_HOSTNAME, "http://[/::1]/index.html",
+                         { HTTP_URI_STATUS_BAD_HOSTNAME, "http://[/::1]/index.html",
                            "http", "", "", "", 80, 0 },
-                         { HTTP_URI_BAD_HOSTNAME, "http://[",
+                         { HTTP_URI_STATUS_BAD_HOSTNAME, "http://[",
                            "http", "", "", "", 80, 0 },
-                         { HTTP_URI_BAD_HOSTNAME, "http://serve%7/index.html",
+                         { HTTP_URI_STATUS_BAD_HOSTNAME, "http://serve%7/index.html",
                            "http", "", "", "", 80, 0 },
 
                          /* Bad port number */
-                         { HTTP_URI_BAD_PORT, "http://127.0.0.1:9999a/index.html",
+                         { HTTP_URI_STATUS_BAD_PORT, "http://127.0.0.1:9999a/index.html",
                            "http", "", "127.0.0.1", "", 0, 0 },
 
                          /* Bad resource */
-                         { HTTP_URI_BAD_RESOURCE, "http://server/index.html%",
+                         { HTTP_URI_STATUS_BAD_RESOURCE, "http://server/index.html%",
                            "http", "", "server", "", 80, 0 }
                        };
 static const char * const base64_tests[][2] =
@@ -189,18 +189,18 @@ main(int  argc,                           /* I - Number of command-line arguments */
   const char   *encoding;              /* Negotiated Content-Encoding */
   static const char * const uri_status_strings[] =
                {
-                 "HTTP_URI_OVERFLOW",
-                 "HTTP_URI_BAD_ARGUMENTS",
-                 "HTTP_URI_BAD_RESOURCE",
-                 "HTTP_URI_BAD_PORT",
-                 "HTTP_URI_BAD_HOSTNAME",
-                 "HTTP_URI_BAD_USERNAME",
-                 "HTTP_URI_BAD_SCHEME",
-                 "HTTP_URI_BAD_URI",
-                 "HTTP_URI_OK",
-                 "HTTP_URI_MISSING_SCHEME",
-                 "HTTP_URI_UNKNOWN_SCHEME",
-                 "HTTP_URI_MISSING_RESOURCE"
+                 "HTTP_URI_STATUS_OVERFLOW",
+                 "HTTP_URI_STATUS_BAD_ARGUMENTS",
+                 "HTTP_URI_STATUS_BAD_RESOURCE",
+                 "HTTP_URI_STATUS_BAD_PORT",
+                 "HTTP_URI_STATUS_BAD_HOSTNAME",
+                 "HTTP_URI_STATUS_BAD_USERNAME",
+                 "HTTP_URI_STATUS_BAD_SCHEME",
+                 "HTTP_URI_STATUS_BAD_URI",
+                 "HTTP_URI_STATUS_OK",
+                 "HTTP_URI_STATUS_MISSING_SCHEME",
+                 "HTTP_URI_STATUS_UNKNOWN_SCHEME",
+                 "HTTP_URI_STATUS_MISSING_RESOURCE"
                };
 
 
@@ -403,7 +403,7 @@ main(int  argc,                             /* I - Number of command-line arguments */
     for (i = 0, j = 0, k = 0;
          i < (int)(sizeof(uri_tests) / sizeof(uri_tests[0]));
         i ++)
-      if (uri_tests[i].result == HTTP_URI_OK &&
+      if (uri_tests[i].result == HTTP_URI_STATUS_OK &&
           !strstr(uri_tests[i].uri, "%64") &&
           strstr(uri_tests[i].uri, "//"))
       {
@@ -416,7 +416,7 @@ main(int  argc,                             /* I - Number of command-line arguments */
                                     uri_tests[i].assemble_port,
                                     uri_tests[i].resource);
 
-        if (uri_status != HTTP_URI_OK)
+        if (uri_status != HTTP_URI_STATUS_OK)
        {
           failures ++;
 
@@ -545,11 +545,12 @@ main(int  argc,                           /* I - Number of command-line arguments */
 
     if (!_cups_strcasecmp(scheme, "https") || !_cups_strcasecmp(scheme, "ipps") ||
         port == 443)
-      encryption = HTTP_ENCRYPT_ALWAYS;
+      encryption = HTTP_ENCRYPTION_ALWAYS;
     else
-      encryption = HTTP_ENCRYPT_IF_REQUESTED;
+      encryption = HTTP_ENCRYPTION_IF_REQUESTED;
 
-    http = httpConnectEncrypt(hostname, port, encryption);
+    http = httpConnect2(hostname, port, NULL, AF_UNSPEC, encryption, 1, 30000,
+                        NULL);
     if (http == NULL)
     {
       perror(hostname);
@@ -559,9 +560,9 @@ main(int  argc,                             /* I - Number of command-line arguments */
     httpClearFields(http);
     httpSetField(http, HTTP_FIELD_ACCEPT_LANGUAGE, "en");
     httpHead(http, resource);
-    while ((status = httpUpdate(http)) == HTTP_CONTINUE);
+    while ((status = httpUpdate(http)) == HTTP_STATUS_CONTINUE);
 
-    if (status == HTTP_OK)
+    if (status == HTTP_STATUS_OK)
       puts("HEAD OK:");
     else
       printf("HEAD failed with status %d...\n", status);
@@ -574,9 +575,9 @@ main(int  argc,                             /* I - Number of command-line arguments */
     httpSetField(http, HTTP_FIELD_ACCEPT_LANGUAGE, "en");
     httpSetField(http, HTTP_FIELD_ACCEPT_ENCODING, encoding);
     httpGet(http, resource);
-    while ((status = httpUpdate(http)) == HTTP_CONTINUE);
+    while ((status = httpUpdate(http)) == HTTP_STATUS_CONTINUE);
 
-    if (status == HTTP_OK)
+    if (status == HTTP_STATUS_OK)
       puts("GET OK:");
     else
       printf("GET failed with status %d...\n", status);
index d25400e79c2314d1da27d1fc9d267c4fff2c3cdd..a0f6a686f2a990c1b204f9240b994ddb5f608c27 100644 (file)
@@ -3,7 +3,7 @@
  *
  *   IPP test program for CUPS.
  *
- *   Copyright 2007-2012 by Apple Inc.
+ *   Copyright 2007-2013 by Apple Inc.
  *   Copyright 1997-2005 by Easy Software Products.
  *
  *   These coded instructions, statements, and computer programs are the
@@ -279,7 +279,7 @@ main(int  argc,                     /* I - Number of command-line arguments */
     request = ippNew();
     request->request.op.version[0]   = 0x01;
     request->request.op.version[1]   = 0x01;
-    request->request.op.operation_id = IPP_PRINT_JOB;
+    request->request.op.operation_id = IPP_OP_PRINT_JOB;
     request->request.op.request_id   = 1;
 
     ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET,
@@ -337,11 +337,11 @@ main(int  argc,                   /* I - Number of command-line arguments */
     data.wbuffer = buffer;
 
     while ((state = ippWriteIO(&data, (ipp_iocb_t)write_cb, 1, NULL,
-                               request)) != IPP_DATA)
-      if (state == IPP_ERROR)
+                               request)) != IPP_STATE_DATA)
+      if (state == IPP_STATE_ERROR)
        break;
 
-    if (state != IPP_DATA)
+    if (state != IPP_STATE_DATA)
     {
       printf("FAIL - %d bytes written.\n", (int)data.wused);
       status = 1;
@@ -380,13 +380,13 @@ main(int  argc,                   /* I - Number of command-line arguments */
     data.rpos = 0;
 
     while ((state = ippReadIO(&data, (ipp_iocb_t)read_cb, 1, NULL,
-                              request)) != IPP_DATA)
-      if (state == IPP_ERROR)
+                              request)) != IPP_STATE_DATA)
+      if (state == IPP_STATE_ERROR)
        break;
 
     length = ippLength(request);
 
-    if (state != IPP_DATA)
+    if (state != IPP_STATE_DATA)
     {
       printf("FAIL - %d bytes read.\n", (int)data.rpos);
       status = 1;
@@ -564,13 +564,13 @@ main(int  argc,                   /* I - Number of command-line arguments */
     data.wbuffer = mixed;
 
     while ((state = ippReadIO(&data, (ipp_iocb_t)read_cb, 1, NULL,
-                              request)) != IPP_DATA)
-      if (state == IPP_ERROR)
+                              request)) != IPP_STATE_DATA)
+      if (state == IPP_STATE_ERROR)
        break;
 
     length = ippLength(request);
 
-    if (state != IPP_DATA)
+    if (state != IPP_STATE_DATA)
     {
       printf("FAIL - %d bytes read.\n", (int)data.rpos);
       status = 1;
@@ -682,9 +682,9 @@ main(int  argc,                     /* I - Number of command-line arguments */
 
       request = ippNew();
       while ((state = ippReadIO(fp, (ipp_iocb_t)cupsFileRead, 1, NULL,
-                                request)) == IPP_ATTRIBUTE);
+                                request)) == IPP_STATE_ATTRIBUTE);
 
-      if (state != IPP_DATA)
+      if (state != IPP_STATE_DATA)
       {
        printf("Error reading IPP message from \"%s\"!\n", argv[i]);
        status = 1;
index 12d76f77240380649acfb65d4da3fd01ccc20dd1..82077b5e03063ab4b64b0dfc57b5ae7ec87197ad 100644 (file)
@@ -86,7 +86,7 @@ static void   cups_read_client_conf(cups_file_t *fp,
  * The default encryption setting comes from the CUPS_ENCRYPTION
  * environment variable, then the ~/.cups/client.conf file, and finally the
  * /etc/cups/client.conf file. If not set, the default is
- * @code HTTP_ENCRYPT_IF_REQUESTED@.
+ * @code HTTP_ENCRYPTION_IF_REQUESTED@.
  *
  * Note: The current encryption setting is tracked separately for each thread
  * in a program. Multi-threaded programs that override the setting via the
@@ -249,7 +249,7 @@ cupsSetCredentials(
  * The default encryption setting comes from the CUPS_ENCRYPTION
  * environment variable, then the ~/.cups/client.conf file, and finally the
  * /etc/cups/client.conf file. If not set, the default is
- * @code HTTP_ENCRYPT_IF_REQUESTED@.
+ * @code HTTP_ENCRYPTION_IF_REQUESTED@.
  *
  * Note: The current encryption setting is tracked separately for each thread
  * in a program. Multi-threaded programs that override the setting need to do
@@ -1021,13 +1021,13 @@ cups_read_client_conf(
   if (cg->encryption == (http_encryption_t)-1 && cups_encryption)
   {
     if (!_cups_strcasecmp(cups_encryption, "never"))
-      cg->encryption = HTTP_ENCRYPT_NEVER;
+      cg->encryption = HTTP_ENCRYPTION_NEVER;
     else if (!_cups_strcasecmp(cups_encryption, "always"))
-      cg->encryption = HTTP_ENCRYPT_ALWAYS;
+      cg->encryption = HTTP_ENCRYPTION_ALWAYS;
     else if (!_cups_strcasecmp(cups_encryption, "required"))
-      cg->encryption = HTTP_ENCRYPT_REQUIRED;
+      cg->encryption = HTTP_ENCRYPTION_REQUIRED;
     else
-      cg->encryption = HTTP_ENCRYPT_IF_REQUESTED;
+      cg->encryption = HTTP_ENCRYPTION_IF_REQUESTED;
   }
 
   if ((!cg->server[0] || !cg->ipp_port) && cups_server)
index b999129e2f5a599d7335c506af4fa1e793c52abf..8b307091706f1151d9e856ae6bd164d3b1ea9b32 100644 (file)
@@ -3,7 +3,7 @@
  *
  *   Printing utilities for CUPS.
  *
- *   Copyright 2007-2012 by Apple Inc.
+ *   Copyright 2007-2013 by Apple Inc.
  *   Copyright 1997-2006 by Easy Software Products.
  *
  *   These coded instructions, statements, and computer programs are the
@@ -90,7 +90,7 @@ cupsCancelJob(const char *name,               /* I - Name of printer or class */
               int        job_id)       /* I - Job ID, @code CUPS_JOBID_CURRENT@ for the current job, or @code CUPS_JOBID_ALL@ for all jobs */
 {
   return (cupsCancelJob2(CUPS_HTTP_DEFAULT, name, job_id, 0)
-              < IPP_REDIRECTION_OTHER_SITE);
+              < IPP_STATUS_REDIRECTION_OTHER_SITE);
 }
 
 
@@ -125,7 +125,7 @@ cupsCancelJob2(http_t     *http,    /* I - Connection to server or @code CUPS_HTTP_
 
   if (job_id < -1 || (!name && job_id == 0))
   {
-    _cupsSetError(IPP_INTERNAL_ERROR, strerror(EINVAL), 0);
+    _cupsSetError(IPP_STATUS_ERROR_INTERNAL, strerror(EINVAL), 0);
     return (0);
   }
 
@@ -135,7 +135,7 @@ cupsCancelJob2(http_t     *http,    /* I - Connection to server or @code CUPS_HTTP_
 
   if (!http)
     if ((http = _cupsConnect()) == NULL)
-      return (IPP_SERVICE_UNAVAILABLE);
+      return (IPP_STATUS_ERROR_SERVICE_UNAVAILABLE);
 
  /*
   * Build an IPP_CANCEL_JOB or IPP_PURGE_JOBS request, which requires the following
@@ -148,7 +148,7 @@ cupsCancelJob2(http_t     *http,    /* I - Connection to server or @code CUPS_HTTP_
   *    [purge-job] or [purge-jobs]
   */
 
-  request = ippNewRequest(job_id < 0 ? IPP_PURGE_JOBS : IPP_CANCEL_JOB);
+  request = ippNewRequest(job_id < 0 ? IPP_OP_PURGE_JOBS : IPP_OP_CANCEL_JOB);
 
   if (name)
   {
@@ -223,7 +223,7 @@ cupsCreateJob(
 
   if (!name)
   {
-    _cupsSetError(IPP_INTERNAL_ERROR, strerror(EINVAL), 0);
+    _cupsSetError(IPP_STATUS_ERROR_INTERNAL, strerror(EINVAL), 0);
     return (0);
   }
 
@@ -231,9 +231,9 @@ cupsCreateJob(
   * Build a Create-Job request...
   */
 
-  if ((request = ippNewRequest(IPP_CREATE_JOB)) == NULL)
+  if ((request = ippNewRequest(IPP_OP_CREATE_JOB)) == NULL)
   {
-    _cupsSetError(IPP_INTERNAL_ERROR, strerror(ENOMEM), 0);
+    _cupsSetError(IPP_STATUS_ERROR_INTERNAL, strerror(ENOMEM), 0);
     return (0);
   }
 
@@ -342,7 +342,7 @@ cupsGetClasses(char ***classes)             /* O - Classes */
 
   if (!classes)
   {
-    _cupsSetError(IPP_INTERNAL_ERROR, strerror(EINVAL), 0);
+    _cupsSetError(IPP_STATUS_ERROR_INTERNAL, strerror(EINVAL), 0);
 
     return (0);
   }
@@ -361,7 +361,7 @@ cupsGetClasses(char ***classes)             /* O - Classes */
   *    requested-attributes
   */
 
-  request = ippNewRequest(CUPS_GET_CLASSES);
+  request = ippNewRequest(IPP_OP_CUPS_GET_CLASSES);
 
   ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD,
                "requested-attributes", NULL, "printer-name");
@@ -480,7 +480,7 @@ cupsGetDefault2(http_t *http)               /* I - Connection to server or @code CUPS_HTTP_DE
   *    attributes-natural-language
   */
 
-  request = ippNewRequest(CUPS_GET_DEFAULT);
+  request = ippNewRequest(IPP_OP_CUPS_GET_DEFAULT);
 
  /*
   * Do the request and get back a response...
@@ -586,7 +586,7 @@ cupsGetJobs2(http_t     *http,              /* I - Connection to server or @code CUPS_HTTP_D
 
   if (!jobs)
   {
-    _cupsSetError(IPP_INTERNAL_ERROR, strerror(EINVAL), 0);
+    _cupsSetError(IPP_STATUS_ERROR_INTERNAL, strerror(EINVAL), 0);
 
     return (-1);
   }
@@ -598,9 +598,11 @@ cupsGetJobs2(http_t     *http,             /* I - Connection to server or @code CUPS_HTTP_D
   if (name)
   {
     if (httpAssembleURIf(HTTP_URI_CODING_ALL, uri, sizeof(uri), "ipp", NULL,
-                         "localhost", 0, "/printers/%s", name) != HTTP_URI_OK)
+                         "localhost", 0, "/printers/%s",
+                         name) < HTTP_URI_STATUS_OK)
     {
-      _cupsSetError(IPP_INTERNAL_ERROR, _("Unable to create printer-uri"), 1);
+      _cupsSetError(IPP_STATUS_ERROR_INTERNAL,
+                    _("Unable to create printer-uri"), 1);
 
       return (-1);
     }
@@ -625,7 +627,7 @@ cupsGetJobs2(http_t     *http,              /* I - Connection to server or @code CUPS_HTTP_D
   *    requested-attributes
   */
 
-  request = ippNewRequest(IPP_GET_JOBS);
+  request = ippNewRequest(IPP_OP_GET_JOBS);
 
   ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI,
                "printer-uri", NULL, uri);
@@ -675,7 +677,7 @@ cupsGetJobs2(http_t     *http,              /* I - Connection to server or @code CUPS_HTTP_D
       id              = 0;
       size            = 0;
       priority        = 50;
-      state           = IPP_JOB_PENDING;
+      state           = IPP_JSTATE_PENDING;
       user            = "unknown";
       dest            = NULL;
       format          = "application/octet-stream";
@@ -754,7 +756,7 @@ cupsGetJobs2(http_t     *http,              /* I - Connection to server or @code CUPS_HTTP_D
         * Ran out of memory!
         */
 
-        _cupsSetError(IPP_INTERNAL_ERROR, NULL, 0);
+        _cupsSetError(IPP_STATUS_ERROR_INTERNAL, NULL, 0);
 
        cupsFreeJobs(n, *jobs);
        *jobs = NULL;
@@ -791,7 +793,7 @@ cupsGetJobs2(http_t     *http,              /* I - Connection to server or @code CUPS_HTTP_D
     ippDelete(response);
   }
 
-  if (n == 0 && cg->last_error >= IPP_BAD_REQUEST)
+  if (n == 0 && cg->last_error >= IPP_STATUS_ERROR_BAD_REQUEST)
     return (-1);
   else
     return (n);
@@ -823,7 +825,7 @@ cupsGetPPD(const char *name)                /* I - Destination name */
   cg->ppd_filename[0] = '\0';
 
   if (cupsGetPPD3(CUPS_HTTP_DEFAULT, name, &modtime, cg->ppd_filename,
-                  sizeof(cg->ppd_filename)) == HTTP_OK)
+                  sizeof(cg->ppd_filename)) == HTTP_STATUS_OK)
     return (cg->ppd_filename);
   else
     return (NULL);
@@ -854,7 +856,7 @@ cupsGetPPD2(http_t     *http,               /* I - Connection to server or @code CUPS_HTTP_DE
   cg->ppd_filename[0] = '\0';
 
   if (cupsGetPPD3(http, name, &modtime, cg->ppd_filename,
-                  sizeof(cg->ppd_filename)) == HTTP_OK)
+                  sizeof(cg->ppd_filename)) == HTTP_STATUS_OK)
     return (cg->ppd_filename);
   else
     return (NULL);
@@ -874,8 +876,8 @@ cupsGetPPD2(http_t     *http,               /* I - Connection to server or @code CUPS_HTTP_DE
  * file will be overwritten as needed.  The caller "owns" the file that is
  * created and must @code unlink@ the returned filename.
  *
- * On success, @code HTTP_OK@ is returned for a new PPD file and
- * @code HTTP_NOT_MODIFIED@ if the existing PPD file is up-to-date.  Any other
+ * On success, @code HTTP_STATUS_OK@ is returned for a new PPD file and
+ * @code HTTP_STATUS_NOT_MODIFIED@ if the existing PPD file is up-to-date.  Any other
  * status is an error.
  *
  * For classes, @code cupsGetPPD3@ returns the PPD file for the first printer
@@ -915,20 +917,20 @@ cupsGetPPD3(http_t     *http,             /* I  - HTTP connection or @code CUPS_HTTP_DEFAUL
 
   if (!name)
   {
-    _cupsSetError(IPP_INTERNAL_ERROR, _("No printer name"), 1);
-    return (HTTP_NOT_ACCEPTABLE);
+    _cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("No printer name"), 1);
+    return (HTTP_STATUS_NOT_ACCEPTABLE);
   }
 
   if (!modtime)
   {
-    _cupsSetError(IPP_INTERNAL_ERROR, _("No modification time"), 1);
-    return (HTTP_NOT_ACCEPTABLE);
+    _cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("No modification time"), 1);
+    return (HTTP_STATUS_NOT_ACCEPTABLE);
   }
 
   if (!buffer || bufsize <= 1)
   {
-    _cupsSetError(IPP_INTERNAL_ERROR, _("Bad filename buffer"), 1);
-    return (HTTP_NOT_ACCEPTABLE);
+    _cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("Bad filename buffer"), 1);
+    return (HTTP_STATUS_NOT_ACCEPTABLE);
   }
 
 #ifndef WIN32
@@ -965,9 +967,9 @@ cupsGetPPD3(http_t     *http,               /* I  - HTTP connection or @code CUPS_HTTP_DEFAUL
 
        if (symlink(ppdname, buffer) && errno != EEXIST)
         {
-          _cupsSetError(IPP_INTERNAL_ERROR, NULL, 0);
+          _cupsSetError(IPP_STATUS_ERROR_INTERNAL, NULL, 0);
 
-         return (HTTP_SERVER_ERROR);
+         return (HTTP_STATUS_SERVER_ERROR);
        }
       }
       else
@@ -1025,18 +1027,18 @@ cupsGetPPD3(http_t     *http,           /* I  - HTTP connection or @code CUPS_HTTP_DEFAUL
 
         if (tries >= 1000)
        {
-          _cupsSetError(IPP_INTERNAL_ERROR, NULL, 0);
+          _cupsSetError(IPP_STATUS_ERROR_INTERNAL, NULL, 0);
 
-         return (HTTP_SERVER_ERROR);
+         return (HTTP_STATUS_SERVER_ERROR);
        }
       }
 
       if (*modtime >= ppdinfo.st_mtime)
-        return (HTTP_NOT_MODIFIED);
+        return (HTTP_STATUS_NOT_MODIFIED);
       else
       {
         *modtime = ppdinfo.st_mtime;
-       return (HTTP_OK);
+       return (HTTP_STATUS_OK);
       }
     }
   }
@@ -1048,11 +1050,11 @@ cupsGetPPD3(http_t     *http,           /* I  - HTTP connection or @code CUPS_HTTP_DEFAUL
 
   if (!http)
     if ((http = _cupsConnect()) == NULL)
-      return (HTTP_SERVICE_UNAVAILABLE);
+      return (HTTP_STATUS_SERVICE_UNAVAILABLE);
 
   if (!cups_get_printer_uri(http, name, hostname, sizeof(hostname), &port,
                             resource, sizeof(resource), 0))
-    return (HTTP_NOT_FOUND);
+    return (HTTP_STATUS_NOT_FOUND);
 
   DEBUG_printf(("2cupsGetPPD3: Printer hostname=\"%s\", port=%d", hostname,
                 port));
@@ -1084,12 +1086,12 @@ cupsGetPPD3(http_t     *http,           /* I  - HTTP connection or @code CUPS_HTTP_DEFAUL
 
   if (!_cups_strcasecmp(http_hostname, hostname) && port == http_port)
     http2 = http;
-  else if ((http2 = httpConnectEncrypt(hostname, port,
-                                       cupsEncryption())) == NULL)
+  else if ((http2 = httpConnect2(hostname, port, NULL, AF_UNSPEC,
+                                cupsEncryption(), 1, 30000, NULL)) == NULL)
   {
     DEBUG_puts("1cupsGetPPD3: Unable to connect to server");
 
-    return (HTTP_SERVICE_UNAVAILABLE);
+    return (HTTP_STATUS_SERVICE_UNAVAILABLE);
   }
 
  /*
@@ -1107,12 +1109,12 @@ cupsGetPPD3(http_t     *http,           /* I  - HTTP connection or @code CUPS_HTTP_DEFAUL
     * Can't open file; close the server connection and return NULL...
     */
 
-    _cupsSetError(IPP_INTERNAL_ERROR, NULL, 0);
+    _cupsSetError(IPP_STATUS_ERROR_INTERNAL, NULL, 0);
 
     if (http2 != http)
       httpClose(http2);
 
-    return (HTTP_SERVER_ERROR);
+    return (HTTP_STATUS_SERVER_ERROR);
   }
 
  /*
@@ -1133,14 +1135,14 @@ cupsGetPPD3(http_t     *http,           /* I  - HTTP connection or @code CUPS_HTTP_DEFAUL
   * See if we actually got the file or an error...
   */
 
-  if (status == HTTP_OK)
+  if (status == HTTP_STATUS_OK)
   {
     *modtime = httpGetDateTime(httpGetField(http2, HTTP_FIELD_DATE));
 
     if (tempfile[0])
       strlcpy(buffer, tempfile, bufsize);
   }
-  else if (status != HTTP_NOT_MODIFIED)
+  else if (status != HTTP_STATUS_NOT_MODIFIED)
   {
     _cupsSetHTTPError(status);
 
@@ -1190,7 +1192,7 @@ cupsGetPrinters(char ***printers) /* O - Printers */
 
   if (!printers)
   {
-    _cupsSetError(IPP_INTERNAL_ERROR, strerror(EINVAL), 0);
+    _cupsSetError(IPP_STATUS_ERROR_INTERNAL, strerror(EINVAL), 0);
 
     return (0);
   }
@@ -1213,7 +1215,7 @@ cupsGetPrinters(char ***printers) /* O - Printers */
   *    requested-attributes
   */
 
-  request = ippNewRequest(CUPS_GET_PRINTERS);
+  request = ippNewRequest(IPP_OP_CUPS_GET_PRINTERS);
 
   ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD,
                "requested-attributes", NULL, "printer-name");
@@ -1302,7 +1304,7 @@ cupsGetServerPPD(http_t     *http,        /* I - Connection to server or @code CUPS_HTT
 
   if (!name)
   {
-    _cupsSetError(IPP_INTERNAL_ERROR, _("No PPD name"), 1);
+    _cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("No PPD name"), 1);
 
     return (NULL);
   }
@@ -1321,7 +1323,7 @@ cupsGetServerPPD(http_t     *http,        /* I - Connection to server or @code CUPS_HTT
     * Can't open file; close the server connection and return NULL...
     */
 
-    _cupsSetError(IPP_INTERNAL_ERROR, NULL, 0);
+    _cupsSetError(IPP_STATUS_ERROR_INTERNAL, NULL, 0);
 
     return (NULL);
   }
@@ -1330,7 +1332,7 @@ cupsGetServerPPD(http_t     *http,        /* I - Connection to server or @code CUPS_HTT
   * Get the PPD file...
   */
 
-  request = ippNewRequest(CUPS_GET_PPD);
+  request = ippNewRequest(IPP_OP_CUPS_GET_PPD);
   ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "ppd-name", NULL,
                name);
 
@@ -1338,7 +1340,7 @@ cupsGetServerPPD(http_t     *http,        /* I - Connection to server or @code CUPS_HTT
 
   close(fd);
 
-  if (cupsLastError() != IPP_OK)
+  if (cupsLastError() != IPP_STATUS_OK)
   {
     unlink(cg->ppd_filename);
     return (NULL);
@@ -1460,7 +1462,7 @@ cupsPrintFiles2(
 
   if (!name || num_files < 1 || !files)
   {
-    _cupsSetError(IPP_INTERNAL_ERROR, strerror(EINVAL), 0);
+    _cupsSetError(IPP_STATUS_ERROR_INTERNAL, strerror(EINVAL), 0);
 
     return (0);
   }
@@ -1499,20 +1501,20 @@ cupsPrintFiles2(
       * Unable to open print file, cancel the job and return...
       */
 
-      _cupsSetError(IPP_DOCUMENT_ACCESS_ERROR, NULL, 0);
+      _cupsSetError(IPP_STATUS_ERROR_DOCUMENT_ACCESS, NULL, 0);
       goto cancel_job;
     }
 
     status = cupsStartDocument(http, name, job_id, docname, format,
                               i == (num_files - 1));
 
-    while (status == HTTP_CONTINUE &&
+    while (status == HTTP_STATUS_CONTINUE &&
           (bytes = cupsFileRead(fp, buffer, sizeof(buffer))) > 0)
       status = cupsWriteRequestData(http, buffer, bytes);
 
     cupsFileClose(fp);
 
-    if (status != HTTP_CONTINUE || cupsFinishDocument(http, name) != IPP_OK)
+    if (status != HTTP_STATUS_CONTINUE || cupsFinishDocument(http, name) != IPP_STATUS_OK)
     {
      /*
       * Unable to queue, cancel the job and return...
@@ -1578,10 +1580,10 @@ cupsStartDocument(
   * Create a Send-Document request...
   */
 
-  if ((request = ippNewRequest(IPP_SEND_DOCUMENT)) == NULL)
+  if ((request = ippNewRequest(IPP_OP_SEND_DOCUMENT)) == NULL)
   {
-    _cupsSetError(IPP_INTERNAL_ERROR, strerror(ENOMEM), 0);
-    return (HTTP_ERROR);
+    _cupsSetError(IPP_STATUS_ERROR_INTERNAL, strerror(ENOMEM), 0);
+    return (HTTP_STATUS_ERROR);
   }
 
   httpAssembleURIf(HTTP_URI_CODING_ALL, printer_uri, sizeof(printer_uri), "ipp",
@@ -1659,9 +1661,11 @@ cups_get_printer_uri(
   */
 
   if (httpAssembleURIf(HTTP_URI_CODING_ALL, uri, sizeof(uri), "ipp", NULL,
-                       "localhost", 0, "/printers/%s", name) != HTTP_URI_OK)
+                       "localhost", 0, "/printers/%s",
+                       name) < HTTP_URI_STATUS_OK)
   {
-    _cupsSetError(IPP_INTERNAL_ERROR, _("Unable to create printer-uri"), 1);
+    _cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("Unable to create printer-uri"),
+                  1);
 
     *host     = '\0';
     *resource = '\0';
@@ -1688,7 +1692,7 @@ cups_get_printer_uri(
   *    requested-attributes
   */
 
-  request = ippNewRequest(IPP_GET_PRINTER_ATTRIBUTES);
+  request = ippNewRequest(IPP_OP_GET_PRINTER_ATTRIBUTES);
 
   ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri",
                NULL, uri);
@@ -1776,8 +1780,9 @@ cups_get_printer_uri(
 
            if (!_cups_strcasecmp(http_hostname, host) && *port == http_port)
              http2 = http;
-           else if ((http2 = httpConnectEncrypt(host, *port,
-                                                cupsEncryption())) == NULL)
+           else if ((http2 = httpConnect2(host, *port, NULL, AF_UNSPEC,
+                                          cupsEncryption(), 1, 30000,
+                                          NULL)) == NULL)
            {
              DEBUG_puts("8cups_get_printer_uri: Unable to connect to server");
 
@@ -1819,7 +1824,7 @@ cups_get_printer_uri(
 
       if (!strncmp(resource, "/classes/", 9))
       {
-        _cupsSetError(IPP_INTERNAL_ERROR,
+        _cupsSetError(IPP_STATUS_ERROR_INTERNAL,
                      _("No printer-uri found for class"), 1);
 
        *host     = '\0';
@@ -1834,8 +1839,8 @@ cups_get_printer_uri(
     ippDelete(response);
   }
 
-  if (cupsLastError() != IPP_NOT_FOUND)
-    _cupsSetError(IPP_INTERNAL_ERROR, _("No printer-uri found"), 1);
+  if (cupsLastError() != IPP_STATUS_ERROR_NOT_FOUND)
+    _cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("No printer-uri found"), 1);
 
   *host     = '\0';
   *resource = '\0';