]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - cups/ipp-support.c
Merge changes from CUPS 1.5svn-r9022.
[thirdparty/cups.git] / cups / ipp-support.c
index 8553a488e2c2d988d14ea72fd98eca5d7ead0704..4c3eb1467356a04a5a4c99025de6b4d9eee9375f 100644 (file)
@@ -4,7 +4,7 @@
  *   Internet Printing Protocol support functions for the Common UNIX
  *   Printing System (CUPS).
  *
- *   Copyright 2007-2008 by Apple Inc.
+ *   Copyright 2007-2009 by Apple Inc.
  *   Copyright 1997-2007 by Easy Software Products, all rights reserved.
  *
  *   These coded instructions, statements, and computer programs are the
@@ -217,7 +217,7 @@ static char * const ipp_std_ops[] =
                  "dateTime",           /* 0x31 */
                  "resolution",         /* 0x32 */
                  "rangeOfInteger",     /* 0x33 */
-                 "begCollection",      /* 0x34 */
+                 "collection",         /* 0x34 */
                  "textWithLanguage",   /* 0x35 */
                  "nameWithLanguage",   /* 0x36 */
                  "endCollection",      /* 0x37 */
@@ -391,53 +391,15 @@ ippOpValue(const char *name)              /* I - Textual name */
 int                                    /* O - Port number */
 ippPort(void)
 {
-  const char   *ipp_port;              /* IPP_PORT environment variable */
-  struct servent *port;                        /* Port number info */  
-  int          portnum;                /* Port number */
   _cups_globals_t *cg = _cupsGlobals();        /* Pointer to library globals */
 
 
   DEBUG_puts("ippPort()");
 
   if (!cg->ipp_port)
-  {
-   /*
-    * See if the server definition includes the port number...
-    */
+    _cupsSetDefaults();
 
-    DEBUG_puts("ippPort: Not initialized...");
-
-    cupsServer();
-
-#ifdef DEBUG
-    if (cg->ipp_port)
-      DEBUG_puts(("ippPort: Set via cupsServer()..."));
-#endif /* DEBUG */
-  }
-
-  if (!cg->ipp_port)
-  {
-    if ((ipp_port = getenv("IPP_PORT")) != NULL)
-    {
-      DEBUG_puts("ippPort: Set via IPP_PORT...");
-      portnum = atoi(ipp_port);
-    }
-    else if ((port = getservbyname("ipp", NULL)) == NULL)
-    {
-      DEBUG_puts("ippPort: Set via CUPS_DEFAULT_IPP_PORT...");
-      portnum = CUPS_DEFAULT_IPP_PORT;
-    }
-    else
-    {
-      DEBUG_puts("ippPort: Set via ipp service entry...");
-      portnum = ntohs(port->s_port);
-    }
-
-    if (portnum > 0)
-      cg->ipp_port = portnum;
-  }
-
-  DEBUG_printf(("ippPort: Returning %d...\n", cg->ipp_port));
+  DEBUG_printf(("1ippPort: Returning %d...", cg->ipp_port));
 
   return (cg->ipp_port);
 }
@@ -450,7 +412,7 @@ ippPort(void)
 void
 ippSetPort(int p)                      /* I - Port number to use */
 {
-  DEBUG_printf(("ippSetPort(p=%d)\n", p));
+  DEBUG_printf(("ippSetPort(p=%d)", p));
 
   _cupsGlobals()->ipp_port = p;
 }
@@ -461,7 +423,7 @@ ippSetPort(int p)                   /* I - Port number to use */
  *
  * The returned names are defined in RFC 2911 and 3382.
  *
- * @since CUPS 1.4@
+ * @since CUPS 1.4/Mac OS X 10.6@
  */
 
 const char *                           /* O - Tag name */
@@ -481,7 +443,7 @@ ippTagString(ipp_tag_t tag)         /* I - Tag value */
  *
  * The tag names are defined in RFC 2911 and 3382.
  *
- * @since CUPS 1.4@
+ * @since CUPS 1.4/Mac OS X 10.6@
  */
 
 ipp_tag_t                              /* O - Tag value */
@@ -500,8 +462,12 @@ ippTagValue(const char *name)              /* I - Tag name */
     return (IPP_TAG_JOB);
   else if (!strcasecmp(name, "printer"))
     return (IPP_TAG_PRINTER);
+  else if (!strcasecmp(name, "unsupported"))
+    return (IPP_TAG_UNSUPPORTED_GROUP);
   else if (!strcasecmp(name, "subscription"))
     return (IPP_TAG_SUBSCRIPTION);
+  else if (!strcasecmp(name, "event"))
+    return (IPP_TAG_EVENT_NOTIFICATION);
   else if (!strcasecmp(name, "language"))
     return (IPP_TAG_LANGUAGE);
   else if (!strcasecmp(name, "mimetype"))
@@ -510,6 +476,8 @@ ippTagValue(const char *name)               /* I - Tag name */
     return (IPP_TAG_NAME);
   else if (!strcasecmp(name, "text"))
     return (IPP_TAG_TEXT);
+  else if (!strcasecmp(name, "begCollection"))
+    return (IPP_TAG_BEGIN_COLLECTION);
   else
     return (IPP_TAG_ZERO);
 }