]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Load cups into easysw/current.
authorjlovell <jlovell@a1ca3aef-8c08-0410-bb20-df032aa958be>
Wed, 22 Feb 2006 16:59:36 +0000 (16:59 +0000)
committerjlovell <jlovell@a1ca3aef-8c08-0410-bb20-df032aa958be>
Wed, 22 Feb 2006 16:59:36 +0000 (16:59 +0000)
git-svn-id: svn+ssh://src.apple.com/svn/cups/easysw/current@63 a1ca3aef-8c08-0410-bb20-df032aa958be

51 files changed:
CHANGES.txt
cgi-bin/Makefile
cgi-bin/help-index.c
cgi-bin/help-index.h
cgi-bin/help.c
cgi-bin/testhi.c
config-scripts/cups-common.m4
config.h.in
cups/Dependencies
cups/Makefile
cups/api-array.shtml
cups/api-cups.shtml
cups/api-filedir.shtml
cups/api-filter.shtml
cups/api-httpipp.shtml
cups/api-ppd.shtml
cups/backchannel.c
cups/cups.h
cups/dest.c
cups/file.c
cups/getputfile.c
cups/globals.h
cups/http-addr.c
cups/http-support.c
cups/http.c
cups/http.h
cups/ipp-support.c
cups/ipp.h
cups/ppd.h
cups/request.c [new file with mode: 0644]
cups/usersys.c
cups/util.c
doc/cups.css
doc/help/api-array.html
doc/help/api-cups.html
doc/help/api-filedir.html
doc/help/api-filter.html
doc/help/api-httpipp.html
doc/help/api-ppd.html
doc/help/spec-ppd.html
doc/index.html.in
doc/ja/index.html.in
man/mantohtml.c
packaging/cups.spec.in
scheduler/printers.c
standards/Makefile
standards/rfctohtml.c
templates/header.tmpl.in
tools/makesrcdist
tools/testosx
tools/testrpm

index fc1ac357e290eb78eb549cfb7079d87e56d27b1b..a9d78226d0ffb21ce45fe9a71d8c734c72cb513f 100644 (file)
@@ -3,6 +3,10 @@ CHANGES.txt - 02/17/2006
 
 CHANGES IN CUPS V1.2.0b1
 
+       - Options in PPD files are no longer automatically put in
+         an "Extra" group; rather, all options that are not
+         inside an Open/CloseGroup will be placed in the
+         "General" group (STR #1385)
        - The scheduler now creates a job-uuid attribute that
          uniquely identifies a job on a network (STR #1410)
        - The init script now unsets the TMPDIR environment
index 4962215bc74bc012bd02e8a113357e17569ffff3..7cce230f83f2808ea48b081509dfd64112723704 100644 (file)
@@ -1,5 +1,5 @@
 #
-# "$Id: Makefile 5111 2006-02-16 02:08:09Z mike $"
+# "$Id: Makefile 5145 2006-02-22 00:25:14Z mike $"
 #
 #   CGI makefile for the Common UNIX Printing System (CUPS).
 #
@@ -125,27 +125,30 @@ printers.cgi:     printers.o ../Makedefs ../cups/$(LIBCUPS) libcgi.a
 # testcgi
 #
 
-testcgi:       testcgi.o ../Makedefs libcgi.a
+testcgi:       testcgi.o ../Makedefs libcgi.a ../cups/libcups.a
        echo Linking $@...
-       $(CC) $(LDFLAGS) -o $@ testcgi.o libcgi.a $(LIBS)
+       $(CC) $(LDFLAGS) -o $@ testcgi.o libcgi.a ../cups/libcups.a \
+               $(COMMONLIBS) $(SSLLIBS) $(LIBZ)
 
 
 #
 # testhi
 #
 
-testhi:        testhi.o ../Makedefs libcgi.a
+testhi:        testhi.o ../Makedefs libcgi.a ../cups/libcups.a
        echo Linking $@...
-       $(CC) $(LDFLAGS) -o $@ testhi.o libcgi.a $(LIBS)
+       $(CC) $(LDFLAGS) -o $@ testhi.o libcgi.a ../cups/libcups.a \
+               $(COMMONLIBS) $(SSLLIBS) $(LIBZ)
 
 
 #
 # testtemplate
 #
 
-testtemplate:  testtemplate.o ../Makedefs libcgi.a
+testtemplate:  testtemplate.o ../Makedefs libcgi.a ../cups/libcups.a
        echo Linking $@...
-       $(CC) $(LDFLAGS) -o $@ testtemplate.o libcgi.a $(LIBS)
+       $(CC) $(LDFLAGS) -o $@ testtemplate.o libcgi.a ../cups/libcups.a \
+               $(COMMONLIBS) $(SSLLIBS) $(LIBZ)
 
 
 #
@@ -156,5 +159,5 @@ include Dependencies
 
 
 #
-# End of "$Id: Makefile 5111 2006-02-16 02:08:09Z mike $".
+# End of "$Id: Makefile 5145 2006-02-22 00:25:14Z mike $".
 #
index 0b2e53b092ae8ba7d5734fbd589a467783112540..d3792e635b47a546573436265d7594e5f0ef6d02 100644 (file)
@@ -1,9 +1,9 @@
 /*
- * "$Id: help-index.c 4863 2005-12-03 04:28:10Z mike $"
+ * "$Id: help-index.c 5143 2006-02-21 19:13:01Z mike $"
  *
  *   On-line help index routines for the Common UNIX Printing System (CUPS).
  *
- *   Copyright 1997-2005 by Easy Software Products.
+ *   Copyright 1997-2006 by Easy Software Products.
  *
  *   These coded instructions, statements, and computer programs are the
  *   property of Easy Software Products and are protected by Federal
@@ -29,9 +29,7 @@
  *   helpSaveIndex()            - Save a help index to disk.
  *   helpSearchIndex()          - Search an index.
  *   help_compile_search()      - Convert a search string into a regular expression.
- *   help_create_sorted()       - Create the sorted node array.
  *   help_delete_node()         - Free all memory used by a node.
- *   help_insert_node()         - Insert a node in an index.
  *   help_load_directory()      - Load a directory of files into an index.
  *   help_load_file()           - Load a HTML files into an index.
  *   help_new_node()            - Create a new node and add it to an index.
@@ -51,9 +49,7 @@
  * Local functions...
  */
 
-static void            help_create_sorted(help_index_t *hi);
 static void            help_delete_node(help_node_t *n);
-static void            help_insert_node(help_index_t *hi, help_node_t *n);
 static int             help_load_directory(help_index_t *hi,
                                            const char *directory,
                                            const char *relative);
@@ -65,8 +61,8 @@ static help_node_t    *help_new_node(const char *filename, const char *anchor,
                                       const char *section, const char *text,
                                       time_t mtime, off_t offset,
                                       size_t length);
-static int             help_sort_by_name(const void *p1, const void *p2);
-static int             help_sort_by_score(const void *p1, const void *p2);
+static int             help_sort_by_name(help_node_t *p1, help_node_t *p2);
+static int             help_sort_by_score(help_node_t *p1, help_node_t *p2);
 
 
 /*
@@ -74,9 +70,9 @@ static int            help_sort_by_score(const void *p1, const void *p2);
  */
 
 void
-helpDeleteIndex(help_index_t *hi)
+helpDeleteIndex(help_index_t *hi)      /* I - Help index */
 {
-  int  i;                              /* Looping var */
+  help_node_t  *node;                  /* Current node */
 
 
   DEBUG_printf(("helpDeleteIndex(hi=%p)\n", hi));
@@ -84,16 +80,19 @@ helpDeleteIndex(help_index_t *hi)
   if (!hi)
     return;
 
-  if (!hi->search)
+  for (node = (help_node_t *)cupsArrayFirst(hi->nodes);
+       node;
+       node = (help_node_t *)cupsArrayNext(hi->nodes))
   {
-    for (i = 0; i < hi->num_nodes; i ++)
-      help_delete_node(hi->nodes[i]);
-  }
+    cupsArrayRemove(hi->nodes, node);
+    cupsArrayRemove(hi->sorted, node);
 
-  free(hi->nodes);
+    if (!hi->search)
+      help_delete_node(node);
+  }
 
-  if (hi->sorted)
-    free(hi->sorted);
+  cupsArrayDelete(hi->nodes);
+  cupsArrayDelete(hi->sorted);
 
   free(hi);
 }
@@ -103,13 +102,12 @@ helpDeleteIndex(help_index_t *hi)
  * 'helpFindNode()' - Find a node in an index.
  */
 
-help_node_t **                         /* O - Node pointer or NULL */
+help_node_t *                          /* O - Node pointer or NULL */
 helpFindNode(help_index_t *hi,         /* I - Index */
              const char   *filename,   /* I - Filename */
              const char   *anchor)     /* I - Anchor */
 {
-  help_node_t  key,                    /* Search key */
-               *ptr;                   /* Pointer to key */
+  help_node_t  key;                    /* Search key */
 
 
   DEBUG_printf(("helpFindNode(hi=%p, filename=\"%s\", anchor=\"%s\")\n",
@@ -128,14 +126,12 @@ helpFindNode(help_index_t *hi,            /* I - Index */
 
   key.filename = (char *)filename;
   key.anchor   = (char *)anchor;
-  ptr          = &key;
 
  /*
   * Return any match...
   */
 
-  return ((help_node_t **)bsearch(&ptr, hi->nodes, hi->num_nodes,
-                                  sizeof(help_node_t *), help_sort_by_name));
+  return ((help_node_t *)cupsArrayFind(hi->nodes, &key));
 }
 
 
@@ -160,7 +156,6 @@ helpLoadIndex(const char *hifile,   /* I - Index filename */
   off_t                offset;                 /* Offset into file */
   size_t       length;                 /* Length in bytes */
   int          update;                 /* Update? */
-  int          i;                      /* Looping var */
   help_node_t  *node;                  /* Current node */
 
 
@@ -171,7 +166,19 @@ helpLoadIndex(const char *hifile,  /* I - Index filename */
   * Create a new, empty index.
   */
 
-  hi = (help_index_t *)calloc(1, sizeof(help_index_t));
+  if ((hi = (help_index_t *)calloc(1, sizeof(help_index_t))) == NULL)
+    return (NULL);
+
+  hi->nodes  = cupsArrayNew((cups_array_func_t)help_sort_by_name, NULL);
+  hi->sorted = cupsArrayNew((cups_array_func_t)help_sort_by_score, NULL);
+
+  if (!hi->nodes || !hi->sorted)
+  {
+    cupsArrayDelete(hi->nodes);
+    cupsArrayDelete(hi->sorted);
+    free(hi);
+    return (NULL);
+  }
 
  /*
   * Try loading the existing index file...
@@ -266,9 +273,9 @@ helpLoadIndex(const char *hifile,   /* I - Index filename */
                                  mtime, offset, length)) == NULL)
           break;
 
-       help_insert_node(hi, node);
-
        node->score = -1;
+
+       cupsArrayAdd(hi->nodes, node);
       }
     }
 
@@ -285,45 +292,34 @@ helpLoadIndex(const char *hifile, /* I - Index filename */
   * Remove any files that are no longer installed...
   */
 
-  for (i = 0; i < hi->num_nodes;)
-  {
-    if (hi->nodes[i]->score < 0)
+  for (node = (help_node_t *)cupsArrayFirst(hi->nodes);
+       node;
+       node = (help_node_t *)cupsArrayNext(hi->nodes))
+    if (node->score < 0)
     {
      /*
       * Delete this node...
       */
 
-      help_delete_node(hi->nodes[i]);
-
-      hi->num_nodes --;
-      if (i < hi->num_nodes)
-        memmove(hi->nodes + i, hi->nodes + i + 1,
-               (hi->num_nodes - i) * sizeof(help_node_t *));
-
-      update = 1;
-    }
-    else
-    {
-     /*
-      * Keep this node...
-      */
-
-      i ++;
+      cupsArrayRemove(hi->nodes, node);
+      help_delete_node(node);
     }
-  }
 
  /*
-  * Save the index if we updated it...
+  * Add nodes to the sorted array...
   */
 
-  if (update)
-    helpSaveIndex(hi, hifile);
+  for (node = (help_node_t *)cupsArrayFirst(hi->nodes);
+       node;
+       node = (help_node_t *)cupsArrayNext(hi->nodes))
+    cupsArrayAdd(hi->sorted, node);
 
  /*
-  * Create the sorted array...
+  * Save the index if we updated it...
   */
 
-  help_create_sorted(hi);
+  if (update)
+    helpSaveIndex(hi, hifile);
 
  /*
   * Return the index...
@@ -342,7 +338,6 @@ helpSaveIndex(help_index_t *hi,             /* I - Index */
               const char   *hifile)    /* I - Index filename */
 {
   cups_file_t  *fp;                    /* Index file */
-  int          i;                      /* Looping var */
   help_node_t  *node;                  /* Current node */
 
 
@@ -363,14 +358,14 @@ helpSaveIndex(help_index_t *hi,           /* I - Index */
 
   cupsFilePuts(fp, "HELPV1\n");
 
-  for (i = 0; i < hi->num_nodes; i ++)
+  for (node = (help_node_t *)cupsArrayFirst(hi->nodes);
+       node;
+       node = (help_node_t *)cupsArrayNext(hi->nodes))
   {
    /*
     * Write the current node with/without the anchor...
     */
 
-    node = hi->nodes[i];
-
     if (node->anchor)
     {
       if (cupsFilePrintf(fp, "%s#%s " CUPS_LLFMT " " CUPS_LLFMT " \"%s\"\n",
@@ -389,9 +384,11 @@ helpSaveIndex(help_index_t *hi,            /* I - Index */
     }
   }
 
+  cupsFileFlush(fp);
+
   if (cupsFileClose(fp) < 0)
     return (-1);
-  else if (i < hi->num_nodes)
+  else if (node)
     return (-1);
   else
     return (0);
@@ -408,9 +405,8 @@ helpSearchIndex(help_index_t *hi,   /* I - Index */
                const char   *section,  /* I - Limit search to this section */
                const char   *filename) /* I - Limit search to this file */
 {
-  int          i;                      /* Looping var */
   help_index_t *search;                /* Search index */
-  help_node_t  **n;                    /* Current node */
+  help_node_t  *node;                  /* Current node */
   void         *sc;                    /* Search context */
   int          matches;                /* Number of matches */
 
@@ -426,17 +422,27 @@ helpSearchIndex(help_index_t *hi, /* I - Index */
   if (!hi || !query)
     return (NULL);
 
-  for (i = 0, n = hi->nodes; i < hi->num_nodes; i ++, n ++)
-    n[0]->score = 0;
+ /*
+  * Reset the scores of all nodes to 0...
+  */
+
+  for (node = (help_node_t *)cupsArrayFirst(hi->nodes);
+       node;
+       node = (help_node_t *)cupsArrayNext(hi->nodes))
+    node->score = 0;
+
+ /*
+  * Find the first node to search in...
+  */
 
   if (filename)
   {
-    n = helpFindNode(hi, filename, NULL);
-    if (!n)
+    node = helpFindNode(hi, filename, NULL);
+    if (!node)
       return (NULL);
   }
   else
-    n = hi->nodes;
+    node = (help_node_t *)cupsArrayFirst(hi->nodes);
 
  /*
   * Convert the query into a regular expression...
@@ -457,6 +463,18 @@ helpSearchIndex(help_index_t *hi,  /* I - Index */
     return (NULL);
   }
 
+  search->nodes  = cupsArrayNew((cups_array_func_t)help_sort_by_name, NULL);
+  search->sorted = cupsArrayNew((cups_array_func_t)help_sort_by_score, NULL);
+  
+  if (!search->nodes || !search->sorted)
+  {
+    cupsArrayDelete(search->nodes);
+    cupsArrayDelete(search->sorted);
+    free(search);
+    cgiFreeSearch(sc);
+    return (NULL);
+  }
+
   search->search = 1;
 
  /*
@@ -464,20 +482,21 @@ helpSearchIndex(help_index_t *hi, /* I - Index */
   * search index...
   */
 
-  for (i = n - hi->nodes; i < hi->num_nodes; i ++, n ++)
-    if (section && strcmp(n[0]->section, section))
+  for (; node; node = (help_node_t *)cupsArrayNext(hi->nodes))
+    if (section && strcmp(node->section, section))
       continue;
-    else if (filename && strcmp(n[0]->filename, filename))
+    else if (filename && strcmp(node->filename, filename))
       continue;
-    else if ((matches = cgiDoSearch(sc, n[0]->text)) > 0)
+    else if ((matches = cgiDoSearch(sc, node->text)) > 0)
     {
      /*
       * Found a match, add the node to the search index...
       */
 
-      help_insert_node(search, *n);
+      node->score = matches;
 
-      n[0]->score = matches;
+      cupsArrayAdd(search->nodes, node);      
+      cupsArrayAdd(search->sorted, node);      
     }
 
  /*
@@ -486,12 +505,6 @@ helpSearchIndex(help_index_t *hi,  /* I - Index */
 
   cgiFreeSearch(sc);
 
- /*
-  * Sort the results...
-  */
-
-  help_create_sorted(search);
-
  /*
   * Return the results...
   */
@@ -500,47 +513,6 @@ helpSearchIndex(help_index_t *hi,  /* I - Index */
 }
 
 
-/*
- * 'help_create_sorted()' - Create the sorted node array.
- */
-
-static void
-help_create_sorted(help_index_t *hi)   /* I - Index */
-{
-  DEBUG_printf(("help_create_sorted(hi=%p)\n", hi));
-
- /*
-  * Free any existing sorted array...
-  */
-
-  if (hi->sorted)
-    free(hi->sorted);
-
- /*
-  * Create a new sorted array...
-  */
-
-  hi->sorted = calloc(hi->num_nodes, sizeof(help_node_t *));
-
-  if (!hi->sorted)
-    return;
-
- /*
-  * Copy the nodes to the new array...
-  */
-
-  memcpy(hi->sorted, hi->nodes, hi->num_nodes * sizeof(help_node_t *));
-
- /*
-  * Sort the new array by score and text.
-  */
-
-  if (hi->num_nodes > 1)
-    qsort(hi->sorted, hi->num_nodes, sizeof(help_node_t *),
-          help_sort_by_score);
-}
-
-
 /*
  * 'help_delete_node()' - Free all memory used by a node.
  */
@@ -569,104 +541,6 @@ help_delete_node(help_node_t *n)  /* I - Node */
 }
 
 
-/*
- * 'help_insert_node()' - Insert a node in an index.
- */
-
-static void
-help_insert_node(help_index_t *hi,     /* I - Index */
-                 help_node_t  *n)      /* I - Node */
-{
-  int          current,                /* Current node */
-               left,                   /* Left side */
-               right,                  /* Right side */
-               diff;                   /* Difference between nodes */
-  help_node_t  **temp;                 /* Temporary node pointer */
-
-
-  DEBUG_printf(("help_insert_node(hi=%p, n=%p)\n", hi, n));
-
- /*
-  * Allocate memory as needed...
-  */
-
-  if (hi->num_nodes >= hi->alloc_nodes)
-  {
-   /*
-    * Expand the array in 128 node increments...
-    */
-
-    hi->alloc_nodes += 128;
-    if (hi->alloc_nodes == 128)
-      temp = (help_node_t **)malloc(hi->alloc_nodes * sizeof(help_node_t *));
-    else
-      temp = (help_node_t **)realloc(hi->nodes,
-                                     hi->alloc_nodes * sizeof(help_node_t *));
-
-    if (!temp)
-      return;
-
-    hi->nodes = temp;
-  }
-
- /*
-  * Find the insertion point...
-  */
-
-  if (hi->num_nodes == 0 ||
-      help_sort_by_name(&n, hi->nodes + hi->num_nodes - 1) > 0)
-  {
-   /*
-    * Last node...
-    */
-
-    hi->nodes[hi->num_nodes] = n;
-    hi->num_nodes ++;
-    return;
-  }
-  else if (help_sort_by_name(&n, hi->nodes) < 0)
-  {
-   /*
-    * First node...
-    */
-
-    memmove(hi->nodes + 1, hi->nodes, hi->num_nodes * sizeof(help_node_t *));
-    hi->nodes[0] = n;
-    hi->num_nodes ++;
-    return;
-  }
-
- /*
-  * Otherwise, do a binary insertion...
-  */
-
-  left    = 0;
-  right   = hi->num_nodes - 1;
-
-  do
-  {
-    current = (left + right) / 2;
-    diff    = help_sort_by_name(&n, hi->nodes + current);
-
-    if (!diff)
-      break;
-    else if (diff < 0)
-      right = current;
-    else
-      left = current;
-  }
-  while ((right - left) > 1);
-
-  if (diff > 0)
-    current ++;
-
-  memmove(hi->nodes + current + 1, hi->nodes + current,
-          (hi->num_nodes - current) * sizeof(help_node_t *));
-  hi->nodes[current] = n;
-  hi->num_nodes ++;
-}
-
-
 /*
  * 'help_load_directory()' - Load a directory of files into an index.
  */
@@ -677,14 +551,13 @@ help_load_directory(
     const char   *directory,           /* I - Directory */
     const char   *relative)            /* I - Relative path */
 {
-  int          i;                      /* Looping var */
   cups_dir_t   *dir;                   /* Directory file */
   cups_dentry_t        *dent;                  /* Directory entry */
   char         *ext,                   /* Pointer to extension */
                filename[1024],         /* Full filename */
                relname[1024];          /* Relative filename */
   int          update;                 /* Updated? */
-  help_node_t  **node;                 /* Current node */
+  help_node_t  *node;                  /* Current node */
 
 
   DEBUG_printf(("help_load_directory(hi=%p, directory=\"%s\", relative=\"%s\")\n",
@@ -701,6 +574,13 @@ help_load_directory(
 
   while ((dent = cupsDirRead(dir)) != NULL)
   {
+   /*
+    * Skip "." files...
+    */
+
+    if (dent->filename[0] == '.')
+      continue;
+
    /*
     * Get absolute and relative filenames...
     */
@@ -729,16 +609,16 @@ help_load_directory(
        * index is up-to-date...
        */
 
-        if (node[0]->mtime == dent->fileinfo.st_mtime)
+        if (node->mtime == dent->fileinfo.st_mtime)
        {
         /*
          * Same modification time, so mark all of the nodes
          * for this file as up-to-date...
          */
 
-          for (i = node - hi->nodes; i < hi->num_nodes; i ++, node ++)
-           if (!strcmp(node[0]->filename, relname))
-             node[0]->score = 0;
+          for (; node; node = (help_node_t *)cupsArrayNext(hi->nodes))
+           if (!strcmp(node->filename, relname))
+             node->score = 0;
            else
              break;
 
@@ -779,8 +659,7 @@ help_load_file(
     time_t       mtime)                        /* I - Modification time */
 {
   cups_file_t  *fp;                    /* HTML file */
-  help_node_t  *node,                  /* Current node */
-               **n;                    /* Node pointer */
+  help_node_t  *node;                  /* Current node */
   char         line[1024],             /* Line from file */
                 section[1024],         /* Section */
                *ptr,                   /* Pointer into line */
@@ -924,14 +803,14 @@ help_load_file(
         break;
       }
 
-      if ((n = helpFindNode(hi, relative, anchor)) != NULL)
+      if ((node = helpFindNode(hi, relative, anchor)) != NULL)
       {
        /*
        * Node already in the index, so replace the text and other
        * data...
        */
 
-        node = n[0];
+        cupsArrayRemove(hi->nodes, node);
 
         if (node->section)
          free(node->section);
@@ -952,7 +831,6 @@ help_load_file(
        */
 
         node = help_new_node(relative, anchor, section, text, mtime, offset, 0);
-       help_insert_node(hi, node);
       }
 
      /*
@@ -978,6 +856,11 @@ help_load_file(
 
       *text = '\0';
 
+     /*
+      * (Re)add the node to the array...
+      */
+
+      cupsArrayAdd(hi->nodes, node);
       break;
     }
 
@@ -1013,9 +896,11 @@ help_new_node(const char   *filename,     /* I - Filename */
   help_node_t  *n;                     /* Node */
 
 
-  DEBUG_printf(("help_new_node(filename=\"%s\", anchor=\"%s\", text=\"%s\", mtime=%ld, offset=%ld, length=%ld)\n",
+  DEBUG_printf(("help_new_node(filename=\"%s\", anchor=\"%s\", text=\"%s\", "
+                "mtime=%ld, offset=%ld, length=%ld)\n",
                 filename ? filename : "(nil)", anchor ? anchor : "(nil)",
-               text ? text : "(nil)", mtime, offset, length));
+               text ? text : "(nil)", (long)mtime, (long)offset,
+               (long)length));
 
   n = (help_node_t *)calloc(1, sizeof(help_node_t));
   if (!n)
@@ -1038,30 +923,27 @@ help_new_node(const char   *filename,    /* I - Filename */
  */
 
 static int                             /* O - Difference */
-help_sort_by_name(const void *p1,      /* I - First node */
-                  const void *p2)      /* I - Second node */
+help_sort_by_name(help_node_t *n1,     /* I - First node */
+                  help_node_t *n2)     /* I - Second node */
 {
-  help_node_t  **n1,                   /* First node */
-               **n2;                   /* Second node */
   int          diff;                   /* Difference */
 
 
-  DEBUG_printf(("help_sort_by_name(p1=%p, p2=%p)\n", p1, p2));
+  DEBUG_printf(("help_sort_by_name(n1=%p(%s#%s), n2=%p(%s#%s)\n",
+                n1, n1->filename, n1->anchor ? n1->anchor : "",
+               n2, n2->filename, n2->anchor ? n2->anchor : ""));
 
-  n1 = (help_node_t **)p1;
-  n2 = (help_node_t **)p2;
-
-  if ((diff = strcmp(n1[0]->filename, n2[0]->filename)) != 0)
+  if ((diff = strcmp(n1->filename, n2->filename)) != 0)
     return (diff);
 
-  if (!n1[0]->anchor && !n2[0]->anchor)
+  if (!n1->anchor && !n2->anchor)
     return (0);
-  else if (!n1[0]->anchor)
+  else if (!n1->anchor)
     return (-1);
-  else if (!n2[0]->anchor)
+  else if (!n2->anchor)
     return (1);
   else
-    return (strcmp(n1[0]->anchor, n2[0]->anchor));
+    return (strcmp(n1->anchor, n2->anchor));
 }
 
 
@@ -1070,34 +952,32 @@ help_sort_by_name(const void *p1,        /* I - First node */
  */
 
 static int                             /* O - Difference */
-help_sort_by_score(const void *p1,     /* I - First node */
-                   const void *p2)     /* I - Second node */
+help_sort_by_score(help_node_t *n1,    /* I - First node */
+                   help_node_t *n2)    /* I - Second node */
 {
-  help_node_t  **n1,                   /* First node */
-               **n2;                   /* Second node */
   int          diff;                   /* Difference */
 
 
-  DEBUG_printf(("help_sort_by_score(p1=%p, p2=%p)\n", p1, p2));
-
-  n1 = (help_node_t **)p1;
-  n2 = (help_node_t **)p2;
+  DEBUG_printf(("help_sort_by_score(n1=%p(%d \"%s\" \"%s\"), "
+                "n2=%p(%d \"%s\" \"%s\")\n",
+                n1, n1->score, n1->section ? n1->section : "", n1->text,
+                n2, n2->score, n2->section ? n2->section : "", n2->text));
 
-  if (n1[0]->score != n2[0]->score)
-    return (n1[0]->score - n2[0]->score);
+  if (n1->score != n2->score)
+    return (n1->score - n2->score);
 
-  if (n1[0]->section && !n2[0]->section)
+  if (n1->section && !n2->section)
     return (1);
-  else if (!n1[0]->section && n2[0]->section)
+  else if (!n1->section && n2->section)
     return (-1);
-  else if (n1[0]->section && n2[0]->section &&
-           (diff = strcmp(n1[0]->section, n2[0]->section)) != 0)
+  else if (n1->section && n2->section &&
+           (diff = strcmp(n1->section, n2->section)) != 0)
     return (diff);
 
-  return (strcasecmp(n1[0]->text, n2[0]->text));
+  return (strcasecmp(n1->text, n2->text));
 }
 
 
 /*
- * End of "$Id: help-index.c 4863 2005-12-03 04:28:10Z mike $".
+ * End of "$Id: help-index.c 5143 2006-02-21 19:13:01Z mike $".
  */
index 68a89867052c9e5f47e536f551402476de08ad83..d564663a098bd4357f72aaefa00a5ab6dabb5e2f 100644 (file)
@@ -1,9 +1,9 @@
 /*
- * "$Id: help-index.h 4863 2005-12-03 04:28:10Z mike $"
+ * "$Id: help-index.h 5143 2006-02-21 19:13:01Z mike $"
  *
  *   On-line help index definitions for the Common UNIX Printing System (CUPS).
  *
- *   Copyright 1997-2005 by Easy Software Products.
+ *   Copyright 1997-2006 by Easy Software Products.
  *
  *   These coded instructions, statements, and computer programs are the
  *   property of Easy Software Products and are protected by Federal
 #ifndef _CUPS_HELP_INDEX_H_
 #  define _CUPS_HELP_INDEX_H_
 
+/*
+ * Include necessary headers...
+ */
+
+#  include <cups/array.h>
+
 
 /*
  * Data structures...
@@ -44,11 +50,9 @@ typedef struct                               /**** Help node structure... ****/
 
 typedef struct                         /**** Help index structure ****/
 {
-  int          search,                 /* 1 = search index, 0 = normal */
-               num_nodes,              /* Number of nodes */
-               alloc_nodes;            /* Allocated nodes */
-  help_node_t  **nodes;                /* Nodes sorted by filename */
-  help_node_t  **sorted;               /* Nodes sorted by score + text */
+  int          search;                 /* 1 = search index, 0 = normal */
+  cups_array_t *nodes;                 /* Nodes sorted by filename */
+  cups_array_t *sorted;                /* Nodes sorted by score + text */
 } help_index_t;
 
 
@@ -57,8 +61,8 @@ typedef struct                                /**** Help index structure ****/
  */
 
 extern void            helpDeleteIndex(help_index_t *hi);
-extern help_node_t     **helpFindNode(help_index_t *hi, const char *filename,
-                                      const char *anchor);
+extern help_node_t     *helpFindNode(help_index_t *hi, const char *filename,
+                                     const char *anchor);
 extern help_index_t    *helpLoadIndex(const char *hifile, const char *directory);
 extern int             helpSaveIndex(help_index_t *hi, const char *hifile);
 extern help_index_t    *helpSearchIndex(help_index_t *hi, const char *query,
@@ -69,5 +73,5 @@ extern help_index_t   *helpSearchIndex(help_index_t *hi, const char *query,
 #endif /* !_CUPS_HELP_INDEX_H_ */
 
 /*
- * End of "$Id: help-index.h 4863 2005-12-03 04:28:10Z mike $".
+ * End of "$Id: help-index.h 5143 2006-02-21 19:13:01Z mike $".
  */
index 5071ca8256685185b0a16b1f87b50dc65e1ddf6f..d616f28bdff381cfb8239327471b1c965319dd7f 100644 (file)
@@ -43,10 +43,10 @@ main(int  argc,                             /* I - Number of command-line arguments */
 {
   help_index_t *hi,                    /* Help index */
                *si;                    /* Search index */
-  help_node_t  **n;                    /* Current help node */
-  int          i, j;                   /* Looping vars */
+  help_node_t  *n;                     /* Current help node */
+  int          i;                      /* Looping var */
   const char   *query;                 /* Search query */
-  const char   *server_root;           /* CUPS_SERVERROOT environment variable */
+  const char   *cache_dir;             /* CUPS_CACHEDIR environment variable */
   const char   *docroot;               /* CUPS_DOCROOT environment variable */
   const char   *helpfile;              /* Current help file */
   const char   *topic;                 /* Current topic */
@@ -74,10 +74,10 @@ main(int  argc,                             /* I - Number of command-line arguments */
   * Load the help index...
   */
 
-  if ((server_root = getenv("CUPS_SERVERROOT")) == NULL)
-    server_root = CUPS_SERVERROOT;
+  if ((cache_dir = getenv("CUPS_CACHEDIR")) == NULL)
+    cache_dir = CUPS_CACHEDIR;
 
-  snprintf(filename, sizeof(filename), "%s/help.index", server_root);
+  snprintf(filename, sizeof(filename), "%s/help.index", cache_dir);
 
   if ((docroot = getenv("CUPS_DOCROOT")) == NULL)
     docroot = CUPS_DOCROOT;
@@ -100,7 +100,8 @@ main(int  argc,                             /* I - Number of command-line arguments */
     return (1);
   }
 
-  fprintf(stderr, "hi->num_nodes=%d\n", hi->num_nodes);
+  fprintf(stderr, "DEBUG: %d nodes in help index...\n",
+          cupsArrayCount(hi->nodes));
 
  /*
   * See if we are viewing a file...
@@ -154,13 +155,13 @@ main(int  argc,                           /* I - Number of command-line arguments */
     */
 
     cgiSetVariable("HELPFILE", helpfile);
-    cgiSetVariable("HELPTITLE", n[0]->text);
+    cgiSetVariable("HELPTITLE", n->text);
 
    /*
     * Send a standard page header...
     */
 
-    cgiStartHTML(n[0]->text);
+    cgiStartHTML(n->text);
   }
   else
   {
@@ -181,34 +182,37 @@ main(int  argc,                           /* I - Number of command-line arguments */
 
   if (si)
   {
-    help_node_t        **nn;                   /* Parent node */
+    help_node_t        *nn;                    /* Parent node */
 
 
-    fprintf(stderr, "si=%p, si->num_nodes=%d, si->sorted=%p\n", si,
-            si->num_nodes, si->sorted);
+    fprintf(stderr,
+            "DEBUG: si=%p, si->sorted=%p, cupsArrayCount(si->sorted)=%d\n", si,
+            si->sorted, cupsArrayCount(si->sorted));
 
-    for (i = 0, n = si->sorted; i < si->num_nodes; i ++, n ++)
+    for (n = (help_node_t *)cupsArrayFirst(si->sorted);
+         n;
+        n = (help_node_t *)cupsArrayNext(si->sorted))
     {
-      if (helpfile && n[0]->anchor)
-        snprintf(line, sizeof(line), "#%s", n[0]->anchor);
-      else if (n[0]->anchor)
-        snprintf(line, sizeof(line), "/help/%s?QUERY=%s#%s", n[0]->filename,
-                query ? query : "", n[0]->anchor);
+      if (helpfile && n->anchor)
+        snprintf(line, sizeof(line), "#%s", n->anchor);
+      else if (n->anchor)
+        snprintf(line, sizeof(line), "/help/%s?QUERY=%s#%s", n->filename,
+                query ? query : "", n->anchor);
       else
-        snprintf(line, sizeof(line), "/help/%s?QUERY=%s", n[0]->filename,
+        snprintf(line, sizeof(line), "/help/%s?QUERY=%s", n->filename,
                 query ? query : "");
 
-      cgiSetArray("QTEXT", i, n[0]->text);
+      cgiSetArray("QTEXT", i, n->text);
       cgiSetArray("QLINK", i, line);
 
-      if (!helpfile && n[0]->anchor)
+      if (!helpfile && n->anchor)
       {
-        nn = helpFindNode(hi, n[0]->filename, NULL);
+        nn = helpFindNode(hi, n->filename, NULL);
 
-        snprintf(line, sizeof(line), "/help/%s?QUERY=%s", nn[0]->filename,
+        snprintf(line, sizeof(line), "/help/%s?QUERY=%s", nn->filename,
                 query ? query : "");
 
-        cgiSetArray("QPTEXT", i, nn[0]->text);
+        cgiSetArray("QPTEXT", i, nn->text);
        cgiSetArray("QPLINK", i, line);
       }
       else
@@ -217,7 +221,7 @@ main(int  argc,                             /* I - Number of command-line arguments */
        cgiSetArray("QPLINK", i, "");
       }
 
-      fprintf(stderr, "DEBUG: [%d] = \"%s\" @ \"%s\"\n", i, n[0]->text, line);
+      fprintf(stderr, "DEBUG: [%d] = \"%s\" @ \"%s\"\n", i, n->text, line);
     }
 
     helpDeleteIndex(si);
@@ -227,71 +231,76 @@ main(int  argc,                           /* I - Number of command-line arguments */
   * OK, now list the bookmarks within the index...
   */
 
-  for (i = hi->num_nodes, j = 0, n = hi->sorted, section = NULL;
-       i > 0;
-       i --, n ++)
+  for (i = 0, section = NULL, n = (help_node_t *)cupsArrayFirst(hi->sorted);
+       n;
+       n = (help_node_t *)cupsArrayNext(hi->sorted))
   {
-    if (n[0]->anchor)
+    if (n->anchor)
       continue;
 
    /*
     * Add a section link as needed...
     */
 
-    if (n[0]->section &&
-        (!section || strcmp(n[0]->section, section)))
+    if (n->section &&
+        (!section || strcmp(n->section, section)))
     {
      /*
       * Add a link for this node...
       */
 
       snprintf(line, sizeof(line), "/help/?TOPIC=%s&QUERY=%s",
-               cgiFormEncode(topic_data, n[0]->section, sizeof(topic_data)),
+               cgiFormEncode(topic_data, n->section, sizeof(topic_data)),
               query ? query : "");
-      cgiSetArray("BMLINK", j, line);
-      cgiSetArray("BMTEXT", j, n[0]->section);
-      cgiSetArray("BMINDENT", j, "0");
+      cgiSetArray("BMLINK", i, line);
+      cgiSetArray("BMTEXT", i, n->section);
+      cgiSetArray("BMINDENT", i, "0");
 
-      j ++;
-      section = n[0]->section;
+      i ++;
+      section = n->section;
     }
 
-    if (!topic || strcmp(n[0]->section, topic))
+    if (!topic || strcmp(n->section, topic))
       continue;
 
    /*
     * Add a link for this node...
     */
 
-    snprintf(line, sizeof(line), "/help/%s?TOPIC=%s&QUERY=%s", n[0]->filename,
-             cgiFormEncode(topic_data, n[0]->section, sizeof(topic_data)),
+    snprintf(line, sizeof(line), "/help/%s?TOPIC=%s&QUERY=%s", n->filename,
+             cgiFormEncode(topic_data, n->section, sizeof(topic_data)),
             query ? query : "");
-    cgiSetArray("BMLINK", j, line);
-    cgiSetArray("BMTEXT", j, n[0]->text);
-    cgiSetArray("BMINDENT", j, "1");
+    cgiSetArray("BMLINK", i, line);
+    cgiSetArray("BMTEXT", i, n->text);
+    cgiSetArray("BMINDENT", i, "1");
 
-    j ++;
+    i ++;
 
-    if (helpfile && !strcmp(helpfile, n[0]->filename))
+    if (helpfile && !strcmp(helpfile, n->filename))
     {
-      int              ii;             /* Looping var */
-      help_node_t      **nn;           /* Pointer to sub-node */
+      help_node_t      *nn;            /* Pointer to sub-node */
 
 
-      for (ii = hi->num_nodes, nn = hi->sorted; ii > 0; ii --, nn ++)
-        if (nn[0]->anchor && !strcmp(helpfile, nn[0]->filename))
+      cupsArraySave(hi->sorted);
+
+      for (nn = (help_node_t *)cupsArrayFirst(hi->sorted);
+           nn;
+          nn = (help_node_t *)cupsArrayNext(hi->sorted))
+        if (nn->anchor && !strcmp(helpfile, nn->filename))
        {
         /*
          * Add a link for this node...
          */
 
-         snprintf(line, sizeof(line), "#%s", nn[0]->anchor);
-         cgiSetArray("BMLINK", j, line);
-         cgiSetArray("BMTEXT", j, nn[0]->text);
-         cgiSetArray("BMINDENT", j, "2");
+         snprintf(line, sizeof(line), "#%s", nn->anchor);
+         cgiSetArray("BMLINK", i, line);
+         cgiSetArray("BMTEXT", i, nn->text);
+         cgiSetArray("BMINDENT", i, "2");
 
-         j ++;
+         i ++;
        }
+
+      cupsArrayRestore(hi->sorted);
     }
   }
 
index 99d0bd29f62c388f6c7119e00adb944879c041db..dad5d70b7053563dfaa56f04e4c3098945f3f595 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: testhi.c 4869 2005-12-06 02:43:40Z mike $"
+ * "$Id: testhi.c 5143 2006-02-21 19:13:01Z mike $"
  *
  *   Help index test program for the Common UNIX Printing System (CUPS).
  *
@@ -38,7 +38,7 @@
  * Local functions...
  */
 
-static void    list_nodes(const char *title, int num_nodes, help_node_t **nodes);
+static void    list_nodes(const char *title, cups_array_t *nodes);
 
 
 /*
@@ -59,8 +59,8 @@ main(int  argc,                               /* I - Number of command-line arguments */
 
   hi = helpLoadIndex("testhi.index", ".");
 
-  list_nodes("nodes", hi->num_nodes, hi->nodes);
-  list_nodes("sorted", hi->num_nodes, hi->sorted);
+  list_nodes("nodes", hi->nodes);
+  list_nodes("sorted", hi->sorted);
 
  /*
   * Do any searches...
@@ -72,7 +72,7 @@ main(int  argc,                               /* I - Number of command-line arguments */
 
     if (search)
     {
-      list_nodes(argv[1], search->num_nodes, search->sorted);
+      list_nodes(argv[1], search->sorted);
       helpDeleteIndex(search);
     }
     else
@@ -94,23 +94,25 @@ main(int  argc,                             /* I - Number of command-line arguments */
  */
 
 static void
-list_nodes(const char  *title,         /* I - Title string */
-           int         num_nodes,      /* I - Number of nodes */
-          help_node_t **nodes)         /* I - Nodes */
+list_nodes(const char   *title,                /* I - Title string */
+          cups_array_t *nodes)         /* I - Nodes */
 {
-  int  i;                              /* Looping var */
+  int          i;                      /* Looping var */
+  help_node_t  *node;                  /* Current node */
 
 
-  printf("%s (%d nodes):\n", title, num_nodes);
-  for (i = 0; i < num_nodes; i ++)
-    if (nodes[i]->anchor)
-      printf("    %d: %s#%s \"%s\"\n", i, nodes[i]->filename, nodes[i]->anchor,
-             nodes[i]->text);
+  printf("%s (%d nodes):\n", title, cupsArrayCount(nodes));
+  for (i = 1, node = (help_node_t *)cupsArrayFirst(nodes);
+       node;
+       i ++, node = (help_node_t *)cupsArrayNext(nodes))
+    if (node->anchor)
+      printf("    %d: %s#%s \"%s\"\n", i, node->filename, node->anchor,
+             node->text);
     else
-      printf("    %d: %s \"%s\"\n", i, nodes[i]->filename, nodes[i]->text);
+      printf("    %d: %s \"%s\"\n", i, node->filename, node->text);
 }
 
 
 /*
- * End of "$Id: testhi.c 4869 2005-12-06 02:43:40Z mike $".
+ * End of "$Id: testhi.c 5143 2006-02-21 19:13:01Z mike $".
  */
index 442cd5325fd5a17fbd880be20214cb26698f2810..abad61d563440e73d010acaaece5d7042a1e632b 100644 (file)
@@ -1,5 +1,5 @@
 dnl
-dnl "$Id: cups-common.m4 5136 2006-02-19 18:46:46Z mike $"
+dnl "$Id: cups-common.m4 5144 2006-02-21 20:44:01Z mike $"
 dnl
 dnl   Common configuration stuff for the Common UNIX Printing System (CUPS).
 dnl
@@ -30,9 +30,15 @@ AC_CONFIG_HEADER(config.h)
 
 dnl Versio number information...
 CUPS_VERSION="1.2svn"
+CUPS_REVISION=""
+if test -z "$CUPS_REVISION" -a -d .svn; then
+       CUPS_REVISION="-r`svnversion . | awk -F: '{print $NF}' | sed -e '1,$s/[[a-zA-Z]]*//g'`"
+fi
+
 AC_SUBST(CUPS_VERSION)
-AC_DEFINE_UNQUOTED(CUPS_SVERSION, "CUPS v$CUPS_VERSION")
-AC_DEFINE_UNQUOTED(CUPS_MINIMAL, "CUPS/$CUPS_VERSION")
+AC_SUBST(CUPS_REVISION)
+AC_DEFINE_UNQUOTED(CUPS_SVERSION, "CUPS v$CUPS_VERSION$CUPS_REVISION")
+AC_DEFINE_UNQUOTED(CUPS_MINIMAL, "CUPS/$CUPS_VERSION$CUPS_REVISION")
 
 dnl Default compiler flags...
 CFLAGS="${CFLAGS:=}"
@@ -184,6 +190,8 @@ BACKLIBS=""
 CUPSDLIBS=""
 DBUSDIR=""
 
+AC_ARG_ENABLE(dbus, [  --enable-dbus           enable DBUS support, default=auto])
+
 case $uname in
         Darwin*)
                 BACKLIBS="-framework IOKit"
@@ -215,19 +223,21 @@ case $uname in
 
        Linux*)
                dnl Check for DBUS support
-               AC_PATH_PROG(PKGCONFIG, pkg-config)
-               if test "x$PKGCONFIG" != x; then
-                       AC_MSG_CHECKING(for DBUS)
-                       if $PKGCONFIG --exists dbus-1; then
-                               AC_MSG_RESULT(yes)
-                               AC_CHECK_LIB(dbus-1,
-                                   dbus_message_iter_init_append,
-                                   AC_DEFINE(HAVE_DBUS)
-                                   CFLAGS="$CFLAGS `$PKGCONFIG --cflags dbus-1` -DDBUS_API_SUBJECT_TO_CHANGE"
-                                   CUPSDLIBS="`$PKGCONFIG --libs dbus-1`"
-                                   DBUSDIR="/etc/dbus-1/system.d")
-                       else
-                               AC_MSG_RESULT(no)
+               if test "x$enable_dbus" != xno; then
+                       AC_PATH_PROG(PKGCONFIG, pkg-config)
+                       if test "x$PKGCONFIG" != x; then
+                               AC_MSG_CHECKING(for DBUS)
+                               if $PKGCONFIG --exists dbus-1; then
+                                       AC_MSG_RESULT(yes)
+                                       AC_CHECK_LIB(dbus-1,
+                                           dbus_message_iter_init_append,
+                                           AC_DEFINE(HAVE_DBUS)
+                                           CFLAGS="$CFLAGS `$PKGCONFIG --cflags dbus-1` -DDBUS_API_SUBJECT_TO_CHANGE"
+                                           CUPSDLIBS="`$PKGCONFIG --libs dbus-1`"
+                                           DBUSDIR="/etc/dbus-1/system.d")
+                               else
+                                       AC_MSG_RESULT(no)
+                               fi
                        fi
                fi
                ;;
@@ -253,5 +263,5 @@ AC_SUBST(DEFAULT_IPP_PORT)
 AC_DEFINE_UNQUOTED(CUPS_DEFAULT_IPP_PORT,$DEFAULT_IPP_PORT)
 
 dnl
-dnl End of "$Id: cups-common.m4 5136 2006-02-19 18:46:46Z mike $".
+dnl End of "$Id: cups-common.m4 5144 2006-02-21 20:44:01Z mike $".
 dnl
index b0b5798f7802c7ef5fc344623c62dea70b6ef6f1..4b81c2c5745284afae0780fc111758f1e32700d7 100644 (file)
@@ -1,10 +1,8 @@
 /*
- * "$Id: config.h.in 5082 2006-02-05 21:58:58Z mike $"
+ * "$Id: config.h.in 5144 2006-02-21 20:44:01Z mike $"
  *
  *   Configuration file for the Common UNIX Printing System (CUPS).
  *
- *   @configure_input@
- *
  *   Copyright 1997-2006 by Easy Software Products.
  *
  *   These coded instructions, statements, and computer programs are the
 #endif /* !_CUPS_CONFIG_H_ */
 
 /*
- * End of "$Id: config.h.in 5082 2006-02-05 21:58:58Z mike $".
+ * End of "$Id: config.h.in 5144 2006-02-21 20:44:01Z mike $".
  */
index d77ea16abe77627f8a0feead7a43e25f4c126446..9b68b129992b7f7a6cd25facdf1e4987cbc5d2a4 100644 (file)
@@ -57,6 +57,8 @@ options.o: file.h language.h debug.h
 page.o: ppd.h array.h file.h string.h ../config.h
 ppd.o: globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h array.h
 ppd.o: file.h language.h i18n.h normalize.h transcode.h debug.h
+request.o: globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
+request.o: array.h file.h language.h i18n.h normalize.h transcode.h debug.h
 snprintf.o: string.h ../config.h
 string.o: debug.h string.h ../config.h globals.h cups.h ipp.h http.h md5.h
 string.o: ppd.h array.h file.h language.h i18n.h normalize.h transcode.h
index 63caff9f080a823588ff798e15fb10ca2e732295..cbd6e36f45edef65ec7d763d4f205a97e638082b 100644 (file)
@@ -1,5 +1,5 @@
 #
-# "$Id: Makefile 5065 2006-02-03 16:55:30Z mike $"
+# "$Id: Makefile 5138 2006-02-21 10:49:06Z mike $"
 #
 #   API library Makefile for the Common UNIX Printing System (CUPS).
 #
@@ -61,6 +61,7 @@ LIBOBJS       =       \
                options.o \
                page.o \
                ppd.o \
+               request.o \
                snprintf.o \
                string.o \
                tempfile.o \
@@ -328,7 +329,7 @@ apihelp:
                array.h array.c >../doc/help/api-array.html
        mxmldoc --section "Programming" --title "CUPS API" \
                --intro api-cups.shtml \
-               cups.h auth.c dest.c encode.c getputfile.c language.c \
+               cups.h dest.c getputfile.c language.c \
                options.c tempfile.c usersys.c \
                util.c >../doc/help/api-cups.html
        mxmldoc --section "Programming" --title "File and Directory APIs" \
@@ -340,10 +341,9 @@ apihelp:
                ppd.c >../doc/help/api-ppd.html
        mxmldoc --section "Programming" --title "HTTP and IPP APIs" \
                --intro api-httpipp.shtml \
-               cups.h http.h ipp.h \
-               auth.c dest.c encode.c getputfile.c http.c http-addr.c \
-               http-support.c ipp.c ipp-support.c md5passwd.c options.c \
-               usersys.c util.c >../doc/help/api-httpipp.html
+               http.h ipp.h auth.c encode.c http.c http-addr.c \
+               http-support.c ipp.c ipp-support.c md5passwd.c \
+               request.c >../doc/help/api-httpipp.html
        mxmldoc --section "Programming" --title "Filter and Backend APIs" \
                --intro api-filter.shtml \
                backchannel.c >../doc/help/api-filter.html
@@ -357,5 +357,5 @@ include Dependencies
 
 
 #
-# End of "$Id: Makefile 5065 2006-02-03 16:55:30Z mike $".
+# End of "$Id: Makefile 5138 2006-02-21 10:49:06Z mike $".
 #
index d6297fb6a1e0b27f7ecd16d61f58ce8c74aa9c5e..433ce5d28a7cfdcb9173426fc5e1bf29aee06f98 100644 (file)
@@ -1,9 +1,9 @@
 <!--
-  "$Id$"
+  "$Id: api-array.shtml 5138 2006-02-21 10:49:06Z mike $"
 
   Array API introduction for the Common UNIX Printing System (CUPS).
 
-  Copyright 1997-2005 by Easy Software Products.
+  Copyright 1997-2006 by Easy Software Products.
 
   These coded instructions, statements, and computer programs are the
   property of Easy Software Products and are protected by Federal
index a39112795bfecc1faa402719776336b1e997d348..e53b36ef7ce406e71341ed913d7fbe23bd35c7c8 100644 (file)
@@ -1,5 +1,5 @@
 <!--
-  "$Id$"
+  "$Id: api-cups.shtml 5138 2006-02-21 10:49:06Z mike $"
 
   CUPS API introduction for the Common UNIX Printing System (CUPS).
 
 
 <h2 class='title'>Introduction</h2>
 
-<p>The CUPS APIs provide...</p>
+<p>The CUPS library provides a whole collection of interfaces
+needed to support the internal needs of the CUPS software as well
+as the needs of applications, filters, printer drivers, and
+backends.</p>
+
+<p>Unlike the rest of CUPS, the CUPS API library is provided
+under the GNU Library General Public License. This means that you
+can use the CUPS API library in both proprietary and open-source
+programs.</p>
 
 <h2 class='title'>General Usage</h2>
 
index d321cc604f14e468f5d31fe3a310149418aae02d..3e6e944337980df17d64e68324f5fca91afe4853 100644 (file)
@@ -1,5 +1,5 @@
 <!--
-  "$Id$"
+  "$Id: api-filedir.shtml 5138 2006-02-21 10:49:06Z mike $"
 
   File and directory API introduction for the Common UNIX Printing System (CUPS).
 
index f43a8d140b9c670cdab10c8b32f3c57d1f40a2aa..66f5e0a099a69dbc8ee2224d21ae828a27edf9c6 100644 (file)
@@ -1,9 +1,9 @@
 <!--
-  "$Id$"
+  "$Id: api-filter.shtml 5138 2006-02-21 10:49:06Z mike $"
 
   Filter and backend API introduction for the Common UNIX Printing System (CUPS).
 
-  Copyright 1997-2005 by Easy Software Products.
+  Copyright 1997-2006 by Easy Software Products.
 
   These coded instructions, statements, and computer programs are the
   property of Easy Software Products and are protected by Federal
 
 <h2 class='title'>Introduction</h2>
 
-<p>The CUPS filter and backend APIs provide...</p>
+<p>The CUPS filter and backend APIs define standard exit codes
+and provide access to the backchannel data stream. They are only
+used when writing backends, filters, and port monitors.</p>
 
 <h2 class='title'>General Usage</h2>
 
 <p>The <var>&lt;cups/backend.h&gt;</var> and
 <var>&lt;cups/cups.h&gt;</var> header files must be included to
 use the <tt>CUPS_BACKEND_</tt> constants and
-<tt>cupsBackchannel</tt> functions, respectively.</p>
+<tt>cupsBackChannel</tt> functions, respectively.</p>
 
 <p>Programs using these functions must be linked to the CUPS
 library: <var>libcups.a</var>, <var>libcups.so.2</var>,
index 1c1b6a43ee7f0a3968aa7771a275e5201f6bfafc..9b860bfd30adff53f48518c3c4b7b9d930c80854 100644 (file)
@@ -1,9 +1,9 @@
 <!--
-  "$Id$"
+  "$Id: api-httpipp.shtml 5138 2006-02-21 10:49:06Z mike $"
 
   HTTP and IPP API introduction for the Common UNIX Printing System (CUPS).
 
-  Copyright 1997-2005 by Easy Software Products.
+  Copyright 1997-2006 by Easy Software Products.
 
   These coded instructions, statements, and computer programs are the
   property of Easy Software Products and are protected by Federal
 
 <h2 class='title'>Introduction</h2>
 
-<p>The CUPS HTTP and IPP APIs provide...</p>
+<p>The CUPS HTTP and IPP APIs provide low-level access to the
+HTTP and IPP protocols and CUPS scheduler. They are typically
+used by monitoring and administration programs to perform
+specific functions not supported by the high-level CUPS API
+functions.</p>
 
 <h2 class='title'>General Usage</h2>
 
index 337ee3d46c602960b1f4c2c7d7c5f81a3abde83a..4dcd74909828bcdbe1750642a11e8fc8c170a6ad 100644 (file)
@@ -1,9 +1,9 @@
 <!--
-  "$Id$"
+  "$Id: api-ppd.shtml 5138 2006-02-21 10:49:06Z mike $"
 
   PPD API introduction for the Common UNIX Printing System (CUPS).
 
-  Copyright 1997-2005 by Easy Software Products.
+  Copyright 1997-2006 by Easy Software Products.
 
   These coded instructions, statements, and computer programs are the
   property of Easy Software Products and are protected by Federal
 
 <h2 class='title'>Introduction</h2>
 
-<p>The CUPS PPD API provides...</p>
+<p>The CUPS PPD API provides read-only access the data in
+PostScript Printer Description ("PPD") files. With it you can
+display printer options to users, mark option choices and check
+for conflicting choices, and output marked choices in PostScript
+output.</p>
 
 <h2 class='title'>General Usage</h2>
 
index bdc18edba4ef16181271c86c25ef28766f8d6c8c..29f542011a1e82f2c59b804cf286ffda12ff232c 100644 (file)
@@ -1,9 +1,9 @@
 /*
- * "$Id: backchannel.c 5099 2006-02-13 02:46:10Z mike $"
+ * "$Id: backchannel.c 5138 2006-02-21 10:49:06Z mike $"
  *
  *   Backchannel functions for the Common UNIX Printing System (CUPS).
  *
- *   Copyright 1997-2005 by Easy Software Products.
+ *   Copyright 1997-2006 by Easy Software Products.
  *
  *   These coded instructions, statements, and computer programs are the
  *   property of Easy Software Products and are protected by Federal
@@ -63,9 +63,9 @@ static void   cups_setup(fd_set *set, struct timeval *tval,
  * @since CUPS 1.2@
  */
 
-int                                    /* O - Bytes read or -1 on error */
+ssize_t                                        /* O - Bytes read or -1 on error */
 cupsBackChannelRead(char   *buffer,    /* I - Buffer to read */
-                    int    bytes,      /* I - Bytes to read */
+                    size_t bytes,      /* I - Bytes to read */
                    double timeout)     /* I - Timeout in seconds */
 {
   fd_set       input;                  /* Input set */
@@ -110,17 +110,17 @@ cupsBackChannelRead(char   *buffer,       /* I - Buffer to read */
  * @since CUPS 1.2@
  */
 
-int                                    /* O - Bytes written or -1 on error */
+ssize_t                                        /* O - Bytes written or -1 on error */
 cupsBackChannelWrite(
     const char *buffer,                        /* I - Buffer to write */
-    int        bytes,                  /* I - Bytes to write */
+    size_t     bytes,                  /* I - Bytes to write */
     double     timeout)                        /* I - Timeout in seconds */
 {
   fd_set       output;                 /* Output set */
   struct timeval tval;                 /* Timeout value */
   int          status;                 /* Select status */
-  int          count,                  /* Current bytes */
-               total;                  /* Total bytes */
+  ssize_t      count;                  /* Current bytes */
+  size_t       total;                  /* Total bytes */
 
 
  /*
@@ -197,5 +197,5 @@ cups_setup(fd_set         *set,             /* I - Set for select() */
 
 
 /*
- * End of "$Id: backchannel.c 5099 2006-02-13 02:46:10Z mike $".
+ * End of "$Id: backchannel.c 5138 2006-02-21 10:49:06Z mike $".
  */
index 30ddcb17d43795521ac13942583f7e9fb32da073..9d4fe2fa9ed2bd22f2dfdcf086e464dad7be1e23 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: cups.h 5099 2006-02-13 02:46:10Z mike $"
+ * "$Id: cups.h 5138 2006-02-21 10:49:06Z mike $"
  *
  *   API definitions for the Common UNIX Printing System (CUPS).
  *
@@ -103,6 +103,7 @@ enum cups_ptype_e                   /* Not a typedef'd enum so we can OR */
 };
 
 typedef const char *(*cups_password_cb_t)(const char *);
+                                       /**** Password callback ****/
 
 typedef struct cups_option_s           /**** Printer Options ****/
 {
@@ -122,16 +123,16 @@ typedef struct cups_dest_s                /**** Destination ****/
 typedef struct cups_job_s              /**** Job ****/
 {
   int          id;                     /* The job ID */
-  char         *dest,                  /* Printer or class name */
-               *title,                 /* Title/job name */
-               *user,                  /* User the submitted the job */
-               *format;                /* Document format */
+  char         *dest;                  /* Printer or class name */
+  char         *title;                 /* Title/job name */
+  char         *user;                  /* User the submitted the job */
+  char         *format;                /* Document format */
   ipp_jstate_t state;                  /* Job state */
-  int          size,                   /* Size in kilobytes */
-               priority;               /* Priority (1-100) */
-  time_t       completed_time,         /* Time the job was completed */
-               creation_time,          /* Time the job was created */
-               processing_time;        /* Time the job was processed */
+  int          size;                   /* Size in kilobytes */
+  int          priority;               /* Priority (1-100) */
+  time_t       completed_time;         /* Time the job was completed */
+  time_t       creation_time;          /* Time the job was created */
+  time_t       processing_time;        /* Time the job was processed */
 } cups_job_t;
 
 
@@ -140,9 +141,11 @@ typedef struct cups_job_s          /**** Job ****/
  */
 
 extern int             cupsCancelJob(const char *printer, int job);
-#define                        cupsDoRequest(http,request,resource) cupsDoFileRequest((http),(request),(resource),NULL)
 extern ipp_t           *cupsDoFileRequest(http_t *http, ipp_t *request,
-                                          const char *resource, const char *filename);
+                                          const char *resource,
+                                          const char *filename);
+extern ipp_t           *cupsDoRequest(http_t *http, ipp_t *request,
+                                      const char *resource);
 extern http_encryption_t cupsEncryption(void);
 extern void            cupsFreeJobs(int num_jobs, cups_job_t *jobs);
 extern int             cupsGetClasses(char ***classes) _CUPS_DEPRECATED;
@@ -218,8 +221,9 @@ extern int          cupsSetDests2(http_t *http, int num_dests,
                                      cups_dest_t *dests);
 
 /**** New in CUPS 1.2 ****/
-extern int             cupsBackChannelRead(char *buffer, int bytes, double timeout);
-extern int             cupsBackChannelWrite(const char *buffer, int bytes,
+extern ssize_t         cupsBackChannelRead(char *buffer, size_t bytes,
+                                           double timeout);
+extern ssize_t         cupsBackChannelWrite(const char *buffer, size_t bytes,
                                             double timeout);
 extern void            cupsEncodeOptions2(ipp_t *ipp, int num_options,
                                           cups_option_t *options,
@@ -237,5 +241,5 @@ extern cups_file_t  *cupsTempFile2(char *filename, int len);
 #endif /* !_CUPS_CUPS_H_ */
 
 /*
- * End of "$Id: cups.h 5099 2006-02-13 02:46:10Z mike $".
+ * End of "$Id: cups.h 5138 2006-02-21 10:49:06Z mike $".
  */
index 96db76308ede02993b52a888a4bff1923a89c9bf..0d8ffd95db5305ae631cdaa70c38d8185e2abd57 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: dest.c 4979 2006-01-25 17:47:43Z mike $"
+ * "$Id: dest.c 5138 2006-02-21 10:49:06Z mike $"
  *
  *   User-defined destination (and option) support for the Common UNIX
  *   Printing System (CUPS).
@@ -214,6 +214,11 @@ cupsGetDest(const char  *name,             /* I - Name of destination */
 
 /*
  * 'cupsGetDests()' - Get the list of destinations from the default server.
+ *
+ * Starting with CUPS 1.2, the returned list of destinations include the
+ * printer-info, printer-is-accepting-jobs, printer-is-shared,
+ * printer-make-and-model, printer-state, printer-state-change-time,
+ * printer-state-reasons, and printer-type attributes as options.
  */
 
 int                                    /* O - Number of destinations */
@@ -241,6 +246,11 @@ cupsGetDests(cups_dest_t **dests)  /* O - Destinations */
 /*
  * 'cupsGetDests2()' - Get the list of destinations from the specified server.
  *
+ * Starting with CUPS 1.2, the returned list of destinations include the
+ * printer-info, printer-is-accepting-jobs, printer-is-shared,
+ * printer-make-and-model, printer-state, printer-state-change-time,
+ * printer-state-reasons, and printer-type attributes as options.
+ *
  * @since CUPS 1.1.21@
  */
 
@@ -967,5 +977,5 @@ cups_get_sdests(http_t      *http,  /* I - HTTP connection */
 
 
 /*
- * End of "$Id: dest.c 4979 2006-01-25 17:47:43Z mike $".
+ * End of "$Id: dest.c 5138 2006-02-21 10:49:06Z mike $".
  */
index afc0f08fc2483a7800c20d32452ddcf93edafb19..791663a272f92c3548d2b563b5a71b415db55f86 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: file.c 5057 2006-02-02 20:38:29Z mike $"
+ * "$Id: file.c 5143 2006-02-21 19:13:01Z mike $"
  *
  *   File functions for the Common UNIX Printing System (CUPS).
  *
@@ -8,7 +8,7 @@
  *   our own file functions allows us to provide transparent support of
  *   gzip'd print files, PPD files, etc.
  *
- *   Copyright 1997-2005 by Easy Software Products, all rights reserved.
+ *   Copyright 1997-2006 by Easy Software Products, all rights reserved.
  *
  *   These coded instructions, statements, and computer programs are the
  *   property of Easy Software Products and are protected by Federal
@@ -386,6 +386,8 @@ cupsFileFlush(cups_file_t *fp)              /* I - CUPS file */
 
   bytes = fp->ptr - fp->buf;
 
+  DEBUG_printf(("    Flushing %ld bytes...\n", (long)bytes));
+
   if (bytes > 0)
   {
 #ifdef HAVE_LIBZ
@@ -439,7 +441,7 @@ cupsFileGetChar(cups_file_t *fp)    /* I - CUPS file */
  * 'cupsFileGetConf()' - Get a line from a configuration file...
  */
 
-char *                                 /* O  - Line read of NULL on eof/error */
+char *                                 /* O  - Line read or NULL on eof/error */
 cupsFileGetConf(cups_file_t *fp,       /* I  - CUPS file */
                 char        *buf,      /* O  - String buffer */
                size_t      buflen,     /* I  - Size of string buffer */
@@ -907,8 +909,10 @@ cupsFilePrintf(cups_file_t *fp,            /* I - CUPS file */
 {
   va_list      ap;                     /* Argument list */
   size_t       bytes;                  /* Formatted size */
-  char         buf[2048];              /* Formatted text */
+  char         buf[8192];              /* Formatted text */
+
 
+  DEBUG_printf(("cupsFilePrintf(fp=%p, format=\"%s\", ...)\n", fp, format));
 
   if (!fp || !format || (fp->mode != 'w' && fp->mode != 's'))
     return (-1);
@@ -917,6 +921,9 @@ cupsFilePrintf(cups_file_t *fp,             /* I - CUPS file */
   bytes = vsnprintf(buf, sizeof(buf), format, ap);
   va_end(ap);
 
+  if (bytes >= sizeof(buf))
+    return (-1);
+
   if (fp->mode == 's')
     return (cups_write(fp, buf, bytes));
 
@@ -1336,6 +1343,9 @@ cups_compress(cups_file_t *fp,            /* I - CUPS file */
               const char  *buf,                /* I - Buffer */
              size_t      bytes)        /* I - Number bytes */
 {
+  DEBUG_printf(("cups_compress(fp=%p, buf=%p, bytes=%ld)\n", fp, buf,
+                (long)bytes));
+
  /*
   * Update the CRC...
   */
@@ -1355,10 +1365,16 @@ cups_compress(cups_file_t *fp,          /* I - CUPS file */
     * Flush the current buffer...
     */
 
+    DEBUG_printf(("    avail_in=%d, avail_out=%d\n", fp->stream.avail_in,
+                  fp->stream.avail_out));
+
     if (fp->stream.avail_out < (int)(sizeof(fp->cbuf) / 8))
     {
       if (cups_write(fp, (char *)fp->cbuf, fp->stream.next_out - fp->cbuf) < 0)
         return (-1);
+
+      fp->stream.next_out  = fp->cbuf;
+      fp->stream.avail_out = sizeof(fp->cbuf);
     }
 
     deflate(&(fp->stream), Z_NO_FLUSH);
@@ -1733,6 +1749,9 @@ cups_write(cups_file_t *fp,               /* I - CUPS file */
                count;                  /* Count this time */
 
 
+  DEBUG_printf(("cups_write(fp=%p, buf=%p, bytes=%ld)\n", fp, buf,
+                (long)bytes));
+
  /*
   * Loop until all bytes are written...
   */
@@ -1757,6 +1776,8 @@ cups_write(cups_file_t *fp,               /* I - CUPS file */
         return (-1);
     }
 
+    DEBUG_printf(("    count=%ld\n", (long)count));
+
    /*
     * Update the counts for the last write call...
     */
@@ -1775,5 +1796,5 @@ cups_write(cups_file_t *fp,               /* I - CUPS file */
 
 
 /*
- * End of "$Id: file.c 5057 2006-02-02 20:38:29Z mike $".
+ * End of "$Id: file.c 5143 2006-02-21 19:13:01Z mike $".
  */
index e14094a52decf0ece816fff068bd334abd3b2833..4a78a42df2367309244c4f4057f9d43d1f74e803 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: getputfile.c 5103 2006-02-14 19:27:42Z mike $"
+ * "$Id: getputfile.c 5138 2006-02-21 10:49:06Z mike $"
  *
  *   Get/put file functions for the Common UNIX Printing System (CUPS).
  *
@@ -60,7 +60,7 @@
  * @since CUPS 1.1.20@
  */
 
-http_status_t                          /* O - Status */
+http_status_t                          /* O - HTTP status */
 cupsGetFd(http_t     *http,            /* I - HTTP connection to server */
          const char *resource,         /* I - Resource name */
          int        fd)                /* I - File descriptor */
@@ -188,7 +188,7 @@ cupsGetFd(http_t     *http,         /* I - HTTP connection to server */
  * @since CUPS 1.1.20@
  */
 
-http_status_t                          /* O - Status */
+http_status_t                          /* O - HTTP status */
 cupsGetFile(http_t     *http,          /* I - HTTP connection to server */
            const char *resource,       /* I - Resource name */
            const char *filename)       /* I - Filename */
@@ -255,7 +255,7 @@ cupsGetFile(http_t     *http,               /* I - HTTP connection to server */
  * @since CUPS 1.1.20@
  */
 
-http_status_t                          /* O - Status */
+http_status_t                          /* O - HTTP status */
 cupsPutFd(http_t     *http,            /* I - HTTP connection to server */
           const char *resource,                /* I - Resource name */
          int        fd)                /* I - File descriptor */
@@ -422,7 +422,7 @@ cupsPutFd(http_t     *http,         /* I - HTTP connection to server */
  * @since CUPS 1.1.20@
  */
 
-http_status_t                          /* O - Status */
+http_status_t                          /* O - HTTP status */
 cupsPutFile(http_t     *http,          /* I - HTTP connection to server */
             const char *resource,      /* I - Resource name */
            const char *filename)       /* I - Filename */
@@ -471,5 +471,5 @@ cupsPutFile(http_t     *http,               /* I - HTTP connection to server */
 
 
 /*
- * End of "$Id: getputfile.c 5103 2006-02-14 19:27:42Z mike $".
+ * End of "$Id: getputfile.c 5138 2006-02-21 10:49:06Z mike $".
  */
index 81e7384e9207ecbe82002767c8c65158bddb921d..1fae0efb2fbf18f1ad83055de951e1d9df4bdf61 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: globals.h 5047 2006-02-02 05:14:15Z mike $"
+ * "$Id: globals.h 5138 2006-02-21 10:49:06Z mike $"
  *
  *   Global variable definitions for the Common UNIX Printing System (CUPS).
  *
@@ -147,6 +147,7 @@ extern _cups_globals_t      *_cupsGlobals(void);
 extern void            _cupsLangFlush(_cups_globals_t *cg);
 extern void            _cupsCharmapFlush(_cups_globals_t *cg);
 extern void            _cupsNormalizeMapsFlush(_cups_globals_t *cg);
+extern void            _cupsSetError(ipp_status_t status, const char *message);
 extern void            _cups_sp_flush(_cups_globals_t *cg);
 
 
@@ -160,5 +161,5 @@ extern void         _cups_sp_flush(_cups_globals_t *cg);
 #endif /* !_CUPS_GLOBALS_H_ */
 
 /*
- * End of "$Id: globals.h 5047 2006-02-02 05:14:15Z mike $".
+ * End of "$Id: globals.h 5138 2006-02-21 10:49:06Z mike $".
  */
index 4363a86a5aab1dcb285a25d5f51b3330f767e5ac..4dd9064eab4b96dd4afbc5882b4d8c93b0af266e 100644 (file)
@@ -1,9 +1,9 @@
 /*
- * "$Id: http-addr.c 4950 2006-01-19 16:07:57Z mike $"
+ * "$Id: http-addr.c 5138 2006-02-21 10:49:06Z mike $"
  *
  *   HTTP address routines for the Common UNIX Printing System (CUPS).
  *
- *   Copyright 1997-2005 by Easy Software Products, all rights reserved.
+ *   Copyright 1997-2006 by Easy Software Products, all rights reserved.
  *
  *   These coded instructions, statements, and computer programs are the
  *   property of Easy Software Products and are protected by Federal
@@ -72,7 +72,7 @@ httpAddrAny(const http_addr_t *addr)  /* I - Address to check */
  * @since CUPS 1.2@
  */
 
-int                                            /* O - 1 if equal, 0 if != */
+int                                            /* O - 1 if equal, 0 if not */
 httpAddrEqual(const http_addr_t *addr1,                /* I - First address */
               const http_addr_t *addr2)                /* I - Second address */
 {
@@ -163,10 +163,11 @@ httpAddrLocalhost(
  * @since CUPS 1.2@
  */
 
-char *                                         /* O - Host name */
-httpAddrLookup(const http_addr_t *addr,                /* I - Address to lookup */
-               char              *name,                /* I - Host name buffer */
-              int               namelen)       /* I - Size of name buffer */
+char *                                 /* O - Host name */
+httpAddrLookup(
+    const http_addr_t *addr,           /* I - Address to lookup */
+    char              *name,           /* I - Host name buffer */
+    int               namelen)         /* I - Size of name buffer */
 {
   DEBUG_printf(("httpAddrLookup(addr=%p, name=%p, namelen=%d)\n",
                 addr, name, namelen));
@@ -239,15 +240,15 @@ httpAddrLookup(const http_addr_t *addr,           /* I - Address to lookup */
 
 
 /*
- * 'httpAddrString()' - Convert an IP address to a dotted string.
+ * 'httpAddrString()' - Convert an address to a numeric string.
  *
  * @since CUPS 1.2@
  */
 
-char *                                         /* O - IP string */
-httpAddrString(const http_addr_t *addr,                /* I - Address to convert */
-               char              *s,           /* I - String buffer */
-              int               slen)          /* I - Length of string */
+char *                                 /* O - Numeric address string */
+httpAddrString(const http_addr_t *addr,        /* I - Address to convert */
+               char              *s,   /* I - String buffer */
+              int               slen)  /* I - Length of string */
 {
   DEBUG_printf(("httpAddrString(addr=%p, s=%p, slen=%d)\n",
                 addr, s, slen));
@@ -540,5 +541,5 @@ httpGetHostname(char *s,            /* I - String buffer for name */
 
 
 /*
- * End of "$Id: http-addr.c 4950 2006-01-19 16:07:57Z mike $".
+ * End of "$Id: http-addr.c 5138 2006-02-21 10:49:06Z mike $".
  */
index 1ad095baed52435105e223e8e2600ec3ad354288..a7380769299c1be9faf6200a02041a791748483d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: http-support.c 5035 2006-02-01 14:58:46Z mike $"
+ * "$Id: http-support.c 5138 2006-02-21 10:49:06Z mike $"
  *
  *   HTTP support routines for the Common UNIX Printing System (CUPS) scheduler.
  *
@@ -104,9 +104,10 @@ static char                *http_copy_encode(char *dst, const char *src,
  * 'httpAssembleURI()' - Assemble a uniform resource identifier from its
  *                       components.
  *
- * This function properly escapes all reserved characters in a URI.  You
- * should use this function in place of traditional string functions
- * whenever you need to create a URI string.
+ * This function escapes reserved characters in the URI depending on the
+ * value of the "encoding" argument.  You should use this function in
+ * place of traditional string functions whenever you need to create a
+ * URI string.
  *
  * @since CUPS 1.2@
  */
@@ -351,9 +352,10 @@ httpAssembleURI(
  *                        components with a formatted resource.
  *
  * This function creates a formatted version of the resource string
- * argument "resourcef" and properly escapes all reserved characters
- * in a URI.  You should use this function in place of traditional
- * string functions whenever you need to create a URI string.
+ * argument "resourcef" and escapes reserved characters in the URI
+ * depending on the value of the "encoding" argument.  You should use
+ * this function in place of traditional string functions whenever
+ * you need to create a URI string.
  *
  * @since CUPS 1.2@
  */
@@ -408,6 +410,11 @@ httpAssembleURIf(
 
 /*
  * 'httpDecode64()' - Base64-decode a string.
+ *
+ * This function is deprecated. Use the httpDecode64_2() function instead
+ * which provides buffer length arguments.
+ *
+ * @deprecated@
  */
 
 char *                                 /* O - Decoded string */
@@ -531,6 +538,11 @@ httpDecode64_2(char       *out,            /* I  - String to write to */
 
 /*
  * 'httpEncode64()' - Base64-encode a string.
+ *
+ * This function is deprecated. Use the httpEncode64_2() function instead
+ * which provides buffer length arguments.
+ *
+ * @deprecated@
  */
 
 char *                                 /* O - Encoded string */
@@ -733,6 +745,10 @@ httpGetDateTime(const char *s)             /* I - Date/time string */
 /*
  * 'httpSeparate()' - Separate a Universal Resource Identifier into its
  *                    components.
+ *
+ * This function is deprecated; use the httpSeparateURI() function instead.
+ *
+ * @deprecated@
  */
 
 void
@@ -753,7 +769,10 @@ httpSeparate(const char *uri,              /* I - Universal Resource Identifier */
  * 'httpSeparate2()' - Separate a Universal Resource Identifier into its
  *                     components.
  *
+ * This function is deprecated; use the httpSeparateURI() function instead.
+ *
  * @since CUPS 1.1.21@
+ * @deprecated@
  */
 
 void
@@ -1287,5 +1306,5 @@ http_copy_encode(char       *dst, /* O - Destination buffer */
 
 
 /*
- * End of "$Id: http-support.c 5035 2006-02-01 14:58:46Z mike $".
+ * End of "$Id: http-support.c 5138 2006-02-21 10:49:06Z mike $".
  */
index 251fc3481ba9179e1bb882968fb1d056c14d3278..0b5c9c57e89081d80dcefc9f42b98c75708cd252 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: http.c 5103 2006-02-14 19:27:42Z mike $"
+ * "$Id: http.c 5138 2006-02-21 10:49:06Z mike $"
  *
  *   HTTP routines for the Common UNIX Printing System (CUPS).
  *
  *
  * Contents:
  *
+ *   httpBlocking()       - Set blocking/non-blocking behavior on a connection.
  *   httpCheck()          - Check to see if there is a pending response from
  *                          the server.
  *   httpClearCookie()    - Clear the cookie value(s).
+ *   httpClearFields()    - Clear HTTP request fields.
  *   httpClose()          - Close an HTTP connection...
  *   httpConnect()        - Connect to a HTTP server.
  *   httpConnectEncrypt() - Connect to a HTTP server using encryption.
  *   httpDelete()         - Send a DELETE request to the server.
  *   httpEncryption()     - Set the required encryption on the link.
+ *   httpError()          - Get the last error on a connection.
  *   httpFlush()          - Flush data from a HTTP connection.
  *   httpFlushWrite()     - Flush data in write buffer.
  *   httpGet()            - Send a GET request to the server.
+ *   httpGetBlocking()    - Get the blocking/non-block state of a connection.
+ *   httpGetCookie()      - Get any cookie data from the response.
+ *   httpGetFd()          - Get the file descriptor associated with a
+ *                          connection.
+ *   httpGetField()       - Get a field value from a request/response.
  *   httpGetLength()      - Get the amount of data remaining from the
  *                          content-length or transfer-encoding fields.
  *   httpGetLength2()     - Get the amount of data remaining from the
  *                          content-length or transfer-encoding fields.
+ *   httpGetStatus()      - Get the status of the last HTTP request.
  *   httpGetSubField()    - Get a sub-field value.
  *   httpGets()           - Get a line of text from a HTTP connection.
  *   httpHead()           - Send a HEAD request to the server.
@@ -158,12 +167,25 @@ static const char * const http_fields[] =
                        };
 
 
+/*
+ * 'httpBlocking()' - Set blocking/non-blocking behavior on a connection.
+ */
+
+void
+httpBlocking(http_t *http,             /* I - HTTP connection */
+             int    b)                 /* I - 1 = blocking, 0 = non-blocking */
+{
+  if (http)
+    http->blocking = b;
+}
+
+
 /*
  * 'httpCheck()' - Check to see if there is a pending response from the server.
  */
 
-int                            /* O - 0 = no data, 1 = data available */
-httpCheck(http_t *http)                /* I - HTTP connection */
+int                                    /* O - 0 = no data, 1 = data available */
+httpCheck(http_t *http)                        /* I - HTTP connection */
 {
   return (httpWait(http, 0));
 }
@@ -176,7 +198,7 @@ httpCheck(http_t *http)             /* I - HTTP connection */
  */
 
 void
-httpClearCookie(http_t *http)                  /* I - Connection */
+httpClearCookie(http_t *http)          /* I - HTTP connection */
 {
   if (!http)
     return;
@@ -189,12 +211,27 @@ httpClearCookie(http_t *http)                     /* I - Connection */
 }
 
 
+/*
+ * 'httpClearFields()' - Clear HTTP request fields.
+ */
+
+void
+httpClearFields(http_t *http)          /* I - HTTP connection */
+{
+  if (http)
+  {
+    memset(http->fields, 0, sizeof(http->fields));
+    httpSetField(http, HTTP_FIELD_HOST, http->hostname);
+  }
+}
+
+
 /*
  * 'httpClose()' - Close an HTTP connection...
  */
 
 void
-httpClose(http_t *http)                /* I - Connection to close */
+httpClose(http_t *http)                        /* I - HTTP connection */
 {
   DEBUG_printf(("httpClose(http=%p)\n", http));
 
@@ -334,7 +371,7 @@ httpConnectEncrypt(
  */
 
 int                                    /* O - Status of call (0 = success) */
-httpDelete(http_t     *http,           /* I - HTTP data */
+httpDelete(http_t     *http,           /* I - HTTP connection */
            const char *uri)            /* I - URI to delete */
 {
   return (http_send(http, HTTP_DELETE, uri));
@@ -346,7 +383,7 @@ httpDelete(http_t     *http,                /* I - HTTP data */
  */
 
 int                                    /* O - -1 on error, 0 on success */
-httpEncryption(http_t            *http,        /* I - HTTP data */
+httpEncryption(http_t            *http,        /* I - HTTP connection */
                http_encryption_t e)    /* I - New encryption preference */
 {
   DEBUG_printf(("httpEncryption(http=%p, e=%d)\n", http, e));
@@ -373,12 +410,26 @@ httpEncryption(http_t            *http,   /* I - HTTP data */
 }
 
 
+/*
+ * 'httpError()' - Get the last error on a connection.
+ */
+
+int                                    /* O - Error code (errno) value */
+httpError(http_t *http)                        /* I - HTTP connection */
+{
+  if (http)
+    return (http->error);
+  else
+    return (EINVAL);
+}
+
+
 /*
  * 'httpFlush()' - Flush data from a HTTP connection.
  */
 
 void
-httpFlush(http_t *http)                        /* I - HTTP data */
+httpFlush(http_t *http)                        /* I - HTTP connection */
 {
   char buffer[8192];                   /* Junk buffer */
   int  blocking;                       /* To block or not to block */
@@ -437,7 +488,7 @@ httpFlush(http_t *http)                     /* I - HTTP data */
  */
 
 int                                    /* O - Bytes written or -1 on error */
-httpFlushWrite(http_t *http)           /* I - HTTP data */
+httpFlushWrite(http_t *http)           /* I - HTTP connection */
 {
   int  bytes;                          /* Bytes written */
 
@@ -463,13 +514,162 @@ httpFlushWrite(http_t *http)             /* I - HTTP data */
  */
 
 int                                    /* O - Status of call (0 = success) */
-httpGet(http_t     *http,              /* I - HTTP data */
+httpGet(http_t     *http,              /* I - HTTP connection */
         const char *uri)               /* I - URI to get */
 {
   return (http_send(http, HTTP_GET, uri));
 }
 
 
+/*
+ * 'httpGetBlocking()' - Get the blocking/non-block state of a connection.
+ *
+ * @since CUPS 1.2@
+ */
+
+int                                    /* O - 1 if blocking, 0 if non-blocking */
+httpGetBlocking(http_t *http)          /* I - HTTP connection */
+{
+  return (http ? http->blocking : 0);
+}
+
+
+/*
+ * 'httpGetCookie()' - Get any cookie data from the response.
+ */
+
+const char *                           /* O - Cookie data or NULL */
+httpGetCookie(http_t *http)            /* I - HTTP connecion */
+{
+  return (http ? http->cookie : NULL);
+}
+
+
+/*
+ * 'httpGetFd()' - Get the file descriptor associated with a connection.
+ *
+ * @since CUPS 1.2@
+ */
+
+int                                    /* O - File descriptor or -1 if none */
+httpGetFd(http_t *http)                        /* I - HTTP connection */
+{
+  return (http ? http->fd : -1);
+}
+
+
+/*
+ * 'httpGetField()' - Get a field value from a request/response.
+ */
+
+const char *                           /* O - Field value */
+httpGetField(http_t       *http,       /* I - HTTP connection */
+             http_field_t field)       /* I - Field to get */
+{
+  if (!http || field <= HTTP_FIELD_UNKNOWN || field >= HTTP_FIELD_MAX)
+    return (NULL);
+  else
+    return (http->fields[field]);
+}
+
+
+/*
+ * 'httpGetLength()' - Get the amount of data remaining from the
+ *                     content-length or transfer-encoding fields.
+ *
+ * This function is deprecated and will not return lengths larger than
+ * 2^31 - 1; use httpGetLength2() instead.
+ *
+ * @deprecated@
+ */
+
+int                                    /* O - Content length */
+httpGetLength(http_t *http)            /* I - HTTP connection */
+{
+ /*
+  * Get the read content length and return the 32-bit value.
+  */
+
+  if (http)
+  {
+    httpGetLength2(http);
+
+    return (http->_data_remaining);
+  }
+  else
+    return (-1);
+}
+
+
+/*
+ * 'httpGetLength2()' - Get the amount of data remaining from the
+ *                      content-length or transfer-encoding fields.
+ *
+ * This function returns the complete content length, even for
+ * content larger than 2^31 - 1.
+ *
+ * @since CUPS 1.2@
+ */
+
+off_t                                  /* O - Content length */
+httpGetLength2(http_t *http)           /* I - HTTP connection */
+{
+  DEBUG_printf(("httpGetLength2(http=%p), state=%d\n", http, http->state));
+
+  if (!http)
+    return (-1);
+
+  if (!strcasecmp(http->fields[HTTP_FIELD_TRANSFER_ENCODING], "chunked"))
+  {
+    DEBUG_puts("httpGetLength2: chunked request!");
+
+    http->data_encoding  = HTTP_ENCODE_CHUNKED;
+    http->data_remaining = 0;
+  }
+  else
+  {
+    http->data_encoding = HTTP_ENCODE_LENGTH;
+
+   /*
+    * The following is a hack for HTTP servers that don't send a
+    * content-length or transfer-encoding field...
+    *
+    * If there is no content-length then the connection must close
+    * after the transfer is complete...
+    */
+
+    if (http->fields[HTTP_FIELD_CONTENT_LENGTH][0] == '\0')
+      http->data_remaining = 2147483647;
+    else
+      http->data_remaining = strtoll(http->fields[HTTP_FIELD_CONTENT_LENGTH],
+                                     NULL, 10);
+
+    DEBUG_printf(("httpGetLength2: content_length=" CUPS_LLFMT "\n",
+                  CUPS_LLCAST http->data_remaining));
+  }
+
+  if (http->data_remaining <= INT_MAX)
+    http->_data_remaining = (int)http->data_remaining;
+  else
+    http->_data_remaining = INT_MAX;
+
+  return (http->data_remaining);
+}
+
+
+/*
+ * 'httpGetStatus()' - Get the status of the last HTTP request.
+ *
+ * @since CUPS 1.2@
+ */
+
+http_status_t                          /* O - HTTP status */
+httpGetStatus(http_t *http)            /* I - HTTP connection */
+{
+  return (http ? http->status : HTTP_ERROR);
+}
+
+
 /*
  * 'httpGetSubField()' - Get a sub-field value.
  *
@@ -477,7 +677,7 @@ httpGet(http_t     *http,           /* I - HTTP data */
  */
 
 char *                                 /* O - Value or NULL */
-httpGetSubField(http_t       *http,    /* I - HTTP data */
+httpGetSubField(http_t       *http,    /* I - HTTP connection */
                 http_field_t field,    /* I - Field index */
                 const char   *name,    /* I - Name of sub-field */
                char         *value)    /* O - Value string */
@@ -493,7 +693,7 @@ httpGetSubField(http_t       *http, /* I - HTTP data */
  */
 
 char *                                 /* O - Value or NULL */
-httpGetSubField2(http_t       *http,   /* I - HTTP data */
+httpGetSubField2(http_t       *http,   /* I - HTTP connection */
                  http_field_t field,   /* I - Field index */
                  const char   *name,   /* I - Name of sub-field */
                 char         *value,   /* O - Value string */
@@ -508,8 +708,7 @@ httpGetSubField2(http_t       *http,        /* I - HTTP data */
                 http, field, name, value, valuelen));
 
   if (!http || !name || !value || valuelen < 2 ||
-      field < HTTP_FIELD_ACCEPT_LANGUAGE ||
-      field > HTTP_FIELD_WWW_AUTHENTICATE)
+      field <= HTTP_FIELD_UNKNOWN || field >= HTTP_FIELD_MAX)
     return (NULL);
 
   end = value + valuelen - 1;
@@ -614,80 +813,6 @@ httpGetSubField2(http_t       *http,       /* I - HTTP data */
 }
 
 
-/*
- * 'httpGetLength()' - Get the amount of data remaining from the
- *                     content-length or transfer-encoding fields.
- *
- * This function is deprecated and will not return lengths larger than
- * 2^31 - 1; use httpGetLength2() instead.
- *
- * @since CUPS 1.2@
- */
-
-int                                    /* O - Content length */
-httpGetLength(http_t *http)            /* I - HTTP data */
-{
- /*
-  * Get the read content length and return the 32-bit value.
-  */
-
-  httpGetLength2(http);
-
-  return (http->_data_remaining);
-}
-
-
-/*
- * 'httpGetLength2()' - Get the amount of data remaining from the
- *                      content-length or transfer-encoding fields.
- *
- * This function returns the complete content length, even for
- * content larger than 2^31 - 1.
- */
-
-off_t                                  /* O - Content length */
-httpGetLength2(http_t *http)           /* I - HTTP data */
-{
-  DEBUG_printf(("httpGetLength2(http=%p), state=%d\n", http, http->state));
-
-  if (!strcasecmp(http->fields[HTTP_FIELD_TRANSFER_ENCODING], "chunked"))
-  {
-    DEBUG_puts("httpGetLength2: chunked request!");
-
-    http->data_encoding  = HTTP_ENCODE_CHUNKED;
-    http->data_remaining = 0;
-  }
-  else
-  {
-    http->data_encoding = HTTP_ENCODE_LENGTH;
-
-   /*
-    * The following is a hack for HTTP servers that don't send a
-    * content-length or transfer-encoding field...
-    *
-    * If there is no content-length then the connection must close
-    * after the transfer is complete...
-    */
-
-    if (http->fields[HTTP_FIELD_CONTENT_LENGTH][0] == '\0')
-      http->data_remaining = 2147483647;
-    else
-      http->data_remaining = strtoll(http->fields[HTTP_FIELD_CONTENT_LENGTH],
-                                     NULL, 10);
-
-    DEBUG_printf(("httpGetLength2: content_length=" CUPS_LLFMT "\n",
-                  CUPS_LLCAST http->data_remaining));
-  }
-
-  if (http->data_remaining <= INT_MAX)
-    http->_data_remaining = (int)http->data_remaining;
-  else
-    http->_data_remaining = INT_MAX;
-
-  return (http->data_remaining);
-}
-
-
 /*
  * 'httpGets()' - Get a line of text from a HTTP connection.
  */
@@ -695,7 +820,7 @@ httpGetLength2(http_t *http)                /* I - HTTP data */
 char *                                 /* O - Line or NULL */
 httpGets(char   *line,                 /* I - Line to read into */
          int    length,                        /* I - Max length of buffer */
-        http_t *http)                  /* I - HTTP data */
+        http_t *http)                  /* I - HTTP connection */
 {
   char *lineptr,                       /* Pointer into line */
        *lineend,                       /* End of line */
@@ -842,7 +967,7 @@ httpGets(char   *line,                      /* I - Line to read into */
  */
 
 int                                    /* O - Status of call (0 = success) */
-httpHead(http_t     *http,             /* I - HTTP data */
+httpHead(http_t     *http,             /* I - HTTP connection */
          const char *uri)              /* I - URI for head */
 {
   return (http_send(http, HTTP_HEAD, uri));
@@ -923,7 +1048,7 @@ httpInitialize(void)
  */
 
 int                                    /* O - Status of call (0 = success) */
-httpOptions(http_t     *http,          /* I - HTTP data */
+httpOptions(http_t     *http,          /* I - HTTP connection */
             const char *uri)           /* I - URI for options */
 {
   return (http_send(http, HTTP_OPTIONS, uri));
@@ -935,7 +1060,7 @@ httpOptions(http_t     *http,              /* I - HTTP data */
  */
 
 int                                    /* O - Status of call (0 = success) */
-httpPost(http_t     *http,             /* I - HTTP data */
+httpPost(http_t     *http,             /* I - HTTP connection */
          const char *uri)              /* I - URI for post */
 {
   return (http_send(http, HTTP_POST, uri));
@@ -944,10 +1069,12 @@ httpPost(http_t     *http,               /* I - HTTP data */
 
 /*
  * 'httpPrintf()' - Print a formatted string to a HTTP connection.
+ *
+ * @private@
  */
 
 int                                    /* O - Number of bytes written */
-httpPrintf(http_t     *http,           /* I - HTTP data */
+httpPrintf(http_t     *http,           /* I - HTTP connection */
            const char *format,         /* I - printf-style format string */
           ...)                         /* I - Additional args as needed */
 {
@@ -981,7 +1108,7 @@ httpPrintf(http_t     *http,               /* I - HTTP data */
  */
 
 int                                    /* O - Status of call (0 = success) */
-httpPut(http_t     *http,              /* I - HTTP data */
+httpPut(http_t     *http,              /* I - HTTP connection */
         const char *uri)               /* I - URI to put */
 {
   return (http_send(http, HTTP_PUT, uri));
@@ -998,7 +1125,7 @@ httpPut(http_t     *http,          /* I - HTTP data */
  */
 
 int                                    /* O - Number of bytes read */
-httpRead(http_t *http,                 /* I - HTTP data */
+httpRead(http_t *http,                 /* I - HTTP connection */
          char   *buffer,               /* I - Buffer for data */
         int    length)                 /* I - Maximum number of bytes */
 {
@@ -1008,10 +1135,12 @@ httpRead(http_t *http,                  /* I - HTTP data */
 
 /*
  * 'httpRead2()' - Read data from a HTTP connection.
+ *
+ * @since CUPS 1.2@
  */
 
 ssize_t                                        /* O - Number of bytes read */
-httpRead2(http_t *http,                        /* I - HTTP data */
+httpRead2(http_t *http,                        /* I - HTTP connection */
           char   *buffer,              /* I - Buffer for data */
          size_t length)                /* I - Maximum number of bytes */
 {
@@ -1287,11 +1416,11 @@ _httpReadCDSA(
 
 
 /*
- * 'httpReconnect()' - Reconnect to a HTTP server...
+ * 'httpReconnect()' - Reconnect to a HTTP server.
  */
 
 int                                    /* O - 0 on success, non-zero on failure */
-httpReconnect(http_t *http)            /* I - HTTP data */
+httpReconnect(http_t *http)            /* I - HTTP connection */
 {
   http_addrlist_t      *addr;          /* Connected address */
 
@@ -1399,7 +1528,7 @@ httpSetCookie(http_t     *http,           /* I - Connection */
  */
 
 void
-httpSetField(http_t       *http,       /* I - HTTP data */
+httpSetField(http_t       *http,       /* I - HTTP connection */
              http_field_t field,       /* I - Field index */
             const char   *value)       /* I - Value */
 {
@@ -1420,7 +1549,7 @@ httpSetField(http_t       *http,  /* I - HTTP data */
  */
 
 void
-httpSetLength(http_t *http,            /* I - HTTP data */
+httpSetLength(http_t *http,            /* I - HTTP connection */
               size_t length)           /* I - Length (0 for chunked) */
 {
   if (!http)
@@ -1445,7 +1574,7 @@ httpSetLength(http_t *http,               /* I - HTTP data */
  */
 
 int                                    /* O - Status of call (0 = success) */
-httpTrace(http_t     *http,            /* I - HTTP data */
+httpTrace(http_t     *http,            /* I - HTTP connection */
           const char *uri)             /* I - URI for trace */
 {
   return (http_send(http, HTTP_TRACE, uri));
@@ -1457,7 +1586,7 @@ httpTrace(http_t     *http,               /* I - HTTP data */
  */
 
 http_status_t                          /* O - HTTP status */
-httpUpdate(http_t *http)               /* I - HTTP data */
+httpUpdate(http_t *http)               /* I - HTTP connection */
 {
   char         line[32768],            /* Line from connection... */
                *value;                 /* Pointer to value on line */
@@ -1636,7 +1765,7 @@ httpUpdate(http_t *http)          /* I - HTTP data */
  */
 
 int                                    /* O - 1 if data is available, 0 otherwise */
-httpWait(http_t *http,                 /* I - HTTP data */
+httpWait(http_t *http,                 /* I - HTTP connection */
          int    msec)                  /* I - Milliseconds to wait */
 {
  /*
@@ -1667,7 +1796,7 @@ httpWait(http_t *http,                    /* I - HTTP data */
  */
  
 int                                    /* O - Number of bytes written */
-httpWrite(http_t     *http,            /* I - HTTP data */
+httpWrite(http_t     *http,            /* I - HTTP connection */
           const char *buffer,          /* I - Buffer for data */
          int        length)            /* I - Number of bytes to write */
 {
@@ -1677,10 +1806,12 @@ httpWrite(http_t     *http,             /* I - HTTP data */
 
 /*
  * 'httpWrite2()' - Write data to a HTTP connection.
+ *
+ * @since CUPS 1.2@
  */
  
 ssize_t                                        /* O - Number of bytes written */
-httpWrite2(http_t     *http,           /* I - HTTP data */
+httpWrite2(http_t     *http,           /* I - HTTP connection */
            const char *buffer,         /* I - Buffer for data */
           size_t     length)           /* I - Number of bytes to write */
 {
@@ -1860,7 +1991,7 @@ http_field(const char *name)      /* I - String name */
  */
 
 static int                             /* O - Bytes read */
-http_read_ssl(http_t *http,            /* I - HTTP data */
+http_read_ssl(http_t *http,            /* I - HTTP connection */
              char   *buf,              /* I - Buffer to store data */
              int    len)               /* I - Length of buffer */
 {
@@ -1907,7 +2038,7 @@ http_read_ssl(http_t *http,               /* I - HTTP data */
  */
 
 static int                     /* O - 0 on success, non-zero on error */
-http_send(http_t       *http,  /* I - HTTP data */
+http_send(http_t       *http,  /* I - HTTP connection */
           http_state_t request,        /* I - Request code */
          const char   *uri)    /* I - URI */
 {
@@ -2036,7 +2167,7 @@ http_send(http_t       *http,     /* I - HTTP data */
  */
 
 static int                             /* O - Status of connection */
-http_setup_ssl(http_t *http)           /* I - HTTP data */
+http_setup_ssl(http_t *http)           /* I - HTTP connection */
 {
 #  ifdef HAVE_LIBSSL
   SSL_CTX      *context;       /* Context for encryption */
@@ -2166,7 +2297,7 @@ http_setup_ssl(http_t *http)              /* I - HTTP data */
  */
 
 static void
-http_shutdown_ssl(http_t *http)        /* I - HTTP data */
+http_shutdown_ssl(http_t *http)        /* I - HTTP connection */
 {
 #  ifdef HAVE_LIBSSL
   SSL_CTX      *context;       /* Context for encryption */
@@ -2211,7 +2342,7 @@ http_shutdown_ssl(http_t *http)   /* I - HTTP data */
  */
 
 static int                     /* O - Status of connection */
-http_upgrade(http_t *http)     /* I - HTTP data */
+http_upgrade(http_t *http)     /* I - HTTP connection */
 {
   int          ret;            /* Return value */
   http_t       myhttp;         /* Local copy of HTTP data */
@@ -2302,7 +2433,7 @@ http_upgrade(http_t *http)        /* I - HTTP data */
  */
 
 static int                             /* O - 1 if data is available, 0 otherwise */
-http_wait(http_t *http,                        /* I - HTTP data */
+http_wait(http_t *http,                        /* I - HTTP connection */
           int    msec)                 /* I - Milliseconds to wait */
 {
 #ifndef WIN32
@@ -2404,7 +2535,7 @@ http_wait(http_t *http,                   /* I - HTTP data */
  */
  
 static int                             /* O - Number of bytes written */
-http_write(http_t     *http,           /* I - HTTP data */
+http_write(http_t     *http,           /* I - HTTP connection */
           const char *buffer,          /* I - Buffer for data */
          int        length)            /* I - Number of bytes to write */
 {
@@ -2492,7 +2623,7 @@ http_write(http_t     *http,              /* I - HTTP data */
  */
 
 static int                             /* O - Number bytes written */
-http_write_chunk(http_t     *http,     /* I - HTTP data */
+http_write_chunk(http_t     *http,     /* I - HTTP connection */
                  const char *buffer,   /* I - Buffer to write */
                 int        length)     /* I - Length of buffer */
 {
@@ -2535,7 +2666,7 @@ http_write_chunk(http_t     *http,        /* I - HTTP data */
  */
 
 static int                             /* O - Bytes written */
-http_write_ssl(http_t     *http,       /* I - HTTP data */
+http_write_ssl(http_t     *http,       /* I - HTTP connection */
               const char *buf,         /* I - Buffer holding data */
               int        len)          /* I - Length of buffer */
 {
@@ -2577,5 +2708,5 @@ http_write_ssl(http_t     *http,  /* I - HTTP data */
 
 
 /*
- * End of "$Id: http.c 5103 2006-02-14 19:27:42Z mike $".
+ * End of "$Id: http.c 5138 2006-02-21 10:49:06Z mike $".
  */
index 9c346eebfca2be8194374a8640c667fb178cc5c1..0b13ba6c10be4a664e5a1c7063d5da00cea44988 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: http.h 5023 2006-01-29 14:39:44Z mike $"
+ * "$Id: http.h 5138 2006-02-21 10:49:06Z mike $"
  *
  *   Hyper-Text Transport Protocol definitions for the Common UNIX Printing
  *   System (CUPS).
@@ -286,7 +286,7 @@ typedef enum http_version_e         /**** HTTP version numbers ****/
   HTTP_1_1 = 101                       /* HTTP/1.1 */
 } http_version_t;
 
-typedef union http_addr_u              /**** Socket address union, which
+typedef union _http_addr_u             /**** Socket address union, which
                                         **** makes using IPv6 and other
                                         **** address types easier and
                                         **** more portable. @since CUPS 1.2@
@@ -313,7 +313,7 @@ typedef struct http_addrlist_s              /**** Socket address list, which is
   http_addr_t          addr;           /* Address */
 } http_addrlist_t;
 
-typedef struct http_s                  /**** HTTP connection structure. ****/
+typedef struct _http_s                 /**** HTTP connection structure. ****/
 {
   int                  fd;             /* File descriptor for this socket */
   int                  blocking;       /* To block or not to block */
@@ -365,23 +365,22 @@ typedef struct http_s                     /**** HTTP connection structure. ****/
  * Prototypes...
  */
 
-#  define              httpBlocking(http,b)    (http)->blocking = (b)
+extern void            httpBlocking(http_t *http, int b);
 extern int             httpCheck(http_t *http);
-#  define              httpClearFields(http)   memset((http)->fields, 0, sizeof((http)->fields)),\
-                                               httpSetField((http), HTTP_FIELD_HOST, (http)->hostname)
+extern void            httpClearFields(http_t *http);
 extern void            httpClose(http_t *http);
 extern http_t          *httpConnect(const char *host, int port);
 extern http_t          *httpConnectEncrypt(const char *host, int port,
                                            http_encryption_t encryption);
 extern int             httpDelete(http_t *http, const char *uri);
 extern int             httpEncryption(http_t *http, http_encryption_t e);
-#  define              httpError(http) ((http)->error)
+extern int             httpError(http_t *http);
 extern void            httpFlush(http_t *http);
 extern int             httpGet(http_t *http, const char *uri);
 extern char            *httpGets(char *line, int length, http_t *http);
 extern const char      *httpGetDateString(time_t t);
 extern time_t          httpGetDateTime(const char *s);
-#  define              httpGetField(http,field)        (http)->fields[field]
+extern const char      *httpGetField(http_t *http, http_field_t field);
 extern struct hostent  *httpGetHostByName(const char *name);
 extern char            *httpGetSubField(http_t *http, http_field_t field,
                                         const char *name, char *value);
@@ -417,7 +416,7 @@ extern char         *httpMD5String(const unsigned char *, char [33]);
 
 /**** New in CUPS 1.1.19 ****/
 extern void            httpClearCookie(http_t *http);
-#define httpGetCookie(http) ((http)->cookie)
+extern const char      *httpGetCookie(http_t *http);
 extern void            httpSetCookie(http_t *http, const char *cookie);
 extern int             httpWait(http_t *http, int msec);
 
@@ -458,9 +457,12 @@ extern http_uri_status_t httpAssembleURIf(http_uri_coding_t encoding,
                                          const char *host, int port,
                                          const char *resourcef, ...);
 extern int             httpFlushWrite(http_t *http);
+extern int             httpGetBlocking(http_t *http);
 extern const char      *httpGetDateString2(time_t t, char *s, int slen);
+extern int             httpGetFd(http_t *http);
 extern const char      *httpGetHostname(char *s, int slen);
 extern off_t           httpGetLength2(http_t *http);
+extern http_status_t   httpGetStatus(http_t *http);
 extern char            *httpGetSubField2(http_t *http, http_field_t field,
                                          const char *name, char *value,
                                          int valuelen);
@@ -486,5 +488,5 @@ extern ssize_t              httpWrite2(http_t *http, const char *buffer,
 #endif /* !_CUPS_HTTP_H_ */
 
 /*
- * End of "$Id: http.h 5023 2006-01-29 14:39:44Z mike $".
+ * End of "$Id: http.h 5138 2006-02-21 10:49:06Z mike $".
  */
index 9a08e6266bd41818bf85184ce397fe7f5a7d748e..4d7facc05d5e5399a3a556e1226a535407d43199 100644 (file)
@@ -1,10 +1,10 @@
 /*
- * "$Id: ipp-support.c 5090 2006-02-08 17:08:01Z mike $"
+ * "$Id: ipp-support.c 5138 2006-02-21 10:49:06Z mike $"
  *
  *   Internet Printing Protocol support functions for the Common UNIX
  *   Printing System (CUPS).
  *
- *   Copyright 1997-2005 by Easy Software Products, all rights reserved.
+ *   Copyright 1997-2006 by Easy Software Products, all rights reserved.
  *
  *   These coded instructions, statements, and computer programs are the
  *   property of Easy Software Products and are protected by Federal
@@ -327,5 +327,5 @@ ippSetPort(int p)                   /* I - Port number to use */
 
 
 /*
- * End of "$Id: ipp-support.c 5090 2006-02-08 17:08:01Z mike $".
+ * End of "$Id: ipp-support.c 5138 2006-02-21 10:49:06Z mike $".
  */
index ae8dd61c13ec4131baf9862a4639efbc8f1eaa1e..6435a0eca79d43fde2105994d6a2e81b8d778835 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: ipp.h 5090 2006-02-08 17:08:01Z mike $"
+ * "$Id: ipp.h 5138 2006-02-21 10:49:06Z mike $"
  *
  *   Internet Printing Protocol definitions for the Common UNIX Printing
  *   System (CUPS).
@@ -72,86 +72,86 @@ extern "C" {
  * Types and structures...
  */
 
-typedef enum                           /**** Format tags for attribute formats... ****/
+typedef enum ipp_tag_e                 /**** Format tags for attributes... ****/
 {
-  IPP_TAG_ZERO = 0x00,
-  IPP_TAG_OPERATION,
-  IPP_TAG_JOB,
-  IPP_TAG_END,
-  IPP_TAG_PRINTER,
-  IPP_TAG_UNSUPPORTED_GROUP,
-  IPP_TAG_SUBSCRIPTION,
-  IPP_TAG_EVENT_NOTIFICATION,
-  IPP_TAG_UNSUPPORTED_VALUE = 0x10,
-  IPP_TAG_DEFAULT,
-  IPP_TAG_UNKNOWN,
-  IPP_TAG_NOVALUE,
-  IPP_TAG_NOTSETTABLE = 0x15,
-  IPP_TAG_DELETEATTR,
-  IPP_TAG_ADMINDEFINE,
-  IPP_TAG_INTEGER = 0x21,
-  IPP_TAG_BOOLEAN,
-  IPP_TAG_ENUM,
-  IPP_TAG_STRING = 0x30,
-  IPP_TAG_DATE,
-  IPP_TAG_RESOLUTION,
-  IPP_TAG_RANGE,
-  IPP_TAG_BEGIN_COLLECTION,
-  IPP_TAG_TEXTLANG,
-  IPP_TAG_NAMELANG,
-  IPP_TAG_END_COLLECTION,
-  IPP_TAG_TEXT = 0x41,
-  IPP_TAG_NAME,
-  IPP_TAG_KEYWORD = 0x44,
-  IPP_TAG_URI,
-  IPP_TAG_URISCHEME,
-  IPP_TAG_CHARSET,
-  IPP_TAG_LANGUAGE,
-  IPP_TAG_MIMETYPE,
-  IPP_TAG_MEMBERNAME,
+  IPP_TAG_ZERO = 0x00,                 /* Zero tag - used for separators */
+  IPP_TAG_OPERATION,                   /* Operation group */
+  IPP_TAG_JOB,                         /* Job group */
+  IPP_TAG_END,                         /* End-of-attributes */
+  IPP_TAG_PRINTER,                     /* Printer group */
+  IPP_TAG_UNSUPPORTED_GROUP,           /* Unsupported attributes group */
+  IPP_TAG_SUBSCRIPTION,                        /* Subscription group */
+  IPP_TAG_EVENT_NOTIFICATION,          /* Event group */
+  IPP_TAG_UNSUPPORTED_VALUE = 0x10,    /* Unsupported value */
+  IPP_TAG_DEFAULT,                     /* Default value */
+  IPP_TAG_UNKNOWN,                     /* Unknown value */
+  IPP_TAG_NOVALUE,                     /* No-value value */
+  IPP_TAG_NOTSETTABLE = 0x15,          /* Not-settable value */
+  IPP_TAG_DELETEATTR,                  /* Delete-attribute value */
+  IPP_TAG_ADMINDEFINE,                 /* Admin-defined value */
+  IPP_TAG_INTEGER = 0x21,              /* Integer value */
+  IPP_TAG_BOOLEAN,                     /* Boolean value */
+  IPP_TAG_ENUM,                                /* Enumeration value */
+  IPP_TAG_STRING = 0x30,               /* Octet string value */
+  IPP_TAG_DATE,                                /* Date/time value */
+  IPP_TAG_RESOLUTION,                  /* Resolution value */
+  IPP_TAG_RANGE,                       /* Range value */
+  IPP_TAG_BEGIN_COLLECTION,            /* Beginning of collection value */
+  IPP_TAG_TEXTLANG,                    /* Text-with-language value */
+  IPP_TAG_NAMELANG,                    /* Name-with-language value */
+  IPP_TAG_END_COLLECTION,              /* End of collection value */
+  IPP_TAG_TEXT = 0x41,                 /* Text value */
+  IPP_TAG_NAME,                                /* Name value */
+  IPP_TAG_KEYWORD = 0x44,              /* Keyword value */
+  IPP_TAG_URI,                         /* URI value */
+  IPP_TAG_URISCHEME,                   /* URI scheme value */
+  IPP_TAG_CHARSET,                     /* Character set value */
+  IPP_TAG_LANGUAGE,                    /* Language value */
+  IPP_TAG_MIMETYPE,                    /* MIME media type value */
+  IPP_TAG_MEMBERNAME,                  /* Collection member name value */
   IPP_TAG_MASK = 0x7fffffff,           /* Mask for copied attribute values */
   IPP_TAG_COPY = -0x7fffffff-1         /* Bitflag for copied attribute values */
 } ipp_tag_t;
 
-typedef enum                           /**** Resolution units... ****/
+typedef enum ipp_res_e                 /**** Resolution units... ****/
 {
-  IPP_RES_PER_INCH = 3,
-  IPP_RES_PER_CM
+  IPP_RES_PER_INCH = 3,                        /* Pixels per inch */
+  IPP_RES_PER_CM                       /* Pixels per centimeter */
 } ipp_res_t;
 
-typedef enum                           /**** Finishings... ****/
+typedef enum ipp_finish_e              /**** Finishings... ****/
 {
-  IPP_FINISHINGS_NONE = 3,
-  IPP_FINISHINGS_STAPLE,
-  IPP_FINISHINGS_PUNCH,
-  IPP_FINISHINGS_COVER,
-  IPP_FINISHINGS_BIND,
-  IPP_FINISHINGS_SADDLE_STITCH,
-  IPP_FINISHINGS_EDGE_STITCH,
-  IPP_FINISHINGS_FOLD,
-  IPP_FINISHINGS_TRIM,
-  IPP_FINISHINGS_BALE,
-  IPP_FINISHINGS_BOOKLET_MAKER,
-  IPP_FINISHINGS_JOB_OFFSET,
-  IPP_FINISHINGS_STAPLE_TOP_LEFT = 20,
-  IPP_FINISHINGS_STAPLE_BOTTOM_LEFT,
-  IPP_FINISHINGS_STAPLE_TOP_RIGHT,
-  IPP_FINISHINGS_STAPLE_BOTTOM_RIGHT,
-  IPP_FINISHINGS_EDGE_STITCH_LEFT,
-  IPP_FINISHINGS_EDGE_STITCH_TOP,
-  IPP_FINISHINGS_EDGE_STITCH_RIGHT,
-  IPP_FINISHINGS_EDGE_STITCH_BOTTOM,
-  IPP_FINISHINGS_STAPLE_DUAL_LEFT,
-  IPP_FINISHINGS_STAPLE_DUAL_TOP,
-  IPP_FINISHINGS_STAPLE_DUAL_RIGHT,
-  IPP_FINISHINGS_STAPLE_DUAL_BOTTOM,
-  IPP_FINISHINGS_BIND_LEFT = 50,
-  IPP_FINISHINGS_BIND_TOP,
-  IPP_FINISHINGS_BIND_RIGHT,
-  IPP_FINISHINGS_BIND_BOTTOM
+  IPP_FINISHINGS_NONE = 3,             /* No finishing */
+  IPP_FINISHINGS_STAPLE,               /* Staple (any location) */
+  IPP_FINISHINGS_PUNCH,                        /* Punch (any location/count) */
+  IPP_FINISHINGS_COVER,                        /* Add cover */
+  IPP_FINISHINGS_BIND,                 /* Bind */
+  IPP_FINISHINGS_SADDLE_STITCH,                /* Staple interior */
+  IPP_FINISHINGS_EDGE_STITCH,          /* Stitch along any side */
+  IPP_FINISHINGS_FOLD,                 /* Fold (any type) */
+  IPP_FINISHINGS_TRIM,                 /* Trim (any type) */
+  IPP_FINISHINGS_BALE,                 /* Bale (any type) */
+  IPP_FINISHINGS_BOOKLET_MAKER,                /* Fold to make booklet */
+  IPP_FINISHINGS_JOB_OFFSET,           /* Offset for binding (any type) */
+  IPP_FINISHINGS_STAPLE_TOP_LEFT = 20, /* Staple top left corner */
+  IPP_FINISHINGS_STAPLE_BOTTOM_LEFT,   /* Staple bottom left corner */
+  IPP_FINISHINGS_STAPLE_TOP_RIGHT,     /* Staple top right corner */
+  IPP_FINISHINGS_STAPLE_BOTTOM_RIGHT,  /* Staple bottom right corner */
+  IPP_FINISHINGS_EDGE_STITCH_LEFT,     /* Stitch along left side */
+  IPP_FINISHINGS_EDGE_STITCH_TOP,      /* Stitch along top edge */
+  IPP_FINISHINGS_EDGE_STITCH_RIGHT,    /* Stitch along right side */
+  IPP_FINISHINGS_EDGE_STITCH_BOTTOM,   /* Stitch along bottom edge */
+  IPP_FINISHINGS_STAPLE_DUAL_LEFT,     /* Two staples on left */
+  IPP_FINISHINGS_STAPLE_DUAL_TOP,      /* Two staples on top */
+  IPP_FINISHINGS_STAPLE_DUAL_RIGHT,    /* Two staples on right */
+  IPP_FINISHINGS_STAPLE_DUAL_BOTTOM,   /* Two staples on bottom */
+  IPP_FINISHINGS_BIND_LEFT = 50,       /* Bind on left */
+  IPP_FINISHINGS_BIND_TOP,             /* Bind on top */
+  IPP_FINISHINGS_BIND_RIGHT,           /* Bind on right */
+  IPP_FINISHINGS_BIND_BOTTOM           /* Bind on bottom */
 } ipp_finish_t;
 
-typedef enum                           /**** Orientation... ****/
+typedef enum ipp_orient_e              /**** Orientation... ****/
 {
   IPP_PORTRAIT = 3,                    /* No rotation */
   IPP_LANDSCAPE,                       /* 90 degrees counter-clockwise */
@@ -159,32 +159,32 @@ typedef enum                              /**** Orientation... ****/
   IPP_REVERSE_PORTRAIT                 /* 180 degrees */
 } ipp_orient_t;
 
-typedef enum                           /**** Qualities... ****/
+typedef enum ipp_quality_e             /**** Qualities... ****/
 {
-  IPP_QUALITY_DRAFT = 3,
-  IPP_QUALITY_NORMAL,
-  IPP_QUALITY_HIGH
+  IPP_QUALITY_DRAFT = 3,               /* Draft quality */
+  IPP_QUALITY_NORMAL,                  /* Normal quality */
+  IPP_QUALITY_HIGH                     /* High quality */
 } ipp_quality_t;
 
-typedef enum                           /**** Job States.... */
+typedef enum ipp_jstate_e              /**** Job States.... */
 {
-  IPP_JOB_PENDING = 3,
-  IPP_JOB_HELD,
-  IPP_JOB_PROCESSING,
-  IPP_JOB_STOPPED,
-  IPP_JOB_CANCELLED,
-  IPP_JOB_ABORTED,
-  IPP_JOB_COMPLETED
+  IPP_JOB_PENDING = 3,                 /* Job is waiting to be printed */
+  IPP_JOB_HELD,                                /* Job is held for printing */
+  IPP_JOB_PROCESSING,                  /* Job is currently printing */
+  IPP_JOB_STOPPED,                     /* Job has been stopped */
+  IPP_JOB_CANCELLED,                   /* Job has been cancelled */
+  IPP_JOB_ABORTED,                     /* Job has aborted due to error */
+  IPP_JOB_COMPLETED                    /* Job has completed successfully */
 } ipp_jstate_t;
 
-typedef enum                           /**** Printer States.... */
+typedef enum ipp_pstate_e              /**** Printer States.... */
 {
-  IPP_PRINTER_IDLE = 3,
-  IPP_PRINTER_PROCESSING,
-  IPP_PRINTER_STOPPED
+  IPP_PRINTER_IDLE = 3,                        /* Printer is idle */
+  IPP_PRINTER_PROCESSING,              /* Printer is working */
+  IPP_PRINTER_STOPPED                  /* Printer is stopped */
 } ipp_pstate_t;
 
-typedef enum                           /**** IPP states... ****/
+typedef enum ipp_state_e               /**** IPP states... ****/
 {
   IPP_ERROR = -1,                      /* An error occurred */
   IPP_IDLE,                            /* Nothing is happening/request completed */
@@ -193,120 +193,120 @@ typedef enum                            /**** IPP states... ****/
   IPP_DATA                             /* IPP request data needs to be sent/received */
 } ipp_state_t;
 
-typedef enum                           /**** IPP operations... ****/
+typedef enum ipp_op_e                  /**** IPP operations... ****/
 {
-  IPP_PRINT_JOB = 0x0002,
-  IPP_PRINT_URI,
-  IPP_VALIDATE_JOB,
-  IPP_CREATE_JOB,
-  IPP_SEND_DOCUMENT,
-  IPP_SEND_URI,
-  IPP_CANCEL_JOB,
-  IPP_GET_JOB_ATTRIBUTES,
-  IPP_GET_JOBS,
-  IPP_GET_PRINTER_ATTRIBUTES,
-  IPP_HOLD_JOB,
-  IPP_RELEASE_JOB,
-  IPP_RESTART_JOB,
-  IPP_PAUSE_PRINTER = 0x0010,
-  IPP_RESUME_PRINTER,
-  IPP_PURGE_JOBS,
-  IPP_SET_PRINTER_ATTRIBUTES,
-  IPP_SET_JOB_ATTRIBUTES,
-  IPP_GET_PRINTER_SUPPORTED_VALUES,
-  IPP_CREATE_PRINTER_SUBSCRIPTION,
-  IPP_CREATE_JOB_SUBSCRIPTION,
-  IPP_GET_SUBSCRIPTION_ATTRIBUTES,
-  IPP_GET_SUBSCRIPTIONS,
-  IPP_RENEW_SUBSCRIPTION,
-  IPP_CANCEL_SUBSCRIPTION,
-  IPP_GET_NOTIFICATIONS,
-  IPP_SEND_NOTIFICATIONS,
-  IPP_GET_PRINT_SUPPORT_FILES = 0x0021,
-  IPP_ENABLE_PRINTER,
-  IPP_DISABLE_PRINTER,
-  IPP_PAUSE_PRINTER_AFTER_CURRENT_JOB,
-  IPP_HOLD_NEW_JOBS,
-  IPP_RELEASE_HELD_NEW_JOBS,
-  IPP_DEACTIVATE_PRINTER,
-  IPP_ACTIVATE_PRINTER,
-  IPP_RESTART_PRINTER,
-  IPP_SHUTDOWN_PRINTER,
-  IPP_STARTUP_PRINTER,
-  IPP_REPROCESS_JOB,
-  IPP_CANCEL_CURRENT_JOB,
-  IPP_SUSPEND_CURRENT_JOB,
-  IPP_RESUME_JOB,
-  IPP_PROMOTE_JOB,
-  IPP_SCHEDULE_JOB_AFTER,
-  IPP_PRIVATE = 0x4000,
-  CUPS_GET_DEFAULT,
-  CUPS_GET_PRINTERS,
-  CUPS_ADD_MODIFY_PRINTER,
-  CUPS_DELETE_PRINTER,
-  CUPS_GET_CLASSES,
-  CUPS_ADD_MODIFY_CLASS,
-  CUPS_DELETE_CLASS,
-  CUPS_ACCEPT_JOBS,
-  CUPS_REJECT_JOBS,
-  CUPS_SET_DEFAULT,
-  CUPS_GET_DEVICES,
-  CUPS_GET_PPDS,
-  CUPS_MOVE_JOB,
-  CUPS_AUTHENTICATE_JOB
+  IPP_PRINT_JOB = 0x0002,              /* Print a single file */
+  IPP_PRINT_URI,                       /* Print a single URL @private@ */
+  IPP_VALIDATE_JOB,                    /* Validate job options */
+  IPP_CREATE_JOB,                      /* Create an empty print job */
+  IPP_SEND_DOCUMENT,                   /* Add a file to a job */
+  IPP_SEND_URI,                                /* Add a URL to a job @private@ */
+  IPP_CANCEL_JOB,                      /* Cancel a job */
+  IPP_GET_JOB_ATTRIBUTES,              /* Get job attributes */
+  IPP_GET_JOBS,                                /* Get a list of jobs */
+  IPP_GET_PRINTER_ATTRIBUTES,          /* Get printer attributes */
+  IPP_HOLD_JOB,                                /* Hold a job for printing */
+  IPP_RELEASE_JOB,                     /* Release a job for printing */
+  IPP_RESTART_JOB,                     /* Reprint a job */
+  IPP_PAUSE_PRINTER = 0x0010,          /* Stop a printer */
+  IPP_RESUME_PRINTER,                  /* Start a printer */
+  IPP_PURGE_JOBS,                      /* Cancel all jobs */
+  IPP_SET_PRINTER_ATTRIBUTES,          /* Set printer attributes @private@ */
+  IPP_SET_JOB_ATTRIBUTES,              /* Set job attributes */
+  IPP_GET_PRINTER_SUPPORTED_VALUES,    /* Get supported attribute values */
+  IPP_CREATE_PRINTER_SUBSCRIPTION,     /* Create a printer subscription @since CUPS 1.2@ */
+  IPP_CREATE_JOB_SUBSCRIPTION,         /* Create a job subscription @since CUPS 1.2@ */
+  IPP_GET_SUBSCRIPTION_ATTRIBUTES,     /* Get subscription attributes @since CUPS 1.2@ */
+  IPP_GET_SUBSCRIPTIONS,               /* Get list of subscriptions @since CUPS 1.2@ */
+  IPP_RENEW_SUBSCRIPTION,              /* Renew a printer subscription @since CUPS 1.2@ */
+  IPP_CANCEL_SUBSCRIPTION,             /* Cancel a subscription @since CUPS 1.2@ */
+  IPP_GET_NOTIFICATIONS,               /* Get notification events @since CUPS 1.2@ */
+  IPP_SEND_NOTIFICATIONS,              /* Send notification events @private@ */
+  IPP_GET_PRINT_SUPPORT_FILES = 0x0021,        /* Get printer support files @private@ */
+  IPP_ENABLE_PRINTER,                  /* Start a printer */
+  IPP_DISABLE_PRINTER,                 /* Stop a printer */
+  IPP_PAUSE_PRINTER_AFTER_CURRENT_JOB, /* Stop printer after the current job @private@ */
+  IPP_HOLD_NEW_JOBS,                   /* Hold new jobs @private@ */
+  IPP_RELEASE_HELD_NEW_JOBS,           /* Release new jobs @private@ */
+  IPP_DEACTIVATE_PRINTER,              /* Stop a printer @private@ */
+  IPP_ACTIVATE_PRINTER,                        /* Start a printer @private@ */
+  IPP_RESTART_PRINTER,                 /* Restart a printer @private@ */
+  IPP_SHUTDOWN_PRINTER,                        /* Turn a printer off @private@ */
+  IPP_STARTUP_PRINTER,                 /* Turn a printer on @private@ */
+  IPP_REPROCESS_JOB,                   /* Reprint a job @private@ */
+  IPP_CANCEL_CURRENT_JOB,              /* Cancel the current job @private@ */
+  IPP_SUSPEND_CURRENT_JOB,             /* Suspend the current job @private@ */
+  IPP_RESUME_JOB,                      /* Resume the current job @private@ */
+  IPP_PROMOTE_JOB,                     /* Promote a job to print sooner @private@ */
+  IPP_SCHEDULE_JOB_AFTER,              /* Schedule a job to print after another @private@ */
+  IPP_PRIVATE = 0x4000,                        /* Reserved @private@ */
+  CUPS_GET_DEFAULT,                    /* Get the default printer */
+  CUPS_GET_PRINTERS,                   /* Get a list of printers and/or classes */
+  CUPS_ADD_MODIFY_PRINTER,             /* Add or modify a printer */
+  CUPS_DELETE_PRINTER,                 /* Delete a printer */
+  CUPS_GET_CLASSES,                    /* Get a list of classes @deprecated@ */
+  CUPS_ADD_MODIFY_CLASS,               /* Add or modify a class */
+  CUPS_DELETE_CLASS,                   /* Delete a class */
+  CUPS_ACCEPT_JOBS,                    /* Accept new jobs on a printer */
+  CUPS_REJECT_JOBS,                    /* Reject new jobs on a printer */
+  CUPS_SET_DEFAULT,                    /* Set the default printer */
+  CUPS_GET_DEVICES,                    /* Get a list of supported devices */
+  CUPS_GET_PPDS,                       /* Get a list of supported drivers */
+  CUPS_MOVE_JOB,                       /* Move a job to a different printer */
+  CUPS_AUTHENTICATE_JOB                        /* Authenticate a job @since CUPS 1.2@ */
 } ipp_op_t;
 
 /* Old names for the operations */
 #define CUPS_ADD_PRINTER       CUPS_ADD_MODIFY_PRINTER
 #define CUPS_ADD_CLASS         CUPS_ADD_MODIFY_CLASS
 
-typedef enum                           /**** IPP status codes... ****/
+typedef enum ipp_status_e              /**** IPP status codes... ****/
 {
-  IPP_OK = 0x0000,
-  IPP_OK_SUBST,
-  IPP_OK_CONFLICT,
-  IPP_OK_IGNORED_SUBSCRIPTIONS,
-  IPP_OK_IGNORED_NOTIFICATIONS,
-  IPP_OK_TOO_MANY_EVENTS,
-  IPP_OK_BUT_CANCEL_SUBSCRIPTION,
-  IPP_OK_EVENTS_COMPLETE,
-  IPP_REDIRECTION_OTHER_SITE = 0x300,
-  IPP_BAD_REQUEST = 0x0400,
-  IPP_FORBIDDEN,
-  IPP_NOT_AUTHENTICATED,
-  IPP_NOT_AUTHORIZED,
-  IPP_NOT_POSSIBLE,
-  IPP_TIMEOUT,
-  IPP_NOT_FOUND,
-  IPP_GONE,
-  IPP_REQUEST_ENTITY,
-  IPP_REQUEST_VALUE,
-  IPP_DOCUMENT_FORMAT,
-  IPP_ATTRIBUTES,
-  IPP_URI_SCHEME,
-  IPP_CHARSET,
-  IPP_CONFLICT,
-  IPP_COMPRESSION_NOT_SUPPORTED,
-  IPP_COMPRESSION_ERROR,
-  IPP_DOCUMENT_FORMAT_ERROR,
-  IPP_DOCUMENT_ACCESS_ERROR,
-  IPP_ATTRIBUTES_NOT_SETTABLE,
-  IPP_IGNORED_ALL_SUBSCRIPTIONS,
-  IPP_TOO_MANY_SUBSCRIPTIONS,
-  IPP_IGNORED_ALL_NOTIFICATIONS,
-  IPP_PRINT_SUPPORT_FILE_NOT_FOUND,
-
-  IPP_INTERNAL_ERROR = 0x0500,
-  IPP_OPERATION_NOT_SUPPORTED,
-  IPP_SERVICE_UNAVAILABLE,
-  IPP_VERSION_NOT_SUPPORTED,
-  IPP_DEVICE_ERROR,
-  IPP_TEMPORARY_ERROR,
-  IPP_NOT_ACCEPTING,
-  IPP_PRINTER_BUSY,
-  IPP_ERROR_JOB_CANCELLED,
-  IPP_MULTIPLE_JOBS_NOT_SUPPORTED,
-  IPP_PRINTER_IS_DEACTIVATED
+  IPP_OK = 0x0000,                     /* successful-ok */
+  IPP_OK_SUBST,                                /* successful-ok-ignored-or-substituted-attributes */
+  IPP_OK_CONFLICT,                     /* successful-ok-conflicting-attributes */
+  IPP_OK_IGNORED_SUBSCRIPTIONS,                /* successful-ok-ignored-subscriptions */
+  IPP_OK_IGNORED_NOTIFICATIONS,                /* successful-ok-ignored-notifications */
+  IPP_OK_TOO_MANY_EVENTS,              /* successful-ok-too-many-events */
+  IPP_OK_BUT_CANCEL_SUBSCRIPTION,      /* successful-ok-but-cancel-subscription */
+  IPP_OK_EVENTS_COMPLETE,              /* successful-ok-events-complete */
+  IPP_REDIRECTION_OTHER_SITE = 0x300,  /*  */
+  IPP_BAD_REQUEST = 0x0400,            /* client-error-bad-request */
+  IPP_FORBIDDEN,                       /* client-error-forbidden */
+  IPP_NOT_AUTHENTICATED,               /* client-error-not-authenticated */
+  IPP_NOT_AUTHORIZED,                  /* client-error-not-authorized */
+  IPP_NOT_POSSIBLE,                    /* client-error-not-possible */
+  IPP_TIMEOUT,                         /* client-error-timeout */
+  IPP_NOT_FOUND,                       /* client-error-not-found */
+  IPP_GONE,                            /* client-error-gone */
+  IPP_REQUEST_ENTITY,                  /* client-error-request-entity-too-large */
+  IPP_REQUEST_VALUE,                   /* client-error-request-value-too-long */
+  IPP_DOCUMENT_FORMAT,                 /* client-error-document-format-not-supported */
+  IPP_ATTRIBUTES,                      /* client-error-attributes-or-values-not-supported */
+  IPP_URI_SCHEME,                      /* client-error-uri-scheme-not-supported */
+  IPP_CHARSET,                         /* client-error-charset-not-supported */
+  IPP_CONFLICT,                                /* client-error-conflicting-attributes */
+  IPP_COMPRESSION_NOT_SUPPORTED,       /* client-error-compression-not-supported */
+  IPP_COMPRESSION_ERROR,               /* client-error-compression-error */
+  IPP_DOCUMENT_FORMAT_ERROR,           /* client-error-document-format-error */
+  IPP_DOCUMENT_ACCESS_ERROR,           /* client-error-document-access-error */
+  IPP_ATTRIBUTES_NOT_SETTABLE,         /* client-error-attributes-not-settable */
+  IPP_IGNORED_ALL_SUBSCRIPTIONS,       /* client-error-ignored-all-subscriptions */
+  IPP_TOO_MANY_SUBSCRIPTIONS,          /* client-error-too-many-subscriptions */
+  IPP_IGNORED_ALL_NOTIFICATIONS,       /* client-error-ignored-all-notifications */
+  IPP_PRINT_SUPPORT_FILE_NOT_FOUND,    /* client-error-print-support-file-not-found */
+
+  IPP_INTERNAL_ERROR = 0x0500,         /* server-error-internal-error */
+  IPP_OPERATION_NOT_SUPPORTED,         /* server-error-operation-not-supported */
+  IPP_SERVICE_UNAVAILABLE,             /* server-error-service-unavailable */
+  IPP_VERSION_NOT_SUPPORTED,           /* server-error-version-not-supported */
+  IPP_DEVICE_ERROR,                    /* server-error-device-error */
+  IPP_TEMPORARY_ERROR,                 /* server-error-temporary-error */
+  IPP_NOT_ACCEPTING,                   /* server-error-not-accepting-jobs */
+  IPP_PRINTER_BUSY,                    /* server-error-busy */
+  IPP_ERROR_JOB_CANCELLED,             /* server-error-job-canceled */
+  IPP_MULTIPLE_JOBS_NOT_SUPPORTED,     /* server-error-multiple-document-jobs-not-supported */
+  IPP_PRINTER_IS_DEACTIVATED           /* server-error-printer-is-deactivated */
 } ipp_status_t;
 
 typedef unsigned char ipp_uchar_t;     /**** Unsigned 8-bit integer/character ****/
@@ -315,7 +315,7 @@ typedef unsigned char ipp_uchar_t;  /**** Unsigned 8-bit integer/character ****/
 typedef ssize_t        (*ipp_iocb_t)(void *, ipp_uchar_t *, size_t);
                                        /**** IPP IO Callback Function @since CUPS 1.2@ ****/
 
-typedef union                          /**** Request Header ****/
+typedef union ipp_request_u            /**** Request Header ****/
 {
   struct                               /* Any Header */
   {
@@ -348,9 +348,9 @@ typedef union                               /**** Request Header ****/
 } ipp_request_t;
 
 /**** New in CUPS 1.1.19 ****/
-typedef struct ipp_str ipp_t;
+typedef struct ipp_s ipp_t;
 
-typedef union                          /**** Attribute Value ****/
+typedef union ipp_value_u              /**** Attribute Value ****/
 {
   int          integer;                /* Integer/enumerated value */
 
@@ -397,13 +397,13 @@ typedef struct ipp_attribute_s            /**** Attribute ****/
   ipp_value_t  values[1];              /* Values */
 } ipp_attribute_t;
 
-struct ipp_str                         /**** IPP Request/Response/Notification ****/
+struct ipp_s                           /**** IPP Request/Response/Notification ****/
 {
   ipp_state_t  state;                  /* State of request */
   ipp_request_t        request;                /* Request header */
-  ipp_attribute_t *attrs,              /* Attributes */
-               *last,                  /* Last attribute in list */
-               *current;               /* Current attribute (for read/write) */
+  ipp_attribute_t *attrs;              /* Attributes */
+  ipp_attribute_t *last;               /* Last attribute in list */
+  ipp_attribute_t *current;            /* Current attribute (for read/write) */
   ipp_tag_t    curtag;                 /* Current attribute group tag */
 
 /**** New in CUPS 1.2 ****/
@@ -497,5 +497,5 @@ extern ipp_state_t  ippWriteIO(void *dst, ipp_iocb_t cb, int blocking,
 #endif /* !_CUPS_IPP_H_ */
 
 /*
- * End of "$Id: ipp.h 5090 2006-02-08 17:08:01Z mike $".
+ * End of "$Id: ipp.h 5138 2006-02-21 10:49:06Z mike $".
  */
index 5d944af964cc9cf1d55db58372087d200c8c0a94..196394deac8a19555207fe32bc9fc2095d9b1c73 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: ppd.h 5119 2006-02-16 15:52:06Z mike $"
+ * "$Id: ppd.h 5139 2006-02-21 12:56:27Z mike $"
  *
  *   PostScript Printer Description definitions for the Common UNIX Printing
  *   System (CUPS).
@@ -127,7 +127,7 @@ typedef enum ppd_status_e           /**** Status Codes @since CUPS 1.1.19@ ****/
   PPD_BAD_CUSTOM_PARAM                 /* Bad custom parameter */
 } ppd_status_t;
 
-typedef enum ppd_conform_e             /**** Conformance Levels ****/
+typedef enum ppd_conform_e             /**** Conformance Levels @since CUPS 1.1.19@ ****/
 {
   PPD_CONFORM_RELAXED,                 /* Relax whitespace and control char */
   PPD_CONFORM_STRICT                   /* Require strict conformance */
@@ -391,5 +391,5 @@ extern ppd_file_t   *ppdOpen2(cups_file_t *fp);
 #endif /* !_CUPS_PPD_H_ */
 
 /*
- * End of "$Id: ppd.h 5119 2006-02-16 15:52:06Z mike $".
+ * End of "$Id: ppd.h 5139 2006-02-21 12:56:27Z mike $".
  */
diff --git a/cups/request.c b/cups/request.c
new file mode 100644 (file)
index 0000000..14e83f4
--- /dev/null
@@ -0,0 +1,441 @@
+/*
+ * "$Id: request.c 5139 2006-02-21 12:56:27Z mike $"
+ *
+ *   IPP utilities for the Common UNIX Printing System (CUPS).
+ *
+ *   Copyright 1997-2006 by Easy Software Products.
+ *
+ *   These coded instructions, statements, and computer programs are the
+ *   property of Easy Software Products and are protected by Federal
+ *   copyright law.  Distribution and use rights are outlined in the file
+ *   "LICENSE.txt" which should have been included with this file.  If this
+ *   file is missing or damaged please contact Easy Software Products
+ *   at:
+ *
+ *       Attn: CUPS Licensing Information
+ *       Easy Software Products
+ *       44141 Airport View Drive, Suite 204
+ *       Hollywood, Maryland 20636 USA
+ *
+ *       Voice: (301) 373-9600
+ *       EMail: cups-info@cups.org
+ *         WWW: http://www.cups.org
+ *
+ *   This file is subject to the Apple OS-Developed Software exception.
+ *
+ * Contents:
+ *
+ *   cupsDoFileRequest() - Do an IPP request with a file.
+ *   cupsDoRequest()     - Do an IPP request.
+ *   _cupsSetError()     - Set the last IPP status code and status-message.
+ */
+
+/*
+ * Include necessary headers...
+ */
+
+#include "globals.h"
+#include "debug.h"
+#include <stdlib.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <sys/stat.h>
+#if defined(WIN32) || defined(__EMX__)
+#  include <io.h>
+#else
+#  include <unistd.h>
+#endif /* WIN32 || __EMX__ */
+
+
+/*
+ * 'cupsDoFileRequest()' - Do an IPP request with a file.
+ *
+ * This function sends the IPP request to the specified server, retrying
+ * and authenticating as necessary.  The request is freed with ippDelete()
+ * after receiving a valid IPP response.
+ */
+
+ipp_t *                                        /* O - Response data */
+cupsDoFileRequest(http_t     *http,    /* I - HTTP connection to server */
+                  ipp_t      *request, /* I - IPP request */
+                  const char *resource,        /* I - HTTP resource for POST */
+                 const char *filename) /* I - File to send or NULL for none */
+{
+  ipp_t                *response;              /* IPP response data */
+  size_t       length;                 /* Content-Length value */
+  http_status_t        status;                 /* Status of HTTP request */
+  FILE         *file;                  /* File to send */
+  struct stat  fileinfo;               /* File information */
+  int          bytes;                  /* Number of bytes read/written */
+  char         buffer[65536];          /* Output buffer */
+
+
+  DEBUG_printf(("cupsDoFileRequest(%p, %p, \'%s\', \'%s\')\n",
+                http, request, resource ? resource : "(null)",
+               filename ? filename : "(null)"));
+
+  if (http == NULL || request == NULL || resource == NULL)
+  {
+    if (request != NULL)
+      ippDelete(request);
+
+    _cupsSetError(IPP_INTERNAL_ERROR, NULL);
+
+    return (NULL);
+  }
+
+ /*
+  * See if we have a file to send...
+  */
+
+  if (filename != NULL)
+  {
+    if (stat(filename, &fileinfo))
+    {
+     /*
+      * Can't get file information!
+      */
+
+      _cupsSetError(errno == ENOENT ? IPP_NOT_FOUND : IPP_NOT_AUTHORIZED,
+                     strerror(errno));
+
+      ippDelete(request);
+
+      return (NULL);
+    }
+
+#ifdef WIN32
+    if (fileinfo.st_mode & _S_IFDIR)
+#else
+    if (S_ISDIR(fileinfo.st_mode))
+#endif /* WIN32 */
+    {
+     /*
+      * Can't send a directory...
+      */
+
+      ippDelete(request);
+
+      _cupsSetError(IPP_NOT_POSSIBLE, NULL);
+
+      return (NULL);
+    }
+
+    if ((file = fopen(filename, "rb")) == NULL)
+    {
+     /*
+      * Can't open file!
+      */
+
+      _cupsSetError(errno == ENOENT ? IPP_NOT_FOUND : IPP_NOT_AUTHORIZED,
+                     strerror(errno));
+
+      ippDelete(request);
+
+      return (NULL);
+    }
+  }
+  else
+    file = NULL;
+
+ /*
+  * Loop until we can send the request without authorization problems.
+  */
+
+  response = NULL;
+  status   = HTTP_ERROR;
+
+  while (response == NULL)
+  {
+    DEBUG_puts("cupsDoFileRequest: setup...");
+
+   /*
+    * Setup the HTTP variables needed...
+    */
+
+    length = ippLength(request);
+    if (filename)
+      length += fileinfo.st_size;
+
+    httpClearFields(http);
+    httpSetLength(http, length);
+    httpSetField(http, HTTP_FIELD_CONTENT_TYPE, "application/ipp");
+    httpSetField(http, HTTP_FIELD_AUTHORIZATION, http->authstring);
+
+    DEBUG_printf(("cupsDoFileRequest: authstring=\"%s\"\n", http->authstring));
+
+   /*
+    * Try the request...
+    */
+
+    DEBUG_puts("cupsDoFileRequest: post...");
+
+    if (httpPost(http, resource))
+    {
+      if (httpReconnect(http))
+      {
+        status = HTTP_ERROR;
+        break;
+      }
+      else
+        continue;
+    }
+
+   /*
+    * Send the IPP data and wait for the response...
+    */
+
+    DEBUG_puts("cupsDoFileRequest: ipp write...");
+
+    request->state = IPP_IDLE;
+    status         = HTTP_CONTINUE;
+
+    if (ippWrite(http, request) != IPP_ERROR)
+      if (filename != NULL)
+      {
+        DEBUG_puts("cupsDoFileRequest: file write...");
+
+       /*
+        * Send the file...
+        */
+
+        rewind(file);
+
+        while ((bytes = (int)fread(buffer, 1, sizeof(buffer), file)) > 0)
+       {
+         if (httpCheck(http))
+         {
+           if ((status = httpUpdate(http)) != HTTP_CONTINUE)
+             break;
+          }
+
+         if (httpWrite2(http, buffer, bytes) < bytes)
+            break;
+        }
+      }
+
+   /*
+    * Get the server's return status...
+    */
+
+    DEBUG_puts("cupsDoFileRequest: update...");
+
+    while (status == HTTP_CONTINUE)
+      status = httpUpdate(http);
+
+    DEBUG_printf(("cupsDoFileRequest: status = %d\n", status));
+
+    if (status == HTTP_UNAUTHORIZED)
+    {
+      DEBUG_puts("cupsDoFileRequest: unauthorized...");
+
+     /*
+      * Flush any error message...
+      */
+
+      httpFlush(http);
+
+     /*
+      * See if we can do authentication...
+      */
+
+      if (cupsDoAuthentication(http, "POST", resource))
+        break;
+
+      if (httpReconnect(http))
+      {
+        status = HTTP_ERROR;
+       break;
+      }
+
+      continue;
+    }
+    else if (status == HTTP_ERROR)
+    {
+#ifdef WIN32
+      if (http->error != WSAENETDOWN && http->error != WSAENETUNREACH)
+#else
+      if (http->error != ENETDOWN && http->error != ENETUNREACH)
+#endif /* WIN32 */
+        continue;
+      else
+        break;
+    }
+#ifdef HAVE_SSL
+    else if (status == HTTP_UPGRADE_REQUIRED)
+    {
+      /* Flush any error message... */
+      httpFlush(http);
+
+      /* Reconnect... */
+      if (httpReconnect(http))
+      {
+        status = HTTP_ERROR;
+        break;
+      }
+
+      /* Upgrade with encryption... */
+      httpEncryption(http, HTTP_ENCRYPT_REQUIRED);
+
+      /* Try again, this time with encryption enabled... */
+      continue;
+    }
+#endif /* HAVE_SSL */
+    else if (status != HTTP_OK)
+    {
+      DEBUG_printf(("cupsDoFileRequest: error %d...\n", status));
+
+     /*
+      * Flush any error message...
+      */
+
+      httpFlush(http);
+      break;
+    }
+    else
+    {
+     /*
+      * Read the response...
+      */
+
+      DEBUG_puts("cupsDoFileRequest: response...");
+
+      response = ippNew();
+
+      if (ippRead(http, response) == IPP_ERROR)
+      {
+       /*
+        * Delete the response...
+       */
+
+        DEBUG_puts("IPP read error!");
+       ippDelete(response);
+       response = NULL;
+
+        _cupsSetError(IPP_SERVICE_UNAVAILABLE, strerror(errno));
+
+       break;
+      }
+    }
+  }
+
+ /*
+  * Close the file if needed...
+  */
+
+  if (filename != NULL)
+    fclose(file);
+
+ /*
+  * Flush any remaining data...
+  */
+
+  httpFlush(http);
+
+ /*
+  * Delete the original request and return the response...
+  */
+  
+  ippDelete(request);
+
+  if (response)
+  {
+    ipp_attribute_t    *attr;          /* status-message attribute */
+
+
+    attr = ippFindAttribute(response, "status-message", IPP_TAG_TEXT);
+
+    _cupsSetError(response->request.status.status_code,
+                   attr ? attr->values[0].string.text :
+                      ippErrorString(response->request.status.status_code));
+  }
+  else if (status != HTTP_OK)
+  {
+    switch (status)
+    {
+      case HTTP_NOT_FOUND :
+          _cupsSetError(IPP_NOT_FOUND, httpStatus(status));
+         break;
+
+      case HTTP_UNAUTHORIZED :
+          _cupsSetError(IPP_NOT_AUTHORIZED, httpStatus(status));
+         break;
+
+      case HTTP_FORBIDDEN :
+          _cupsSetError(IPP_FORBIDDEN, httpStatus(status));
+         break;
+
+      case HTTP_BAD_REQUEST :
+          _cupsSetError(IPP_BAD_REQUEST, httpStatus(status));
+         break;
+
+      case HTTP_REQUEST_TOO_LARGE :
+          _cupsSetError(IPP_REQUEST_VALUE, httpStatus(status));
+         break;
+
+      case HTTP_NOT_IMPLEMENTED :
+          _cupsSetError(IPP_OPERATION_NOT_SUPPORTED, httpStatus(status));
+         break;
+
+      case HTTP_NOT_SUPPORTED :
+          _cupsSetError(IPP_VERSION_NOT_SUPPORTED, httpStatus(status));
+         break;
+
+      default :
+         DEBUG_printf(("HTTP error %d mapped to IPP_SERVICE_UNAVAILABLE!\n",
+                       status));
+         _cupsSetError(IPP_SERVICE_UNAVAILABLE, httpStatus(status));
+         break;
+    }
+  }
+
+  return (response);
+}
+
+
+/*
+ * 'cupsDoRequest()' - Do an IPP request.
+ *
+ * This function sends the IPP request to the specified server, retrying
+ * and authenticating as necessary.  The request is freed with ippDelete()
+ * after receiving a valid IPP response.
+ */
+
+ipp_t *                                        /* O - Response data */
+cupsDoRequest(http_t     *http,                /* I - HTTP connection to server */
+              ipp_t      *request,     /* I - IPP request */
+              const char *resource)    /* I - HTTP resource for POST */
+{
+  return (cupsDoFileRequest(http, request, resource, NULL));
+}
+
+
+/*
+ * '_cupsSetError()' - Set the last IPP status code and status-message.
+ */
+
+void
+_cupsSetError(ipp_status_t status,     /* I - IPP status code */
+               const char   *message)  /* I - status-message value */
+{
+  _cups_globals_t      *cg;            /* Global data */
+
+
+  cg             = _cupsGlobals();
+  cg->last_error = status;
+
+  if (cg->last_status_message)
+  {
+    free(cg->last_status_message);
+
+    cg->last_status_message = NULL;
+  }
+
+  if (message)
+    cg->last_status_message = strdup(message);
+}
+
+
+/*
+ * End of "$Id: request.c 5139 2006-02-21 12:56:27Z mike $".
+ */
index cb25863f34f32acfdc12aad34d9210820b87ddf8..2dbcbdd447a88c488b70113d64a079be9a24ecca 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: usersys.c 5041 2006-02-01 16:54:50Z mike $"
+ * "$Id: usersys.c 5138 2006-02-21 10:49:06Z mike $"
  *
  *   User, system, and password routines for the Common UNIX Printing
  *   System (CUPS).
@@ -147,7 +147,8 @@ cupsEncryption(void)
 /*
  * 'cupsGetPassword()' - Get a password from the user.
  *
- * Returns NULL if the user does not provide a password.
+ * Uses the current password callback function. Returns NULL if the
+ * user does not provide a password.
  */
 
 const char *                           /* O - Password */
@@ -469,5 +470,5 @@ _cupsGetPassword(const char *prompt)        /* I - Prompt string */
 
 
 /*
- * End of "$Id: usersys.c 5041 2006-02-01 16:54:50Z mike $".
+ * End of "$Id: usersys.c 5138 2006-02-21 10:49:06Z mike $".
  */
index 2ab77291050a98585961752de6f84ccb5ba71473..25565073798a00ec17241d4c00ddf312bead2839 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: util.c 5064 2006-02-03 16:51:05Z mike $"
+ * "$Id: util.c 5138 2006-02-21 10:49:06Z mike $"
  *
  *   Printing utilities for the Common UNIX Printing System (CUPS).
  *
@@ -26,7 +26,6 @@
  * Contents:
  *
  *   cupsCancelJob()        - Cancel a print job on the default server.
- *   cupsDoFileRequest()    - Do an IPP request.
  *   cupsFreeJobs()         - Free memory used by job data.
  *   cupsGetClasses()       - Get a list of printer classes from the default
  *                            server.
@@ -54,7 +53,6 @@
  *   cups_connect()         - Connect to the specified host...
  *   cups_get_printer_uri() - Get the printer-uri-supported attribute for the
  *                            first printer in a class.
- *   cups_set_error()       - Set the last IPP status code and status-message.
  */
 
 /*
@@ -83,7 +81,6 @@ static int    cups_get_printer_uri(http_t *http, const char *name,
                                     char *host, int hostsize, int *port,
                                     char *resource, int resourcesize,
                                     int depth);
-static void    cups_set_error(ipp_status_t status, const char *message);
 
 
 /*
@@ -124,7 +121,7 @@ cupsCancelJob(const char *name,             /* I - Name of printer or class */
   if (httpAssembleURIf(HTTP_URI_CODING_ALL, uri, sizeof(uri), "ipp", NULL,
                        "localhost", 0, "/printers/%s", printer) != HTTP_URI_OK)
   {
-    cups_set_error(IPP_INTERNAL_ERROR, NULL);
+    _cupsSetError(IPP_INTERNAL_ERROR, NULL);
 
     return (0);
   }
@@ -175,351 +172,6 @@ cupsCancelJob(const char *name,           /* I - Name of printer or class */
 }
 
 
-/*
- * 'cupsDoFileRequest()' - Do an IPP request.
- *
- * This function sends any IPP request to the specified server, retrying
- * and authenticating as necessary.
- */
-
-ipp_t *                                        /* O - Response data */
-cupsDoFileRequest(http_t     *http,    /* I - HTTP connection to server */
-                  ipp_t      *request, /* I - IPP request */
-                  const char *resource,        /* I - HTTP resource for POST */
-                 const char *filename) /* I - File to send or NULL for none */
-{
-  ipp_t                *response;              /* IPP response data */
-  size_t       length;                 /* Content-Length value */
-  http_status_t        status;                 /* Status of HTTP request */
-  FILE         *file;                  /* File to send */
-  struct stat  fileinfo;               /* File information */
-  int          bytes;                  /* Number of bytes read/written */
-  char         buffer[65536];          /* Output buffer */
-
-
-  DEBUG_printf(("cupsDoFileRequest(%p, %p, \'%s\', \'%s\')\n",
-                http, request, resource ? resource : "(null)",
-               filename ? filename : "(null)"));
-
-  if (http == NULL || request == NULL || resource == NULL)
-  {
-    if (request != NULL)
-      ippDelete(request);
-
-    cups_set_error(IPP_INTERNAL_ERROR, NULL);
-
-    return (NULL);
-  }
-
- /*
-  * See if we have a file to send...
-  */
-
-  if (filename != NULL)
-  {
-    if (stat(filename, &fileinfo))
-    {
-     /*
-      * Can't get file information!
-      */
-
-      cups_set_error(errno == ENOENT ? IPP_NOT_FOUND : IPP_NOT_AUTHORIZED,
-                     strerror(errno));
-
-      ippDelete(request);
-
-      return (NULL);
-    }
-
-#ifdef WIN32
-    if (fileinfo.st_mode & _S_IFDIR)
-#else
-    if (S_ISDIR(fileinfo.st_mode))
-#endif /* WIN32 */
-    {
-     /*
-      * Can't send a directory...
-      */
-
-      ippDelete(request);
-
-      cups_set_error(IPP_NOT_POSSIBLE, NULL);
-
-      return (NULL);
-    }
-
-    if ((file = fopen(filename, "rb")) == NULL)
-    {
-     /*
-      * Can't open file!
-      */
-
-      cups_set_error(errno == ENOENT ? IPP_NOT_FOUND : IPP_NOT_AUTHORIZED,
-                     strerror(errno));
-
-      ippDelete(request);
-
-      return (NULL);
-    }
-  }
-  else
-    file = NULL;
-
- /*
-  * Loop until we can send the request without authorization problems.
-  */
-
-  response = NULL;
-  status   = HTTP_ERROR;
-
-  while (response == NULL)
-  {
-    DEBUG_puts("cupsDoFileRequest: setup...");
-
-   /*
-    * Setup the HTTP variables needed...
-    */
-
-    length = ippLength(request);
-    if (filename)
-      length += fileinfo.st_size;
-
-    httpClearFields(http);
-    httpSetLength(http, length);
-    httpSetField(http, HTTP_FIELD_CONTENT_TYPE, "application/ipp");
-    httpSetField(http, HTTP_FIELD_AUTHORIZATION, http->authstring);
-
-    DEBUG_printf(("cupsDoFileRequest: authstring=\"%s\"\n", http->authstring));
-
-   /*
-    * Try the request...
-    */
-
-    DEBUG_puts("cupsDoFileRequest: post...");
-
-    if (httpPost(http, resource))
-    {
-      if (httpReconnect(http))
-      {
-        status = HTTP_ERROR;
-        break;
-      }
-      else
-        continue;
-    }
-
-   /*
-    * Send the IPP data and wait for the response...
-    */
-
-    DEBUG_puts("cupsDoFileRequest: ipp write...");
-
-    request->state = IPP_IDLE;
-    status         = HTTP_CONTINUE;
-
-    if (ippWrite(http, request) != IPP_ERROR)
-      if (filename != NULL)
-      {
-        DEBUG_puts("cupsDoFileRequest: file write...");
-
-       /*
-        * Send the file...
-        */
-
-        rewind(file);
-
-        while ((bytes = (int)fread(buffer, 1, sizeof(buffer), file)) > 0)
-       {
-         if (httpCheck(http))
-         {
-           if ((status = httpUpdate(http)) != HTTP_CONTINUE)
-             break;
-          }
-
-         if (httpWrite2(http, buffer, bytes) < bytes)
-            break;
-        }
-      }
-
-   /*
-    * Get the server's return status...
-    */
-
-    DEBUG_puts("cupsDoFileRequest: update...");
-
-    while (status == HTTP_CONTINUE)
-      status = httpUpdate(http);
-
-    DEBUG_printf(("cupsDoFileRequest: status = %d\n", status));
-
-    if (status == HTTP_UNAUTHORIZED)
-    {
-      DEBUG_puts("cupsDoFileRequest: unauthorized...");
-
-     /*
-      * Flush any error message...
-      */
-
-      httpFlush(http);
-
-     /*
-      * See if we can do authentication...
-      */
-
-      if (cupsDoAuthentication(http, "POST", resource))
-        break;
-
-      if (httpReconnect(http))
-      {
-        status = HTTP_ERROR;
-       break;
-      }
-
-      continue;
-    }
-    else if (status == HTTP_ERROR)
-    {
-#ifdef WIN32
-      if (http->error != WSAENETDOWN && http->error != WSAENETUNREACH)
-#else
-      if (http->error != ENETDOWN && http->error != ENETUNREACH)
-#endif /* WIN32 */
-        continue;
-      else
-        break;
-    }
-#ifdef HAVE_SSL
-    else if (status == HTTP_UPGRADE_REQUIRED)
-    {
-      /* Flush any error message... */
-      httpFlush(http);
-
-      /* Reconnect... */
-      if (httpReconnect(http))
-      {
-        status = HTTP_ERROR;
-        break;
-      }
-
-      /* Upgrade with encryption... */
-      httpEncryption(http, HTTP_ENCRYPT_REQUIRED);
-
-      /* Try again, this time with encryption enabled... */
-      continue;
-    }
-#endif /* HAVE_SSL */
-    else if (status != HTTP_OK)
-    {
-      DEBUG_printf(("cupsDoFileRequest: error %d...\n", status));
-
-     /*
-      * Flush any error message...
-      */
-
-      httpFlush(http);
-      break;
-    }
-    else
-    {
-     /*
-      * Read the response...
-      */
-
-      DEBUG_puts("cupsDoFileRequest: response...");
-
-      response = ippNew();
-
-      if (ippRead(http, response) == IPP_ERROR)
-      {
-       /*
-        * Delete the response...
-       */
-
-        DEBUG_puts("IPP read error!");
-       ippDelete(response);
-       response = NULL;
-
-        cups_set_error(IPP_SERVICE_UNAVAILABLE, strerror(errno));
-
-       break;
-      }
-    }
-  }
-
- /*
-  * Close the file if needed...
-  */
-
-  if (filename != NULL)
-    fclose(file);
-
- /*
-  * Flush any remaining data...
-  */
-
-  httpFlush(http);
-
- /*
-  * Delete the original request and return the response...
-  */
-  
-  ippDelete(request);
-
-  if (response)
-  {
-    ipp_attribute_t    *attr;          /* status-message attribute */
-
-
-    attr = ippFindAttribute(response, "status-message", IPP_TAG_TEXT);
-
-    cups_set_error(response->request.status.status_code,
-                   attr ? attr->values[0].string.text :
-                      ippErrorString(response->request.status.status_code));
-  }
-  else if (status != HTTP_OK)
-  {
-    switch (status)
-    {
-      case HTTP_NOT_FOUND :
-          cups_set_error(IPP_NOT_FOUND, httpStatus(status));
-         break;
-
-      case HTTP_UNAUTHORIZED :
-          cups_set_error(IPP_NOT_AUTHORIZED, httpStatus(status));
-         break;
-
-      case HTTP_FORBIDDEN :
-          cups_set_error(IPP_FORBIDDEN, httpStatus(status));
-         break;
-
-      case HTTP_BAD_REQUEST :
-          cups_set_error(IPP_BAD_REQUEST, httpStatus(status));
-         break;
-
-      case HTTP_REQUEST_TOO_LARGE :
-          cups_set_error(IPP_REQUEST_VALUE, httpStatus(status));
-         break;
-
-      case HTTP_NOT_IMPLEMENTED :
-          cups_set_error(IPP_OPERATION_NOT_SUPPORTED, httpStatus(status));
-         break;
-
-      case HTTP_NOT_SUPPORTED :
-          cups_set_error(IPP_VERSION_NOT_SUPPORTED, httpStatus(status));
-         break;
-
-      default :
-         DEBUG_printf(("HTTP error %d mapped to IPP_SERVICE_UNAVAILABLE!\n",
-                       status));
-         cups_set_error(IPP_SERVICE_UNAVAILABLE, httpStatus(status));
-         break;
-    }
-  }
-
-  return (response);
-}
-
-
 /*
  * 'cupsFreeJobs()' - Free memory used by job data.
  */
@@ -568,7 +220,7 @@ cupsGetClasses(char ***classes)             /* O - Classes */
 
   if (classes == NULL)
   {
-    cups_set_error(IPP_INTERNAL_ERROR, NULL);
+    _cupsSetError(IPP_INTERNAL_ERROR, NULL);
 
     return (0);
   }
@@ -800,9 +452,11 @@ cupsGetDefault2(http_t *http)              /* I - HTTP connection */
 
 int                                    /* O - Number of jobs */
 cupsGetJobs(cups_job_t **jobs,         /* O - Job data */
-            const char *mydest,                /* I - Only show jobs for dest? */
-            int        myjobs,         /* I - Only show my jobs? */
-           int        completed)       /* I - Only show completed jobs? */
+            const char *mydest,                /* I - NULL = all destinations,       *
+                                        *     otherwise show jobs for mydest */
+            int        myjobs,         /* I - 0 = all users, 1 = mine */
+           int        completed)       /* I - -1 = show all, 0 = active, *
+                                        *     1 = completed jobs         */
 {
   _cups_globals_t *cg = _cupsGlobals();        /* Pointer to library globals */
 
@@ -835,9 +489,11 @@ cupsGetJobs(cups_job_t **jobs,             /* O - Job data */
 int                                    /* O - Number of jobs */
 cupsGetJobs2(http_t     *http,         /* I - HTTP connection */
              cups_job_t **jobs,                /* O - Job data */
-             const char *mydest,       /* I - Only show jobs for dest? */
-             int        myjobs,                /* I - Only show my jobs? */
-            int        completed)      /* I - Only show completed jobs? */
+             const char *mydest,       /* I - NULL = all destinations,       *
+                                        *     otherwise show jobs for mydest */
+             int        myjobs,                /* I - 0 = all users, 1 = mine */
+            int        completed)      /* I - -1 = show all, 0 = active, *
+                                        *     1 = completed jobs         */
 {
   int          n;                      /* Number of jobs */
   ipp_t                *request,               /* IPP Request */
@@ -880,7 +536,7 @@ cupsGetJobs2(http_t     *http,              /* I - HTTP connection */
 
   if (!http || !jobs)
   {
-    cups_set_error(IPP_INTERNAL_ERROR, NULL);
+    _cupsSetError(IPP_INTERNAL_ERROR, NULL);
 
     return (-1);
   }
@@ -894,7 +550,7 @@ cupsGetJobs2(http_t     *http,              /* I - HTTP connection */
     if (httpAssembleURIf(HTTP_URI_CODING_ALL, uri, sizeof(uri), "ipp", NULL,
                          "localhost", 0, "/printers/%s", mydest) != HTTP_URI_OK)
     {
-      cups_set_error(IPP_INTERNAL_ERROR, NULL);
+      _cupsSetError(IPP_INTERNAL_ERROR, NULL);
 
       return (-1);
     }
@@ -940,9 +596,12 @@ cupsGetJobs2(http_t     *http,             /* I - HTTP connection */
   if (myjobs)
     ippAddBoolean(request, IPP_TAG_OPERATION, "my-jobs", 1);
 
-  if (completed)
+  if (completed > 0)
     ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD,
                  "which-jobs", NULL, "completed");
+  else if (completed < 0)
+    ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD,
+                 "which-jobs", NULL, "all");
 
   ippAddStrings(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD,
                 "requested-attributes", sizeof(attrs) / sizeof(attrs[0]),
@@ -1160,7 +819,7 @@ cupsGetPPD2(http_t     *http,              /* I - HTTP connection */
 
   if (!http || !name)
   {
-    cups_set_error(IPP_INTERNAL_ERROR, NULL);
+    _cupsSetError(IPP_INTERNAL_ERROR, NULL);
 
     return (NULL);
   }
@@ -1220,7 +879,7 @@ cupsGetPPD2(http_t     *http,              /* I - HTTP connection */
     * Can't open file; close the server connection and return NULL...
     */
 
-    cups_set_error(IPP_INTERNAL_ERROR, strerror(errno));
+    _cupsSetError(IPP_INTERNAL_ERROR, strerror(errno));
 
     if (http2 != http)
       httpClose(http2);
@@ -1250,17 +909,17 @@ cupsGetPPD2(http_t     *http,            /* I - HTTP connection */
     switch (status)
     {
       case HTTP_NOT_FOUND :
-          cups_set_error(IPP_NOT_FOUND, httpStatus(status));
+          _cupsSetError(IPP_NOT_FOUND, httpStatus(status));
          break;
 
       case HTTP_UNAUTHORIZED :
-          cups_set_error(IPP_NOT_AUTHORIZED, httpStatus(status));
+          _cupsSetError(IPP_NOT_AUTHORIZED, httpStatus(status));
          break;
 
       default :
          DEBUG_printf(("HTTP error %d mapped to IPP_SERVICE_UNAVAILABLE!\n",
                        status));
-         cups_set_error(IPP_SERVICE_UNAVAILABLE, httpStatus(status));
+         _cupsSetError(IPP_SERVICE_UNAVAILABLE, httpStatus(status));
          break;
     }
 
@@ -1299,7 +958,7 @@ cupsGetPrinters(char ***printers)  /* O - Printers */
 
   if (printers == NULL)
   {
-    cups_set_error(IPP_INTERNAL_ERROR, NULL);
+    _cupsSetError(IPP_INTERNAL_ERROR, NULL);
 
     return (0);
   }
@@ -1544,7 +1203,7 @@ cupsPrintFiles2(http_t        *http,      /* I - HTTP connection */
 
   if (!http || !name || num_files < 1 || files == NULL)
   {
-    cups_set_error(IPP_INTERNAL_ERROR, NULL);
+    _cupsSetError(IPP_INTERNAL_ERROR, NULL);
 
     return (0);
   }
@@ -1556,7 +1215,7 @@ cupsPrintFiles2(http_t        *http,      /* I - HTTP connection */
   if (httpAssembleURIf(HTTP_URI_CODING_ALL, uri, sizeof(uri), "ipp", NULL,
                        "localhost", 0, "/printers/%s", name) != HTTP_URI_OK)
   {
-    cups_set_error(IPP_INTERNAL_ERROR, NULL);
+    _cupsSetError(IPP_INTERNAL_ERROR, NULL);
 
     return (0);
   }
@@ -1574,7 +1233,7 @@ cupsPrintFiles2(http_t        *http,      /* I - HTTP connection */
 
   if ((request = ippNew()) == NULL)
   {
-    cups_set_error(IPP_INTERNAL_ERROR, NULL);
+    _cupsSetError(IPP_INTERNAL_ERROR, NULL);
 
     return (0);
   }
@@ -1629,7 +1288,7 @@ cupsPrintFiles2(http_t        *http,      /* I - HTTP connection */
   {
     DEBUG_puts("No job ID!");
 
-    cups_set_error(IPP_INTERNAL_ERROR, NULL);
+    _cupsSetError(IPP_INTERNAL_ERROR, NULL);
 
     jobid = 0;
   }
@@ -1740,7 +1399,7 @@ cups_connect(const char *name,            /* I - Destination (printer[@host]) */
 
   if (name == NULL)
   {
-    cups_set_error(IPP_BAD_REQUEST, NULL);
+    _cupsSetError(IPP_BAD_REQUEST, NULL);
 
     return (NULL);
   }
@@ -1778,7 +1437,7 @@ cups_connect(const char *name,            /* I - Destination (printer[@host]) */
   {
     DEBUG_puts("Unable to connect to server!");
 
-    cups_set_error(IPP_SERVICE_UNAVAILABLE, strerror(errno));
+    _cupsSetError(IPP_SERVICE_UNAVAILABLE, strerror(errno));
 
     return (NULL);
   }
@@ -1832,7 +1491,7 @@ cups_get_printer_uri(
   if (httpAssembleURIf(HTTP_URI_CODING_ALL, uri, sizeof(uri), "ipp", NULL,
                        "localhost", 0, "/printers/%s", name) != HTTP_URI_OK)
   {
-    cups_set_error(IPP_INTERNAL_ERROR, NULL);
+    _cupsSetError(IPP_INTERNAL_ERROR, NULL);
 
     *host     = '\0';
     *resource = '\0';
@@ -1977,31 +1636,5 @@ cups_get_printer_uri(
 
 
 /*
- * 'cups_set_error()' - Set the last IPP status code and status-message.
- */
-
-static void
-cups_set_error(ipp_status_t status,    /* I - IPP status code */
-               const char   *message)  /* I - status-message value */
-{
-  _cups_globals_t      *cg;            /* Global data */
-
-
-  cg             = _cupsGlobals();
-  cg->last_error = status;
-
-  if (cg->last_status_message)
-  {
-    free(cg->last_status_message);
-
-    cg->last_status_message = NULL;
-  }
-
-  if (message)
-    cg->last_status_message = strdup(message);
-}
-
-
-/*
- * End of "$Id: util.c 5064 2006-02-03 16:51:05Z mike $".
+ * End of "$Id: util.c 5138 2006-02-21 10:49:06Z mike $".
  */
index 8ffb8e7d1ba3c79b6d7abafc2940201e0546a5a9..329c1f5b0520a2591cf934ceb55316c30678ed77 100644 (file)
@@ -15,15 +15,15 @@ KBD {
 }
 
 PRE {
-  color: #7f0000;
   font-family: monospace;
 }
 
 PRE.command {
+  color: #7f0000;
   margin-left: 36pt;
 }
 
-PRE EM {
+PRE.command EM {
   color: #3f0000;
 }
 
index 85b22235e2836fbc804c589afe37b64b48f831d5..a9e4ca979accfda683982bc703209dbf21d333bf 100644 (file)
@@ -20,7 +20,7 @@
 
   Array API introduction for the Common UNIX Printing System (CUPS).
 
-  Copyright 1997-2005 by Easy Software Products.
+  Copyright 1997-2006 by Easy Software Products.
 
   These coded instructions, statements, and computer programs are the
   property of Easy Software Products and are protected by Federal
@@ -85,6 +85,8 @@ library:</p>
        <li><a href='#cupsArrayDup'><tt>cupsArrayDup()</tt></a> </li>
        <li><a href='#cupsArrayFind'><tt>cupsArrayFind()</tt></a> </li>
        <li><a href='#cupsArrayFirst'><tt>cupsArrayFirst()</tt></a> </li>
+       <li><a href='#cupsArrayIndex'><tt>cupsArrayIndex()</tt></a> </li>
+       <li><a href='#cupsArrayInsert'><tt>cupsArrayInsert()</tt></a> </li>
        <li><a href='#cupsArrayLast'><tt>cupsArrayLast()</tt></a> </li>
        <li><a href='#cupsArrayNew'><tt>cupsArrayNew()</tt></a> </li>
        <li><a href='#cupsArrayNext'><tt>cupsArrayNext()</tt></a> </li>
@@ -96,7 +98,11 @@ library:</p>
 <!-- NEW PAGE -->
 <h3 class='title'><a name='cupsArrayAdd'>cupsArrayAdd()</a></h3>
 <h4>Description</h4>
-<p>Add an element to the array.</p>
+<p>Add an element to the array.
+
+When adding an element to a sorted array, non-unique elements are
+appended at the end of the run.  For unsorted arrays, the element
+is inserted at the end of the array.</p>
 <h4>Syntax</h4>
 <pre>
 int
@@ -242,6 +248,50 @@ cupsArrayFirst(
 <h4>Returns</h4>
 <p>First element or NULL</p>
 <!-- NEW PAGE -->
+<h3 class='title'><a name='cupsArrayIndex'>cupsArrayIndex()</a></h3>
+<h4>Description</h4>
+<p>Get the N-th element in the array.</p>
+<h4>Syntax</h4>
+<pre>
+void *
+cupsArrayIndex(
+    <a href='#cups_array_t'>cups_array_t</a> * a,
+    int n);
+</pre>
+<h4>Arguments</h4>
+<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
+<thead><tr><th>Name</th><th>Description</th></tr></thead>
+<tbody>
+<tr><td><tt>a</tt></td><td>Array</td></tr>
+<tr><td><tt>n</tt></td><td>Index into array, starting at 0</td></tr>
+</tbody></table></div>
+<h4>Returns</h4>
+<p>N-th element or NULL</p>
+<!-- NEW PAGE -->
+<h3 class='title'><a name='cupsArrayInsert'>cupsArrayInsert()</a></h3>
+<h4>Description</h4>
+<p>Insert an element in the array.
+
+When inserting an element in a sorted array, non-unique elements are
+inserted at the beginning of the run.  For unsorted arrays, the element
+is inserted at the beginning of the array.</p>
+<h4>Syntax</h4>
+<pre>
+int
+cupsArrayInsert(
+    <a href='#cups_array_t'>cups_array_t</a> * a,
+    void * e);
+</pre>
+<h4>Arguments</h4>
+<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
+<thead><tr><th>Name</th><th>Description</th></tr></thead>
+<tbody>
+<tr><td><tt>a</tt></td><td>Array</td></tr>
+<tr><td><tt>e</tt></td><td>Element</td></tr>
+</tbody></table></div>
+<h4>Returns</h4>
+<p>0 on failure, 1 on success</p>
+<!-- NEW PAGE -->
 <h3 class='title'><a name='cupsArrayLast'>cupsArrayLast()</a></h3>
 <h4>Description</h4>
 <p>Get the last element in the array.</p>
index 9d084f21987c4fc06efdd7f3facfb8c6323c8a52..4e829066ed34cb41453f4d2847e6f3c2c92ff6b6 100644 (file)
 
 <h2 class='title'>Introduction</h2>
 
-<p>The CUPS APIs provide...</p>
+<p>The CUPS library provides a whole collection of interfaces
+needed to support the internal needs of the CUPS software as well
+as the needs of applications, filters, printer drivers, and
+backends.</p>
+
+<p>Unlike the rest of CUPS, the CUPS API library is provided
+under the GNU Library General Public License. This means that you
+can use the CUPS API library in both proprietary and open-source
+programs.</p>
 
 <h2 class='title'>General Usage</h2>
 
@@ -115,10 +123,6 @@ CUPS 1.1 or higher.</p>
        <li><a href='#cupsAddDest'><tt>cupsAddDest()</tt></a> </li>
        <li><a href='#cupsAddOption'><tt>cupsAddOption()</tt></a> </li>
        <li><a href='#cupsCancelJob'><tt>cupsCancelJob()</tt></a> </li>
-       <li><a href='#cupsDoAuthentication'><tt>cupsDoAuthentication()</tt></a> <span class='info'>&nbsp;CUPS 1.1.20&nbsp;</span></li>
-       <li><a href='#cupsDoFileRequest'><tt>cupsDoFileRequest()</tt></a> </li>
-       <li><a href='#cupsEncodeOptions'><tt>cupsEncodeOptions()</tt></a> </li>
-       <li><a href='#cupsEncodeOptions2'><tt>cupsEncodeOptions2()</tt></a> <span class='info'>&nbsp;CUPS 1.2&nbsp;</span></li>
        <li><a href='#cupsEncryption'><tt>cupsEncryption()</tt></a> </li>
        <li><a href='#cupsFreeDests'><tt>cupsFreeDests()</tt></a> </li>
        <li><a href='#cupsFreeJobs'><tt>cupsFreeJobs()</tt></a> </li>
@@ -176,8 +180,8 @@ to the user's lpoptions file.</p>
 <pre>
 int
 cupsAddDest(
-    const <a href='#char'>char</a> * name,
-    const <a href='#char'>char</a> * instance,
+    const char * name,
+    const char * instance,
     int num_dests,
     <a href='#cups_dest_t'>cups_dest_t</a> ** dests);
 </pre>
@@ -200,8 +204,8 @@ cupsAddDest(
 <pre>
 int
 cupsAddOption(
-    const <a href='#char'>char</a> * name,
-    const <a href='#char'>char</a> * value,
+    const char * name,
+    const char * value,
     int num_options,
     <a href='#cups_option_t'>cups_option_t</a> ** options);
 </pre>
@@ -227,7 +231,7 @@ the cause of any failure.</p>
 <pre>
 int
 cupsCancelJob(
-    const <a href='#char'>char</a> * name,
+    const char * name,
     int job);
 </pre>
 <h4>Arguments</h4>
@@ -240,116 +244,6 @@ cupsCancelJob(
 <h4>Returns</h4>
 <p>1 on success, 0 on failure</p>
 <!-- NEW PAGE -->
-<h3 class='title'><span class='info'>&nbsp;CUPS 1.1.20&nbsp;</span><a name='cupsDoAuthentication'>cupsDoAuthentication()</a></h3>
-<h4>Description</h4>
-<p>Authenticate a request.
-
-This function should be called in response to a HTTP_UNAUTHORIZED
-status, prior to resubmitting your request.
-
-</p>
-<h4>Syntax</h4>
-<pre>
-int
-cupsDoAuthentication(
-    http_t * http,
-    const <a href='#char'>char</a> * method,
-    const <a href='#char'>char</a> * resource);
-</pre>
-<h4>Arguments</h4>
-<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
-<thead><tr><th>Name</th><th>Description</th></tr></thead>
-<tbody>
-<tr><td><tt>http</tt></td><td>HTTP connection to server</td></tr>
-<tr><td><tt>method</tt></td><td>Request method (GET, POST, PUT)</td></tr>
-<tr><td><tt>resource</tt></td><td>Resource path</td></tr>
-</tbody></table></div>
-<h4>Returns</h4>
-<p>0 on success, -1 on error</p>
-<!-- NEW PAGE -->
-<h3 class='title'><a name='cupsDoFileRequest'>cupsDoFileRequest()</a></h3>
-<h4>Description</h4>
-<p>Do an IPP request.
-
-This function sends any IPP request to the specified server, retrying
-and authenticating as necessary.</p>
-<h4>Syntax</h4>
-<pre>
-ipp_t *
-cupsDoFileRequest(
-    http_t * http,
-    ipp_t * request,
-    const <a href='#char'>char</a> * resource,
-    const <a href='#char'>char</a> * filename);
-</pre>
-<h4>Arguments</h4>
-<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
-<thead><tr><th>Name</th><th>Description</th></tr></thead>
-<tbody>
-<tr><td><tt>http</tt></td><td>HTTP connection to server</td></tr>
-<tr><td><tt>request</tt></td><td>IPP request</td></tr>
-<tr><td><tt>resource</tt></td><td>HTTP resource for POST</td></tr>
-<tr><td><tt>filename</tt></td><td>File to send or NULL for none</td></tr>
-</tbody></table></div>
-<h4>Returns</h4>
-<p>Response data</p>
-<!-- NEW PAGE -->
-<h3 class='title'><a name='cupsEncodeOptions'>cupsEncodeOptions()</a></h3>
-<h4>Description</h4>
-<p>Encode printer options into IPP attributes.
-
-This function adds operation, job, and then subscription attributes,
-in that order. Use the cupsEncodeOptions2() function to add attributes
-for a single group.</p>
-<h4>Syntax</h4>
-<pre>
-void
-cupsEncodeOptions(
-    ipp_t * ipp,
-    int num_options,
-    <a href='#cups_option_t'>cups_option_t</a> * options);
-</pre>
-<h4>Arguments</h4>
-<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
-<thead><tr><th>Name</th><th>Description</th></tr></thead>
-<tbody>
-<tr><td><tt>ipp</tt></td><td>Request to add to</td></tr>
-<tr><td><tt>num_options</tt></td><td>Number of options</td></tr>
-<tr><td><tt>options</tt></td><td>Options</td></tr>
-</tbody></table></div>
-<h4>Returns</h4>
-<p>Nothing.</p>
-<!-- NEW PAGE -->
-<h3 class='title'><span class='info'>&nbsp;CUPS 1.2&nbsp;</span><a name='cupsEncodeOptions2'>cupsEncodeOptions2()</a></h3>
-<h4>Description</h4>
-<p>Encode printer options into IPP attributes for a group.
-
-This function only adds attributes for a single group. Call this
-function multiple times for each group, or use cupsEncodeOptions()
-to add the standard groups.
-
-</p>
-<h4>Syntax</h4>
-<pre>
-void
-cupsEncodeOptions2(
-    ipp_t * ipp,
-    int num_options,
-    <a href='#cups_option_t'>cups_option_t</a> * options,
-    ipp_tag_t group_tag);
-</pre>
-<h4>Arguments</h4>
-<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
-<thead><tr><th>Name</th><th>Description</th></tr></thead>
-<tbody>
-<tr><td><tt>ipp</tt></td><td>Request to add to</td></tr>
-<tr><td><tt>num_options</tt></td><td>Number of options</td></tr>
-<tr><td><tt>options</tt></td><td>Options</td></tr>
-<tr><td><tt>group_tag</tt></td><td>Group to encode</td></tr>
-</tbody></table></div>
-<h4>Returns</h4>
-<p>Nothing.</p>
-<!-- NEW PAGE -->
 <h3 class='title'><a name='cupsEncryption'>cupsEncryption()</a></h3>
 <h4>Description</h4>
 <p>Get the default encryption settings.
@@ -439,7 +333,7 @@ This function is deprecated - use cupsGetDests() instead.
 <pre>
 int
 cupsGetClasses(
-    <a href='#char'>char</a> *** classes);
+    char *** classes);
 </pre>
 <h4>Arguments</h4>
 <div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
@@ -462,7 +356,7 @@ to get the user-defined default printer, as this function does not
 support the lpoptions-defined default printer.</p>
 <h4>Syntax</h4>
 <pre>
-const <a href='#char'>char</a> *
+const char *
 cupsGetDefault(void);
 </pre>
 <h4>Arguments</h4>
@@ -484,7 +378,7 @@ support the lpoptions-defined default printer.
 </p>
 <h4>Syntax</h4>
 <pre>
-const <a href='#char'>char</a> *
+const char *
 cupsGetDefault2(
     http_t * http);
 </pre>
@@ -507,8 +401,8 @@ list of supported destinations for the current user.</p>
 <pre>
 <a href='#cups_dest_t'>cups_dest_t</a> *
 cupsGetDest(
-    const <a href='#char'>char</a> * name,
-    const <a href='#char'>char</a> * instance,
+    const char * name,
+    const char * instance,
     int num_dests,
     <a href='#cups_dest_t'>cups_dest_t</a> * dests);
 </pre>
@@ -526,7 +420,12 @@ cupsGetDest(
 <!-- NEW PAGE -->
 <h3 class='title'><a name='cupsGetDests'>cupsGetDests()</a></h3>
 <h4>Description</h4>
-<p>Get the list of destinations from the default server.</p>
+<p>Get the list of destinations from the default server.
+
+Starting with CUPS 1.2, the returned list of destinations include the
+printer-info, printer-is-accepting-jobs, printer-is-shared,
+printer-make-and-model, printer-state, printer-state-change-time,
+printer-state-reasons, and printer-type attributes as options.</p>
 <h4>Syntax</h4>
 <pre>
 int
@@ -546,6 +445,11 @@ cupsGetDests(
 <h4>Description</h4>
 <p>Get the list of destinations from the specified server.
 
+Starting with CUPS 1.2, the returned list of destinations include the
+printer-info, printer-is-accepting-jobs, printer-is-shared,
+printer-make-and-model, printer-state, printer-state-change-time,
+printer-state-reasons, and printer-type attributes as options.
+
 </p>
 <h4>Syntax</h4>
 <pre>
@@ -576,7 +480,7 @@ This function returns HTTP_OK when the file is successfully retrieved.
 http_status_t
 cupsGetFd(
     http_t * http,
-    const <a href='#char'>char</a> * resource,
+    const char * resource,
     int fd);
 </pre>
 <h4>Arguments</h4>
@@ -588,7 +492,7 @@ cupsGetFd(
 <tr><td><tt>fd</tt></td><td>File descriptor</td></tr>
 </tbody></table></div>
 <h4>Returns</h4>
-<p>Status</p>
+<p>HTTP status</p>
 <!-- NEW PAGE -->
 <h3 class='title'><span class='info'>&nbsp;CUPS 1.1.20&nbsp;</span><a name='cupsGetFile'>cupsGetFile()</a></h3>
 <h4>Description</h4>
@@ -602,8 +506,8 @@ This function returns HTTP_OK when the file is successfully retrieved.
 http_status_t
 cupsGetFile(
     http_t * http,
-    const <a href='#char'>char</a> * resource,
-    const <a href='#char'>char</a> * filename);
+    const char * resource,
+    const char * filename);
 </pre>
 <h4>Arguments</h4>
 <div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
@@ -614,7 +518,7 @@ cupsGetFile(
 <tr><td><tt>filename</tt></td><td>Filename</td></tr>
 </tbody></table></div>
 <h4>Returns</h4>
-<p>Status</p>
+<p>HTTP status</p>
 <!-- NEW PAGE -->
 <h3 class='title'><a name='cupsGetJobs'>cupsGetJobs()</a></h3>
 <h4>Description</h4>
@@ -624,7 +528,7 @@ cupsGetFile(
 int
 cupsGetJobs(
     <a href='#cups_job_t'>cups_job_t</a> ** jobs,
-    const <a href='#char'>char</a> * mydest,
+    const char * mydest,
     int myjobs,
     int completed);
 </pre>
@@ -633,9 +537,11 @@ cupsGetJobs(
 <thead><tr><th>Name</th><th>Description</th></tr></thead>
 <tbody>
 <tr><td><tt>jobs</tt></td><td>Job data</td></tr>
-<tr><td><tt>mydest</tt></td><td>Only show jobs for dest?</td></tr>
-<tr><td><tt>myjobs</tt></td><td>Only show my jobs?</td></tr>
-<tr><td><tt>completed</tt></td><td>Only show completed jobs?</td></tr>
+<tr><td><tt>mydest</tt></td><td>NULL = all destinations,       *
+otherwise show jobs for mydest</td></tr>
+<tr><td><tt>myjobs</tt></td><td>0 = all users, 1 = mine</td></tr>
+<tr><td><tt>completed</tt></td><td>-1 = show all, 0 = active, *
+1 = completed jobs</td></tr>
 </tbody></table></div>
 <h4>Returns</h4>
 <p>Number of jobs</p>
@@ -651,7 +557,7 @@ int
 cupsGetJobs2(
     http_t * http,
     <a href='#cups_job_t'>cups_job_t</a> ** jobs,
-    const <a href='#char'>char</a> * mydest,
+    const char * mydest,
     int myjobs,
     int completed);
 </pre>
@@ -661,9 +567,11 @@ cupsGetJobs2(
 <tbody>
 <tr><td><tt>http</tt></td><td>HTTP connection</td></tr>
 <tr><td><tt>jobs</tt></td><td>Job data</td></tr>
-<tr><td><tt>mydest</tt></td><td>Only show jobs for dest?</td></tr>
-<tr><td><tt>myjobs</tt></td><td>Only show my jobs?</td></tr>
-<tr><td><tt>completed</tt></td><td>Only show completed jobs?</td></tr>
+<tr><td><tt>mydest</tt></td><td>NULL = all destinations,       *
+otherwise show jobs for mydest</td></tr>
+<tr><td><tt>myjobs</tt></td><td>0 = all users, 1 = mine</td></tr>
+<tr><td><tt>completed</tt></td><td>-1 = show all, 0 = active, *
+1 = completed jobs</td></tr>
 </tbody></table></div>
 <h4>Returns</h4>
 <p>Number of jobs</p>
@@ -673,9 +581,9 @@ cupsGetJobs2(
 <p>Get an option value.</p>
 <h4>Syntax</h4>
 <pre>
-const <a href='#char'>char</a> *
+const char *
 cupsGetOption(
-    const <a href='#char'>char</a> * name,
+    const char * name,
     int num_options,
     <a href='#cups_option_t'>cups_option_t</a> * options);
 </pre>
@@ -698,9 +606,9 @@ For classes, cupsGetPPD() returns the PPD file for the first printer
 in the class.</p>
 <h4>Syntax</h4>
 <pre>
-const <a href='#char'>char</a> *
+const char *
 cupsGetPPD(
-    const <a href='#char'>char</a> * name);
+    const char * name);
 </pre>
 <h4>Arguments</h4>
 <div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
@@ -721,10 +629,10 @@ in the class.
 </p>
 <h4>Syntax</h4>
 <pre>
-const <a href='#char'>char</a> *
+const char *
 cupsGetPPD2(
     http_t * http,
-    const <a href='#char'>char</a> * name);
+    const char * name);
 </pre>
 <h4>Arguments</h4>
 <div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
@@ -740,12 +648,13 @@ cupsGetPPD2(
 <h4>Description</h4>
 <p>Get a password from the user.
 
-Returns NULL if the user does not provide a password.</p>
+Uses the current password callback function. Returns NULL if the
+user does not provide a password.</p>
 <h4>Syntax</h4>
 <pre>
-const <a href='#char'>char</a> *
+const char *
 cupsGetPassword(
-    const <a href='#char'>char</a> * prompt);
+    const char * prompt);
 </pre>
 <h4>Arguments</h4>
 <div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
@@ -767,7 +676,7 @@ This function is deprecated - use cupsGetDests() instead.
 <pre>
 int
 cupsGetPrinters(
-    <a href='#char'>char</a> *** printers);
+    char *** printers);
 </pre>
 <h4>Arguments</h4>
 <div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
@@ -797,7 +706,7 @@ cupsLangDefault(void);
 for the given language.</p>
 <h4>Syntax</h4>
 <pre>
-const <a href='#char'>char</a> *
+const char *
 cupsLangEncoding(
     cups_lang_t * lang);
 </pre>
@@ -850,7 +759,7 @@ cupsLangFree(
 <pre>
 cups_lang_t *
 cupsLangGet(
-    const <a href='#char'>char</a> * language);
+    const char * language);
 </pre>
 <h4>Arguments</h4>
 <div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
@@ -881,7 +790,7 @@ cupsLastError(void);
 </p>
 <h4>Syntax</h4>
 <pre>
-const <a href='#char'>char</a> *
+const char *
 cupsLastErrorString(void);
 </pre>
 <h4>Arguments</h4>
@@ -924,7 +833,7 @@ attributes.</p>
 <pre>
 int
 cupsParseOptions(
-    const <a href='#char'>char</a> * arg,
+    const char * arg,
     int num_options,
     <a href='#cups_option_t'>cups_option_t</a> ** options);
 </pre>
@@ -946,9 +855,9 @@ cupsParseOptions(
 <pre>
 int
 cupsPrintFile(
-    const <a href='#char'>char</a> * name,
-    const <a href='#char'>char</a> * filename,
-    const <a href='#char'>char</a> * title,
+    const char * name,
+    const char * filename,
+    const char * title,
     int num_options,
     <a href='#cups_option_t'>cups_option_t</a> * options);
 </pre>
@@ -975,9 +884,9 @@ cupsPrintFile(
 int
 cupsPrintFile2(
     http_t * http,
-    const <a href='#char'>char</a> * name,
-    const <a href='#char'>char</a> * filename,
-    const <a href='#char'>char</a> * title,
+    const char * name,
+    const char * filename,
+    const char * title,
     int num_options,
     <a href='#cups_option_t'>cups_option_t</a> * options);
 </pre>
@@ -997,15 +906,16 @@ cupsPrintFile2(
 <!-- NEW PAGE -->
 <h3 class='title'><a name='cupsPrintFiles'>cupsPrintFiles()</a></h3>
 <h4>Description</h4>
-<p>Print one or more files to a printer or class on the default server.</p>
+<p>Print one or more files to a printer or class on the
+default server.</p>
 <h4>Syntax</h4>
 <pre>
 int
 cupsPrintFiles(
-    const <a href='#char'>char</a> * name,
+    const char * name,
     int num_files,
-    const <a href='#char'>char</a> ** files,
-    const <a href='#char'>char</a> * title,
+    const char ** files,
+    const char * title,
     int num_options,
     <a href='#cups_option_t'>cups_option_t</a> * options);
 </pre>
@@ -1025,7 +935,8 @@ cupsPrintFiles(
 <!-- NEW PAGE -->
 <h3 class='title'><span class='info'>&nbsp;CUPS 1.1.21&nbsp;</span><a name='cupsPrintFiles2'>cupsPrintFiles2()</a></h3>
 <h4>Description</h4>
-<p>Print one or more files to a printer or class on the specified server.
+<p>Print one or more files to a printer or class on the
+specified server.
 
 </p>
 <h4>Syntax</h4>
@@ -1033,10 +944,10 @@ cupsPrintFiles(
 int
 cupsPrintFiles2(
     http_t * http,
-    const <a href='#char'>char</a> * name,
+    const char * name,
     int num_files,
-    const <a href='#char'>char</a> ** files,
-    const <a href='#char'>char</a> * title,
+    const char ** files,
+    const char * title,
     int num_options,
     <a href='#cups_option_t'>cups_option_t</a> * options);
 </pre>
@@ -1067,7 +978,7 @@ This function returns HTTP_CREATED when the file is stored successfully.
 http_status_t
 cupsPutFd(
     http_t * http,
-    const <a href='#char'>char</a> * resource,
+    const char * resource,
     int fd);
 </pre>
 <h4>Arguments</h4>
@@ -1079,7 +990,7 @@ cupsPutFd(
 <tr><td><tt>fd</tt></td><td>File descriptor</td></tr>
 </tbody></table></div>
 <h4>Returns</h4>
-<p>Status</p>
+<p>HTTP status</p>
 <!-- NEW PAGE -->
 <h3 class='title'><span class='info'>&nbsp;CUPS 1.1.20&nbsp;</span><a name='cupsPutFile'>cupsPutFile()</a></h3>
 <h4>Description</h4>
@@ -1093,8 +1004,8 @@ This function returns HTTP_CREATED when the file is stored successfully.
 http_status_t
 cupsPutFile(
     http_t * http,
-    const <a href='#char'>char</a> * resource,
-    const <a href='#char'>char</a> * filename);
+    const char * resource,
+    const char * filename);
 </pre>
 <h4>Arguments</h4>
 <div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
@@ -1105,7 +1016,7 @@ cupsPutFile(
 <tr><td><tt>filename</tt></td><td>Filename</td></tr>
 </tbody></table></div>
 <h4>Returns</h4>
-<p>Status</p>
+<p>HTTP status</p>
 <!-- NEW PAGE -->
 <h3 class='title'><a name='cupsServer'>cupsServer()</a></h3>
 <h4>Description</h4>
@@ -1115,7 +1026,7 @@ The returned value can be a fully-qualified hostname, a numeric
 IPv4 or IPv6 address, or a domain socket pathname.</p>
 <h4>Syntax</h4>
 <pre>
-const <a href='#char'>char</a> *
+const char *
 cupsServer(void);
 </pre>
 <h4>Arguments</h4>
@@ -1200,7 +1111,7 @@ Pass NULL to restore the default (console) password callback.</p>
 <pre>
 void
 cupsSetPasswordCB(
-    cups_password_cb_t cb);
+    <a href='#cups_password_cb_t'>cups_password_cb_t</a> cb);
 </pre>
 <h4>Arguments</h4>
 <div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
@@ -1222,7 +1133,7 @@ restore the default server name.</p>
 <pre>
 void
 cupsSetServer(
-    const <a href='#char'>char</a> * server);
+    const char * server);
 </pre>
 <h4>Arguments</h4>
 <div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
@@ -1242,7 +1153,7 @@ Pass NULL to restore the default user name.</p>
 <pre>
 void
 cupsSetUser(
-    const <a href='#char'>char</a> * user);
+    const char * user);
 </pre>
 <h4>Arguments</h4>
 <div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
@@ -1262,7 +1173,7 @@ The temporary filename is stored in the filename buffer.</p>
 <pre>
 int
 cupsTempFd(
-    <a href='#char'>char</a> * filename,
+    char * filename,
     int len);
 </pre>
 <h4>Arguments</h4>
@@ -1286,9 +1197,9 @@ instead.
 </p>
 <h4>Syntax</h4>
 <pre>
-<a href='#char'>char</a> *
+char *
 cupsTempFile(
-    <a href='#char'>char</a> * filename,
+    char * filename,
     int len);
 </pre>
 <h4>Arguments</h4>
@@ -1312,7 +1223,7 @@ The temporary filename is stored in the filename buffer.
 <pre>
 cups_file_t *
 cupsTempFile2(
-    <a href='#char'>char</a> * filename,
+    char * filename,
     int len);
 </pre>
 <h4>Arguments</h4>
@@ -1330,7 +1241,7 @@ cupsTempFile2(
 <p>Return the current user's name.</p>
 <h4>Syntax</h4>
 <pre>
-const <a href='#char'>char</a> *
+const char *
 cupsUser(void);
 </pre>
 <h4>Arguments</h4>
@@ -1352,7 +1263,7 @@ cupsUser(void);
 <pre>
 struct cups_dest_s
 {
-  <a href='#char'>char</a> *name, * instance;
+  char *name, * instance;
   int is_default;
   int num_options;
   <a href='#cups_option_t'>cups_option_t</a> * options;
@@ -1375,33 +1286,45 @@ struct cups_dest_s
 <pre>
 struct cups_job_s
 {
-  <a href='#char'>char</a> *dest, *title, *user, * format;
+  time_t completed_time;
+  time_t creation_time;
+  char * dest;
+  char * format;
   int id;
-  int size, priority;
-  time_t completed_time, creation_time, processing_time;
+  int priority;
+  time_t processing_time;
+  int size;
   ipp_jstate_t state;
+  char * title;
+  char * user;
 };
 </pre>
 <h4>Members</h4>
 <div class='table'><table align='center' border='1' width='80%'>
 <thead><tr><th>Name</th><th>Description</th></tr></thead>
 <tbody>
+<tr><td><tt>completed_time</tt> </td><td>Time the job was completed</td></tr>
+<tr><td><tt>creation_time</tt> </td><td>Time the job was created</td></tr>
+<tr><td><tt>dest</tt> </td><td>Printer or class name</td></tr>
 <tr><td><tt>format</tt> </td><td>Document format</td></tr>
 <tr><td><tt>id</tt> </td><td>The job ID</td></tr>
 <tr><td><tt>priority</tt> </td><td>Priority (1-100)</td></tr>
 <tr><td><tt>processing_time</tt> </td><td>Time the job was processed</td></tr>
+<tr><td><tt>size</tt> </td><td>Size in kilobytes</td></tr>
 <tr><td><tt>state</tt> </td><td>Job state</td></tr>
+<tr><td><tt>title</tt> </td><td>Title/job name</td></tr>
+<tr><td><tt>user</tt> </td><td>User the submitted the job</td></tr>
 </tbody></table></div>
 <!-- NEW PAGE -->
 <h3 class='title'><a name='cups_option_s'>cups_option_s</a></h3>
 <h4>Description</h4>
-<p>Types and structures...</p>
+<p>Printer Options</p>
 <h4>Definition</h4>
 <pre>
 struct cups_option_s
 {
-  <a href='#char'>char</a> * name;
-  <a href='#char'>char</a> * value;
+  char * name;
+  char * value;
 };
 </pre>
 <h4>Members</h4>
@@ -1414,21 +1337,13 @@ struct cups_option_s
 <!-- NEW PAGE -->
 <h2 class='title'><a name='TYPES'>Types</a></h2>
 <ul>
-       <li><a href='#char'><tt>char</tt></a> </li>
        <li><a href='#cups_dest_t'><tt>cups_dest_t</tt></a> </li>
        <li><a href='#cups_job_t'><tt>cups_job_t</tt></a> </li>
        <li><a href='#cups_option_t'><tt>cups_option_t</tt></a> </li>
+       <li><a href='#cups_password_cb_t'><tt>cups_password_cb_t</tt></a> </li>
        <li><a href='#cups_ptype_t'><tt>cups_ptype_t</tt></a> </li>
 </ul>
 <!-- NEW PAGE -->
-<h3 class='title'><a name='char'>char</a></h3>
-<h4>Description</h4>
-<p>Printer Options</p>
-<h4>Definition</h4>
-<pre>
-typedef const * (*charcups_password_cb_t)(const <a href='#char'>char</a> *);
-</pre>
-<!-- NEW PAGE -->
 <h3 class='title'><a name='cups_dest_t'>cups_dest_t</a></h3>
 <h4>Description</h4>
 <p>Destination</p>
@@ -1447,12 +1362,20 @@ typedef struct <a href='#cups_job_s'>cups_job_s</a> cups_job_t;
 <!-- NEW PAGE -->
 <h3 class='title'><a name='cups_option_t'>cups_option_t</a></h3>
 <h4>Description</h4>
-<p>Types and structures...</p>
+<p>Printer Options</p>
 <h4>Definition</h4>
 <pre>
 typedef struct <a href='#cups_option_s'>cups_option_s</a> cups_option_t;
 </pre>
 <!-- NEW PAGE -->
+<h3 class='title'><a name='cups_password_cb_t'>cups_password_cb_t</a></h3>
+<h4>Description</h4>
+<p>Password callback</p>
+<h4>Definition</h4>
+<pre>
+typedef const char * (*cups_password_cb_t)(const char *);
+</pre>
+<!-- NEW PAGE -->
 <h3 class='title'><a name='cups_ptype_t'>cups_ptype_t</a></h3>
 <h4>Description</h4>
 <p>Printer Type/Capability Bits</p>
index 07c8a74a58a7a375073953c877e8688f05d591ee..51fc07fb1777554b42e8b9d0fcdbe470200fd02b 100644 (file)
@@ -97,6 +97,7 @@ library:</p>
        <li><a href='#cupsFileClose'><tt>cupsFileClose()</tt></a> </li>
        <li><a href='#cupsFileCompression'><tt>cupsFileCompression()</tt></a> </li>
        <li><a href='#cupsFileEOF'><tt>cupsFileEOF()</tt></a> </li>
+       <li><a href='#cupsFileFind'><tt>cupsFileFind()</tt></a> </li>
        <li><a href='#cupsFileFlush'><tt>cupsFileFlush()</tt></a> </li>
        <li><a href='#cupsFileGetChar'><tt>cupsFileGetChar()</tt></a> </li>
        <li><a href='#cupsFileGetConf'><tt>cupsFileGetConf()</tt></a> </li>
@@ -243,6 +244,38 @@ cupsFileEOF(
 <h4>Returns</h4>
 <p>1 on EOF, 0 otherwise</p>
 <!-- NEW PAGE -->
+<h3 class='title'><a name='cupsFileFind'>cupsFileFind()</a></h3>
+<h4>Description</h4>
+<p>Find a file using the specified path.
+
+This function allows the paths in the path string to be separated by
+colons (UNIX standard) or semicolons (Windows standard) and stores the
+result in the buffer supplied.  If the file cannot be found in any of
+the supplied paths, NULL is returned. A NULL path only matches the
+current directory.</p>
+<h4>Syntax</h4>
+<pre>
+const char *
+cupsFileFind(
+    const char * filename,
+    const char * path,
+    int executable,
+    char * buffer,
+    int bufsize);
+</pre>
+<h4>Arguments</h4>
+<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
+<thead><tr><th>Name</th><th>Description</th></tr></thead>
+<tbody>
+<tr><td><tt>filename</tt></td><td>File to find</td></tr>
+<tr><td><tt>path</tt></td><td>Colon/semicolon-separated path</td></tr>
+<tr><td><tt>executable</tt></td><td>1 = executable files, 0 = any file/dir</td></tr>
+<tr><td><tt>buffer</tt></td><td>Filename buffer</td></tr>
+<tr><td><tt>bufsize</tt></td><td>Size of filename buffer</td></tr>
+</tbody></table></div>
+<h4>Returns</h4>
+<p>Full path to file or NULL</p>
+<!-- NEW PAGE -->
 <h3 class='title'><a name='cupsFileFlush'>cupsFileFlush()</a></h3>
 <h4>Description</h4>
 <p>Flush pending output.</p>
@@ -303,7 +336,7 @@ cupsFileGetConf(
 <tr><td><tt>linenum</tt></td><td>Current line number</td></tr>
 </tbody></table></div>
 <h4>Returns</h4>
-<p>Line read of NULL on eof/error</p>
+<p>Line read or NULL on eof/error</p>
 <!-- NEW PAGE -->
 <h3 class='title'><a name='cupsFileGets'>cupsFileGets()</a></h3>
 <h4>Description</h4>
index 51ccd2132b2d7fb9bbe0225fe125e95781b5f7a0..308d0ce07a14999016e977f819b5b9244ae47a54 100644 (file)
@@ -20,7 +20,7 @@
 
   Filter and backend API introduction for the Common UNIX Printing System (CUPS).
 
-  Copyright 1997-2005 by Easy Software Products.
+  Copyright 1997-2006 by Easy Software Products.
 
   These coded instructions, statements, and computer programs are the
   property of Easy Software Products and are protected by Federal
 
 <h2 class='title'>Introduction</h2>
 
-<p>The CUPS filter and backend APIs provide...</p>
+<p>The CUPS filter and backend APIs define standard exit codes
+and provide access to the backchannel data stream. They are only
+used when writing backends, filters, and port monitors.</p>
 
 <h2 class='title'>General Usage</h2>
 
 <p>The <var>&lt;cups/backend.h&gt;</var> and
 <var>&lt;cups/cups.h&gt;</var> header files must be included to
 use the <tt>CUPS_BACKEND_</tt> constants and
-<tt>cupsBackchannel</tt> functions, respectively.</p>
+<tt>cupsBackChannel</tt> functions, respectively.</p>
 
 <p>Programs using these functions must be linked to the CUPS
 library: <var>libcups.a</var>, <var>libcups.so.2</var>,
@@ -71,11 +73,11 @@ library:</p>
 <!-- NEW PAGE -->
 <h2 class='title'><a name='FUNCTIONS'>Functions</a></h2>
 <ul>
-       <li><a href='#cupsBackchannelRead'><tt>cupsBackchannelRead()</tt></a> <span class='info'>&nbsp;CUPS 1.2&nbsp;</span></li>
-       <li><a href='#cupsBackchannelWrite'><tt>cupsBackchannelWrite()</tt></a> <span class='info'>&nbsp;CUPS 1.2&nbsp;</span></li>
+       <li><a href='#cupsBackChannelRead'><tt>cupsBackChannelRead()</tt></a> <span class='info'>&nbsp;CUPS 1.2&nbsp;</span></li>
+       <li><a href='#cupsBackChannelWrite'><tt>cupsBackChannelWrite()</tt></a> <span class='info'>&nbsp;CUPS 1.2&nbsp;</span></li>
 </ul>
 <!-- NEW PAGE -->
-<h3 class='title'><span class='info'>&nbsp;CUPS 1.2&nbsp;</span><a name='cupsBackchannelRead'>cupsBackchannelRead()</a></h3>
+<h3 class='title'><span class='info'>&nbsp;CUPS 1.2&nbsp;</span><a name='cupsBackChannelRead'>cupsBackChannelRead()</a></h3>
 <h4>Description</h4>
 <p>Read data from the backchannel.
 
@@ -87,10 +89,10 @@ for data indefinitely.
 </p>
 <h4>Syntax</h4>
 <pre>
-int
-cupsBackchannelRead(
+ssize_t
+cupsBackChannelRead(
     char * buffer,
-    int bytes,
+    size_t bytes,
     double timeout);
 </pre>
 <h4>Arguments</h4>
@@ -104,7 +106,7 @@ cupsBackchannelRead(
 <h4>Returns</h4>
 <p>Bytes read or -1 on error</p>
 <!-- NEW PAGE -->
-<h3 class='title'><span class='info'>&nbsp;CUPS 1.2&nbsp;</span><a name='cupsBackchannelWrite'>cupsBackchannelWrite()</a></h3>
+<h3 class='title'><span class='info'>&nbsp;CUPS 1.2&nbsp;</span><a name='cupsBackChannelWrite'>cupsBackChannelWrite()</a></h3>
 <h4>Description</h4>
 <p>Write data to the backchannel.
 
@@ -116,10 +118,10 @@ indefinitely.
 </p>
 <h4>Syntax</h4>
 <pre>
-int
-cupsBackchannelWrite(
+ssize_t
+cupsBackChannelWrite(
     const char * buffer,
-    int bytes,
+    size_t bytes,
     double timeout);
 </pre>
 <h4>Arguments</h4>
index 1cd14c5c582ae0695f3ebfd663cced239f829450..2b084f9187f03567b7f42a6dcbb01cc7fc39ee35 100644 (file)
@@ -20,7 +20,7 @@
 
   HTTP and IPP API introduction for the Common UNIX Printing System (CUPS).
 
-  Copyright 1997-2005 by Easy Software Products.
+  Copyright 1997-2006 by Easy Software Products.
 
   These coded instructions, statements, and computer programs are the
   property of Easy Software Products and are protected by Federal
 
 <h2 class='title'>Introduction</h2>
 
-<p>The CUPS HTTP and IPP APIs provide...</p>
+<p>The CUPS HTTP and IPP APIs provide low-level access to the
+HTTP and IPP protocols and CUPS scheduler. They are typically
+used by monitoring and administration programs to perform
+specific functions not supported by the high-level CUPS API
+functions.</p>
 
 <h2 class='title'>General Usage</h2>
 
@@ -69,53 +73,22 @@ require CUPS 1.1 or higher.</p>
        <li><a href='#FUNCTIONS'>Functions</a></li>
        <li><a href='#STRUCTURES'>Structures</a></li>
        <li><a href='#TYPES'>Types</a></li>
+       <li><a href='#UNIONS'>Unions</a></li>
 </ul>
 <!-- NEW PAGE -->
 <h2 class='title'><a name='ENUMERATIONS'>Enumerations</a></h2>
 <ul>
-       <li><a href='#cups_ptype_e'><tt>cups_ptype_e</tt></a> </li>
        <li><a href='#http_auth_e'><tt>http_auth_e</tt></a> </li>
        <li><a href='#http_encoding_e'><tt>http_encoding_e</tt></a> </li>
        <li><a href='#http_encryption_e'><tt>http_encryption_e</tt></a> </li>
        <li><a href='#http_field_e'><tt>http_field_e</tt></a> </li>
        <li><a href='#http_keepalive_e'><tt>http_keepalive_e</tt></a> </li>
        <li><a href='#http_status_e'><tt>http_status_e</tt></a> </li>
+       <li><a href='#ipp_res_e'><tt>ipp_res_e</tt></a> </li>
+       <li><a href='#ipp_status_e'><tt>ipp_status_e</tt></a> </li>
+       <li><a href='#ipp_tag_e'><tt>ipp_tag_e</tt></a> </li>
 </ul>
 <!-- NEW PAGE -->
-<h3 class='title'><a name='cups_ptype_e'>cups_ptype_e</a></h3>
-<h4>Description</h4>
-<p>Not a typedef'd enum so we can OR</p>
-<h4>Values</h4>
-<div class='table'><table align='center' border='1' width='80%'>
-<thead><tr><th>Name</th><th>Description</th></tr></thead>
-<tbody>
-<tr><td><tt>CUPS_PRINTER_AUTHENTICATED</tt> <span class='info'>&nbsp;CUPS 1.2&nbsp;</span></td><td>Printer requires authentication </td></tr>
-<tr><td><tt>CUPS_PRINTER_BIND</tt> </td><td>Can bind output</td></tr>
-<tr><td><tt>CUPS_PRINTER_BW</tt> </td><td>Can do B&amp;W printing</td></tr>
-<tr><td><tt>CUPS_PRINTER_CLASS</tt> </td><td>Printer class</td></tr>
-<tr><td><tt>CUPS_PRINTER_COLLATE</tt> </td><td>Can collage copies</td></tr>
-<tr><td><tt>CUPS_PRINTER_COLOR</tt> </td><td>Can do color printing</td></tr>
-<tr><td><tt>CUPS_PRINTER_COPIES</tt> </td><td>Can do copies</td></tr>
-<tr><td><tt>CUPS_PRINTER_COVER</tt> </td><td>Can cover output</td></tr>
-<tr><td><tt>CUPS_PRINTER_DEFAULT</tt> </td><td>Default printer on network</td></tr>
-<tr><td><tt>CUPS_PRINTER_DELETE</tt> <span class='info'>&nbsp;CUPS 1.2&nbsp;</span></td><td>Delete printer </td></tr>
-<tr><td><tt>CUPS_PRINTER_DUPLEX</tt> </td><td>Can do duplexing</td></tr>
-<tr><td><tt>CUPS_PRINTER_FAX</tt> </td><td>Fax queue</td></tr>
-<tr><td><tt>CUPS_PRINTER_IMPLICIT</tt> </td><td>Implicit class</td></tr>
-<tr><td><tt>CUPS_PRINTER_LARGE</tt> </td><td>Can do D/E/A1/A0</td></tr>
-<tr><td><tt>CUPS_PRINTER_LOCAL</tt> </td><td>Local printer or class</td></tr>
-<tr><td><tt>CUPS_PRINTER_MEDIUM</tt> </td><td>Can do Tabloid/B/C/A3/A2</td></tr>
-<tr><td><tt>CUPS_PRINTER_NOT_SHARED</tt> <span class='info'>&nbsp;CUPS 1.2&nbsp;</span></td><td>Printer is not shared </td></tr>
-<tr><td><tt>CUPS_PRINTER_OPTIONS</tt> </td><td>~(CLASS | REMOTE | IMPLICIT)</td></tr>
-<tr><td><tt>CUPS_PRINTER_PUNCH</tt> </td><td>Can punch output</td></tr>
-<tr><td><tt>CUPS_PRINTER_REJECTING</tt> </td><td>Printer is rejecting jobs</td></tr>
-<tr><td><tt>CUPS_PRINTER_REMOTE</tt> </td><td>Remote printer or class</td></tr>
-<tr><td><tt>CUPS_PRINTER_SMALL</tt> </td><td>Can do Letter/Legal/A4</td></tr>
-<tr><td><tt>CUPS_PRINTER_SORT</tt> </td><td>Can sort output</td></tr>
-<tr><td><tt>CUPS_PRINTER_STAPLE</tt> </td><td>Can staple output</td></tr>
-<tr><td><tt>CUPS_PRINTER_VARIABLE</tt> </td><td>Can do variable sizes</td></tr>
-</tbody></table></div>
-<!-- NEW PAGE -->
 <h3 class='title'><a name='http_auth_e'>http_auth_e</a></h3>
 <h4>Description</h4>
 <p>HTTP authentication types</p>
@@ -252,52 +225,123 @@ require CUPS 1.1 or higher.</p>
 <tr><td><tt>HTTP_USE_PROXY</tt> </td><td>Must use a proxy to access this URI</td></tr>
 </tbody></table></div>
 <!-- NEW PAGE -->
+<h3 class='title'><a name='ipp_res_e'>ipp_res_e</a></h3>
+<h4>Description</h4>
+<p>Types and structures...</p>
+<h4>Values</h4>
+<div class='table'><table align='center' border='1' width='80%'>
+<thead><tr><th>Name</th><th>Description</th></tr></thead>
+<tbody>
+<tr><td><tt>IPP_RES_PER_CM</tt> </td><td>Pixels per centimeter</td></tr>
+<tr><td><tt>IPP_RES_PER_INCH</tt> </td><td>Pixels per inch</td></tr>
+</tbody></table></div>
+<!-- NEW PAGE -->
+<h3 class='title'><a name='ipp_status_e'>ipp_status_e</a></h3>
+<h4>Description</h4>
+<p>IPP status codes...</p>
+<h4>Values</h4>
+<div class='table'><table align='center' border='1' width='80%'>
+<thead><tr><th>Name</th><th>Description</th></tr></thead>
+<tbody>
+<tr><td><tt>IPP_ATTRIBUTES</tt> </td><td>client-error-attributes-or-values-not-supported</td></tr>
+<tr><td><tt>IPP_ATTRIBUTES_NOT_SETTABLE</tt> </td><td>client-error-attributes-not-settable</td></tr>
+<tr><td><tt>IPP_BAD_REQUEST</tt> </td><td>client-error-bad-request</td></tr>
+<tr><td><tt>IPP_CHARSET</tt> </td><td>client-error-charset-not-supported</td></tr>
+<tr><td><tt>IPP_COMPRESSION_ERROR</tt> </td><td>client-error-compression-error</td></tr>
+<tr><td><tt>IPP_COMPRESSION_NOT_SUPPORTED</tt> </td><td>client-error-compression-not-supported</td></tr>
+<tr><td><tt>IPP_CONFLICT</tt> </td><td>client-error-conflicting-attributes</td></tr>
+<tr><td><tt>IPP_DEVICE_ERROR</tt> </td><td>server-error-device-error</td></tr>
+<tr><td><tt>IPP_DOCUMENT_ACCESS_ERROR</tt> </td><td>client-error-document-access-error</td></tr>
+<tr><td><tt>IPP_DOCUMENT_FORMAT</tt> </td><td>client-error-document-format-not-supported</td></tr>
+<tr><td><tt>IPP_DOCUMENT_FORMAT_ERROR</tt> </td><td>client-error-document-format-error</td></tr>
+<tr><td><tt>IPP_ERROR_JOB_CANCELLED</tt> </td><td>server-error-job-canceled</td></tr>
+<tr><td><tt>IPP_FORBIDDEN</tt> </td><td>client-error-forbidden</td></tr>
+<tr><td><tt>IPP_GONE</tt> </td><td>client-error-gone</td></tr>
+<tr><td><tt>IPP_IGNORED_ALL_NOTIFICATIONS</tt> </td><td>client-error-ignored-all-notifications</td></tr>
+<tr><td><tt>IPP_IGNORED_ALL_SUBSCRIPTIONS</tt> </td><td>client-error-ignored-all-subscriptions</td></tr>
+<tr><td><tt>IPP_INTERNAL_ERROR</tt> </td><td>server-error-internal-error</td></tr>
+<tr><td><tt>IPP_MULTIPLE_JOBS_NOT_SUPPORTED</tt> </td><td>server-error-multiple-document-jobs-not-supported</td></tr>
+<tr><td><tt>IPP_NOT_ACCEPTING</tt> </td><td>server-error-not-accepting-jobs</td></tr>
+<tr><td><tt>IPP_NOT_AUTHENTICATED</tt> </td><td>client-error-not-authenticated</td></tr>
+<tr><td><tt>IPP_NOT_AUTHORIZED</tt> </td><td>client-error-not-authorized</td></tr>
+<tr><td><tt>IPP_NOT_FOUND</tt> </td><td>client-error-not-found</td></tr>
+<tr><td><tt>IPP_NOT_POSSIBLE</tt> </td><td>client-error-not-possible</td></tr>
+<tr><td><tt>IPP_OK</tt> </td><td>successful-ok</td></tr>
+<tr><td><tt>IPP_OK_BUT_CANCEL_SUBSCRIPTION</tt> </td><td>successful-ok-but-cancel-subscription</td></tr>
+<tr><td><tt>IPP_OK_CONFLICT</tt> </td><td>successful-ok-conflicting-attributes</td></tr>
+<tr><td><tt>IPP_OK_EVENTS_COMPLETE</tt> </td><td>successful-ok-events-complete</td></tr>
+<tr><td><tt>IPP_OK_IGNORED_NOTIFICATIONS</tt> </td><td>successful-ok-ignored-notifications</td></tr>
+<tr><td><tt>IPP_OK_IGNORED_SUBSCRIPTIONS</tt> </td><td>successful-ok-ignored-subscriptions</td></tr>
+<tr><td><tt>IPP_OK_SUBST</tt> </td><td>successful-ok-ignored-or-substituted-attributes</td></tr>
+<tr><td><tt>IPP_OK_TOO_MANY_EVENTS</tt> </td><td>successful-ok-too-many-events</td></tr>
+<tr><td><tt>IPP_OPERATION_NOT_SUPPORTED</tt> </td><td>server-error-operation-not-supported</td></tr>
+<tr><td><tt>IPP_PRINTER_BUSY</tt> </td><td>server-error-busy</td></tr>
+<tr><td><tt>IPP_PRINTER_IS_DEACTIVATED</tt> </td><td>server-error-printer-is-deactivated</td></tr>
+<tr><td><tt>IPP_PRINT_SUPPORT_FILE_NOT_FOUND</tt> </td><td>client-error-print-support-file-not-found</td></tr>
+<tr><td><tt>IPP_REDIRECTION_OTHER_SITE</tt> </td><td></td></tr>
+<tr><td><tt>IPP_REQUEST_ENTITY</tt> </td><td>client-error-request-entity-too-large</td></tr>
+<tr><td><tt>IPP_REQUEST_VALUE</tt> </td><td>client-error-request-value-too-long</td></tr>
+<tr><td><tt>IPP_SERVICE_UNAVAILABLE</tt> </td><td>server-error-service-unavailable</td></tr>
+<tr><td><tt>IPP_TEMPORARY_ERROR</tt> </td><td>server-error-temporary-error</td></tr>
+<tr><td><tt>IPP_TIMEOUT</tt> </td><td>client-error-timeout</td></tr>
+<tr><td><tt>IPP_TOO_MANY_SUBSCRIPTIONS</tt> </td><td>client-error-too-many-subscriptions</td></tr>
+<tr><td><tt>IPP_URI_SCHEME</tt> </td><td>client-error-uri-scheme-not-supported</td></tr>
+<tr><td><tt>IPP_VERSION_NOT_SUPPORTED</tt> </td><td>server-error-version-not-supported</td></tr>
+</tbody></table></div>
+<!-- NEW PAGE -->
+<h3 class='title'><a name='ipp_tag_e'>ipp_tag_e</a></h3>
+<h4>Description</h4>
+<p>Format tags for attributes...</p>
+<h4>Values</h4>
+<div class='table'><table align='center' border='1' width='80%'>
+<thead><tr><th>Name</th><th>Description</th></tr></thead>
+<tbody>
+<tr><td><tt>IPP_TAG_ADMINDEFINE</tt> </td><td>Admin-defined value</td></tr>
+<tr><td><tt>IPP_TAG_BEGIN_COLLECTION</tt> </td><td>Beginning of collection value</td></tr>
+<tr><td><tt>IPP_TAG_BOOLEAN</tt> </td><td>Boolean value</td></tr>
+<tr><td><tt>IPP_TAG_CHARSET</tt> </td><td>Character set value</td></tr>
+<tr><td><tt>IPP_TAG_COPY</tt> </td><td>Bitflag for copied attribute values</td></tr>
+<tr><td><tt>IPP_TAG_DATE</tt> </td><td>Date/time value</td></tr>
+<tr><td><tt>IPP_TAG_DEFAULT</tt> </td><td>Default value</td></tr>
+<tr><td><tt>IPP_TAG_DELETEATTR</tt> </td><td>Delete-attribute value</td></tr>
+<tr><td><tt>IPP_TAG_END</tt> </td><td>End-of-attributes</td></tr>
+<tr><td><tt>IPP_TAG_END_COLLECTION</tt> </td><td>End of collection value</td></tr>
+<tr><td><tt>IPP_TAG_ENUM</tt> </td><td>Enumeration value</td></tr>
+<tr><td><tt>IPP_TAG_EVENT_NOTIFICATION</tt> </td><td>Event group</td></tr>
+<tr><td><tt>IPP_TAG_INTEGER</tt> </td><td>Integer value</td></tr>
+<tr><td><tt>IPP_TAG_JOB</tt> </td><td>Job group</td></tr>
+<tr><td><tt>IPP_TAG_KEYWORD</tt> </td><td>Keyword value</td></tr>
+<tr><td><tt>IPP_TAG_LANGUAGE</tt> </td><td>Language value</td></tr>
+<tr><td><tt>IPP_TAG_MASK</tt> </td><td>Mask for copied attribute values</td></tr>
+<tr><td><tt>IPP_TAG_MEMBERNAME</tt> </td><td>Collection member name value</td></tr>
+<tr><td><tt>IPP_TAG_MIMETYPE</tt> </td><td>MIME media type value</td></tr>
+<tr><td><tt>IPP_TAG_NAME</tt> </td><td>Name value</td></tr>
+<tr><td><tt>IPP_TAG_NAMELANG</tt> </td><td>Name-with-language value</td></tr>
+<tr><td><tt>IPP_TAG_NOTSETTABLE</tt> </td><td>Not-settable value</td></tr>
+<tr><td><tt>IPP_TAG_NOVALUE</tt> </td><td>No-value value</td></tr>
+<tr><td><tt>IPP_TAG_OPERATION</tt> </td><td>Operation group</td></tr>
+<tr><td><tt>IPP_TAG_PRINTER</tt> </td><td>Printer group</td></tr>
+<tr><td><tt>IPP_TAG_RANGE</tt> </td><td>Range value</td></tr>
+<tr><td><tt>IPP_TAG_RESOLUTION</tt> </td><td>Resolution value</td></tr>
+<tr><td><tt>IPP_TAG_STRING</tt> </td><td>Octet string value</td></tr>
+<tr><td><tt>IPP_TAG_SUBSCRIPTION</tt> </td><td>Subscription group</td></tr>
+<tr><td><tt>IPP_TAG_TEXT</tt> </td><td>Text value</td></tr>
+<tr><td><tt>IPP_TAG_TEXTLANG</tt> </td><td>Text-with-language value</td></tr>
+<tr><td><tt>IPP_TAG_UNKNOWN</tt> </td><td>Unknown value</td></tr>
+<tr><td><tt>IPP_TAG_UNSUPPORTED_GROUP</tt> </td><td>Unsupported attributes group</td></tr>
+<tr><td><tt>IPP_TAG_UNSUPPORTED_VALUE</tt> </td><td>Unsupported value</td></tr>
+<tr><td><tt>IPP_TAG_URI</tt> </td><td>URI value</td></tr>
+<tr><td><tt>IPP_TAG_URISCHEME</tt> </td><td>URI scheme value</td></tr>
+<tr><td><tt>IPP_TAG_ZERO</tt> </td><td>Zero tag - used for separators</td></tr>
+</tbody></table></div>
+<!-- NEW PAGE -->
 <h2 class='title'><a name='FUNCTIONS'>Functions</a></h2>
 <ul>
-       <li><a href='#cupsAddDest'><tt>cupsAddDest()</tt></a> </li>
-       <li><a href='#cupsAddOption'><tt>cupsAddOption()</tt></a> </li>
-       <li><a href='#cupsCancelJob'><tt>cupsCancelJob()</tt></a> </li>
        <li><a href='#cupsDoAuthentication'><tt>cupsDoAuthentication()</tt></a> <span class='info'>&nbsp;CUPS 1.1.20&nbsp;</span></li>
        <li><a href='#cupsDoFileRequest'><tt>cupsDoFileRequest()</tt></a> </li>
+       <li><a href='#cupsDoRequest'><tt>cupsDoRequest()</tt></a> </li>
        <li><a href='#cupsEncodeOptions'><tt>cupsEncodeOptions()</tt></a> </li>
        <li><a href='#cupsEncodeOptions2'><tt>cupsEncodeOptions2()</tt></a> <span class='info'>&nbsp;CUPS 1.2&nbsp;</span></li>
-       <li><a href='#cupsEncryption'><tt>cupsEncryption()</tt></a> </li>
-       <li><a href='#cupsFreeDests'><tt>cupsFreeDests()</tt></a> </li>
-       <li><a href='#cupsFreeJobs'><tt>cupsFreeJobs()</tt></a> </li>
-       <li><a href='#cupsFreeOptions'><tt>cupsFreeOptions()</tt></a> </li>
-       <li><a href='#cupsGetClasses'><tt>cupsGetClasses()</tt></a> <span class='info'>&nbsp;DEPRECATED&nbsp;</span></li>
-       <li><a href='#cupsGetDefault'><tt>cupsGetDefault()</tt></a> </li>
-       <li><a href='#cupsGetDefault2'><tt>cupsGetDefault2()</tt></a> <span class='info'>&nbsp;CUPS 1.1.21&nbsp;</span></li>
-       <li><a href='#cupsGetDest'><tt>cupsGetDest()</tt></a> </li>
-       <li><a href='#cupsGetDests'><tt>cupsGetDests()</tt></a> </li>
-       <li><a href='#cupsGetDests2'><tt>cupsGetDests2()</tt></a> <span class='info'>&nbsp;CUPS 1.1.21&nbsp;</span></li>
-       <li><a href='#cupsGetFd'><tt>cupsGetFd()</tt></a> <span class='info'>&nbsp;CUPS 1.1.20&nbsp;</span></li>
-       <li><a href='#cupsGetFile'><tt>cupsGetFile()</tt></a> <span class='info'>&nbsp;CUPS 1.1.20&nbsp;</span></li>
-       <li><a href='#cupsGetJobs'><tt>cupsGetJobs()</tt></a> </li>
-       <li><a href='#cupsGetJobs2'><tt>cupsGetJobs2()</tt></a> <span class='info'>&nbsp;CUPS 1.1.21&nbsp;</span></li>
-       <li><a href='#cupsGetOption'><tt>cupsGetOption()</tt></a> </li>
-       <li><a href='#cupsGetPPD'><tt>cupsGetPPD()</tt></a> </li>
-       <li><a href='#cupsGetPPD2'><tt>cupsGetPPD2()</tt></a> <span class='info'>&nbsp;CUPS 1.1.21&nbsp;</span></li>
-       <li><a href='#cupsGetPassword'><tt>cupsGetPassword()</tt></a> </li>
-       <li><a href='#cupsGetPrinters'><tt>cupsGetPrinters()</tt></a> <span class='info'>&nbsp;DEPRECATED&nbsp;</span></li>
-       <li><a href='#cupsLastError'><tt>cupsLastError()</tt></a> </li>
-       <li><a href='#cupsLastErrorString'><tt>cupsLastErrorString()</tt></a> <span class='info'>&nbsp;CUPS 1.2&nbsp;</span></li>
-       <li><a href='#cupsMarkOptions'><tt>cupsMarkOptions()</tt></a> </li>
-       <li><a href='#cupsParseOptions'><tt>cupsParseOptions()</tt></a> </li>
-       <li><a href='#cupsPrintFile'><tt>cupsPrintFile()</tt></a> </li>
-       <li><a href='#cupsPrintFile2'><tt>cupsPrintFile2()</tt></a> <span class='info'>&nbsp;CUPS 1.1.21&nbsp;</span></li>
-       <li><a href='#cupsPrintFiles'><tt>cupsPrintFiles()</tt></a> </li>
-       <li><a href='#cupsPrintFiles2'><tt>cupsPrintFiles2()</tt></a> <span class='info'>&nbsp;CUPS 1.1.21&nbsp;</span></li>
-       <li><a href='#cupsPutFd'><tt>cupsPutFd()</tt></a> <span class='info'>&nbsp;CUPS 1.1.20&nbsp;</span></li>
-       <li><a href='#cupsPutFile'><tt>cupsPutFile()</tt></a> <span class='info'>&nbsp;CUPS 1.1.20&nbsp;</span></li>
-       <li><a href='#cupsServer'><tt>cupsServer()</tt></a> </li>
-       <li><a href='#cupsSetDests'><tt>cupsSetDests()</tt></a> </li>
-       <li><a href='#cupsSetDests2'><tt>cupsSetDests2()</tt></a> <span class='info'>&nbsp;CUPS 1.1.21&nbsp;</span></li>
-       <li><a href='#cupsSetEncryption'><tt>cupsSetEncryption()</tt></a> </li>
-       <li><a href='#cupsSetPasswordCB'><tt>cupsSetPasswordCB()</tt></a> </li>
-       <li><a href='#cupsSetServer'><tt>cupsSetServer()</tt></a> </li>
-       <li><a href='#cupsSetUser'><tt>cupsSetUser()</tt></a> </li>
-       <li><a href='#cupsUser'><tt>cupsUser()</tt></a> </li>
        <li><a href='#httpAddrAny'><tt>httpAddrAny()</tt></a> <span class='info'>&nbsp;CUPS 1.2&nbsp;</span></li>
        <li><a href='#httpAddrEqual'><tt>httpAddrEqual()</tt></a> <span class='info'>&nbsp;CUPS 1.2&nbsp;</span></li>
        <li><a href='#httpAddrLength'><tt>httpAddrLength()</tt></a> <span class='info'>&nbsp;CUPS 1.2&nbsp;</span></li>
@@ -306,27 +350,35 @@ require CUPS 1.1 or higher.</p>
        <li><a href='#httpAddrString'><tt>httpAddrString()</tt></a> <span class='info'>&nbsp;CUPS 1.2&nbsp;</span></li>
        <li><a href='#httpAssembleURI'><tt>httpAssembleURI()</tt></a> <span class='info'>&nbsp;CUPS 1.2&nbsp;</span></li>
        <li><a href='#httpAssembleURIf'><tt>httpAssembleURIf()</tt></a> <span class='info'>&nbsp;CUPS 1.2&nbsp;</span></li>
+       <li><a href='#httpBlocking'><tt>httpBlocking()</tt></a> </li>
        <li><a href='#httpCheck'><tt>httpCheck()</tt></a> </li>
        <li><a href='#httpClearCookie'><tt>httpClearCookie()</tt></a> <span class='info'>&nbsp;CUPS 1.1.19&nbsp;</span></li>
+       <li><a href='#httpClearFields'><tt>httpClearFields()</tt></a> </li>
        <li><a href='#httpClose'><tt>httpClose()</tt></a> </li>
        <li><a href='#httpConnect'><tt>httpConnect()</tt></a> </li>
        <li><a href='#httpConnectEncrypt'><tt>httpConnectEncrypt()</tt></a> </li>
-       <li><a href='#httpDecode64'><tt>httpDecode64()</tt></a> </li>
+       <li><a href='#httpDecode64'><tt>httpDecode64()</tt></a> <span class='info'>&nbsp;DEPRECATED&nbsp;</span></li>
        <li><a href='#httpDecode64_2'><tt>httpDecode64_2()</tt></a> <span class='info'>&nbsp;CUPS 1.1.21&nbsp;</span></li>
        <li><a href='#httpDelete'><tt>httpDelete()</tt></a> </li>
-       <li><a href='#httpEncode64'><tt>httpEncode64()</tt></a> </li>
+       <li><a href='#httpEncode64'><tt>httpEncode64()</tt></a> <span class='info'>&nbsp;DEPRECATED&nbsp;</span></li>
        <li><a href='#httpEncode64_2'><tt>httpEncode64_2()</tt></a> <span class='info'>&nbsp;CUPS 1.1.21&nbsp;</span></li>
        <li><a href='#httpEncryption'><tt>httpEncryption()</tt></a> </li>
+       <li><a href='#httpError'><tt>httpError()</tt></a> </li>
        <li><a href='#httpFlush'><tt>httpFlush()</tt></a> </li>
        <li><a href='#httpFlushWrite'><tt>httpFlushWrite()</tt></a> <span class='info'>&nbsp;CUPS 1.2&nbsp;</span></li>
        <li><a href='#httpGet'><tt>httpGet()</tt></a> </li>
+       <li><a href='#httpGetBlocking'><tt>httpGetBlocking()</tt></a> <span class='info'>&nbsp;CUPS 1.2&nbsp;</span></li>
+       <li><a href='#httpGetCookie'><tt>httpGetCookie()</tt></a> </li>
        <li><a href='#httpGetDateString'><tt>httpGetDateString()</tt></a> <span class='info'>&nbsp;DEPRECATED&nbsp;</span></li>
        <li><a href='#httpGetDateString2'><tt>httpGetDateString2()</tt></a> <span class='info'>&nbsp;CUPS 1.2&nbsp;</span></li>
        <li><a href='#httpGetDateTime'><tt>httpGetDateTime()</tt></a> </li>
+       <li><a href='#httpGetFd'><tt>httpGetFd()</tt></a> <span class='info'>&nbsp;CUPS 1.2&nbsp;</span></li>
+       <li><a href='#httpGetField'><tt>httpGetField()</tt></a> </li>
        <li><a href='#httpGetHostByName'><tt>httpGetHostByName()</tt></a> <span class='info'>&nbsp;DEPRECATED&nbsp;</span></li>
        <li><a href='#httpGetHostname'><tt>httpGetHostname()</tt></a> <span class='info'>&nbsp;CUPS 1.2&nbsp;</span></li>
-       <li><a href='#httpGetLength'><tt>httpGetLength()</tt></a> <span class='info'>&nbsp;CUPS 1.2&nbsp;</span></li>
-       <li><a href='#httpGetLength2'><tt>httpGetLength2()</tt></a> </li>
+       <li><a href='#httpGetLength'><tt>httpGetLength()</tt></a> <span class='info'>&nbsp;DEPRECATED&nbsp;</span></li>
+       <li><a href='#httpGetLength2'><tt>httpGetLength2()</tt></a> <span class='info'>&nbsp;CUPS 1.2&nbsp;</span></li>
+       <li><a href='#httpGetStatus'><tt>httpGetStatus()</tt></a> <span class='info'>&nbsp;CUPS 1.2&nbsp;</span></li>
        <li><a href='#httpGetSubField'><tt>httpGetSubField()</tt></a> <span class='info'>&nbsp;DEPRECATED&nbsp;</span></li>
        <li><a href='#httpGetSubField2'><tt>httpGetSubField2()</tt></a> <span class='info'>&nbsp;CUPS 1.2&nbsp;</span></li>
        <li><a href='#httpGets'><tt>httpGets()</tt></a> </li>
@@ -337,11 +389,11 @@ require CUPS 1.1 or higher.</p>
        <li><a href='#httpMD5String'><tt>httpMD5String()</tt></a> </li>
        <li><a href='#httpOptions'><tt>httpOptions()</tt></a> </li>
        <li><a href='#httpPost'><tt>httpPost()</tt></a> </li>
-       <li><a href='#httpPrintf'><tt>httpPrintf()</tt></a> </li>
        <li><a href='#httpPut'><tt>httpPut()</tt></a> </li>
-       <li><a href='#httpRead'><tt>httpRead()</tt></a> </li>
+       <li><a href='#httpRead'><tt>httpRead()</tt></a> <span class='info'>&nbsp;DEPRECATED&nbsp;</span></li>
+       <li><a href='#httpRead2'><tt>httpRead2()</tt></a> <span class='info'>&nbsp;CUPS 1.2&nbsp;</span></li>
        <li><a href='#httpReconnect'><tt>httpReconnect()</tt></a> </li>
-       <li><a href='#httpSeparate'><tt>httpSeparate()</tt></a> </li>
+       <li><a href='#httpSeparate'><tt>httpSeparate()</tt></a> <span class='info'>&nbsp;DEPRECATED&nbsp;</span></li>
        <li><a href='#httpSeparate2'><tt>httpSeparate2()</tt></a> <span class='info'>&nbsp;CUPS 1.1.21&nbsp;</span></li>
        <li><a href='#httpSeparateURI'><tt>httpSeparateURI()</tt></a> <span class='info'>&nbsp;CUPS 1.2&nbsp;</span></li>
        <li><a href='#httpSetCookie'><tt>httpSetCookie()</tt></a> <span class='info'>&nbsp;CUPS 1.1.19&nbsp;</span></li>
@@ -351,1061 +403,183 @@ require CUPS 1.1 or higher.</p>
        <li><a href='#httpTrace'><tt>httpTrace()</tt></a> </li>
        <li><a href='#httpUpdate'><tt>httpUpdate()</tt></a> </li>
        <li><a href='#httpWait'><tt>httpWait()</tt></a> <span class='info'>&nbsp;CUPS 1.1.19&nbsp;</span></li>
-       <li><a href='#httpWrite'><tt>httpWrite()</tt></a> </li>
+       <li><a href='#httpWrite'><tt>httpWrite()</tt></a> <span class='info'>&nbsp;DEPRECATED&nbsp;</span></li>
+       <li><a href='#httpWrite2'><tt>httpWrite2()</tt></a> <span class='info'>&nbsp;CUPS 1.2&nbsp;</span></li>
        <li><a href='#ippAddBoolean'><tt>ippAddBoolean()</tt></a> </li>
        <li><a href='#ippAddBooleans'><tt>ippAddBooleans()</tt></a> </li>
        <li><a href='#ippAddCollection'><tt>ippAddCollection()</tt></a> <span class='info'>&nbsp;CUPS 1.1.19&nbsp;</span></li>
        <li><a href='#ippAddCollections'><tt>ippAddCollections()</tt></a> <span class='info'>&nbsp;CUPS 1.1.19&nbsp;</span></li>
        <li><a href='#ippAddDate'><tt>ippAddDate()</tt></a> </li>
        <li><a href='#ippAddInteger'><tt>ippAddInteger()</tt></a> </li>
-       <li><a href='#ippAddIntegers'><tt>ippAddIntegers()</tt></a> </li>
-       <li><a href='#ippAddOctetString'><tt>ippAddOctetString()</tt></a> <span class='info'>&nbsp;CUPS 1.2&nbsp;</span></li>
-       <li><a href='#ippAddRange'><tt>ippAddRange()</tt></a> </li>
-       <li><a href='#ippAddRanges'><tt>ippAddRanges()</tt></a> </li>
-       <li><a href='#ippAddResolution'><tt>ippAddResolution()</tt></a> </li>
-       <li><a href='#ippAddResolutions'><tt>ippAddResolutions()</tt></a> </li>
-       <li><a href='#ippAddSeparator'><tt>ippAddSeparator()</tt></a> </li>
-       <li><a href='#ippAddString'><tt>ippAddString()</tt></a> </li>
-       <li><a href='#ippAddStrings'><tt>ippAddStrings()</tt></a> </li>
-       <li><a href='#ippDateToTime'><tt>ippDateToTime()</tt></a> </li>
-       <li><a href='#ippDelete'><tt>ippDelete()</tt></a> </li>
-       <li><a href='#ippDeleteAttribute'><tt>ippDeleteAttribute()</tt></a> <span class='info'>&nbsp;CUPS 1.1.19&nbsp;</span></li>
-       <li><a href='#ippErrorString'><tt>ippErrorString()</tt></a> </li>
-       <li><a href='#ippErrorValue'><tt>ippErrorValue()</tt></a> <span class='info'>&nbsp;CUPS 1.2&nbsp;</span></li>
-       <li><a href='#ippFindAttribute'><tt>ippFindAttribute()</tt></a> </li>
-       <li><a href='#ippFindNextAttribute'><tt>ippFindNextAttribute()</tt></a> </li>
-       <li><a href='#ippLength'><tt>ippLength()</tt></a> </li>
-       <li><a href='#ippNew'><tt>ippNew()</tt></a> </li>
-       <li><a href='#ippOpString'><tt>ippOpString()</tt></a> <span class='info'>&nbsp;CUPS 1.2&nbsp;</span></li>
-       <li><a href='#ippOpValue'><tt>ippOpValue()</tt></a> <span class='info'>&nbsp;CUPS 1.2&nbsp;</span></li>
-       <li><a href='#ippPort'><tt>ippPort()</tt></a> </li>
-       <li><a href='#ippRead'><tt>ippRead()</tt></a> </li>
-       <li><a href='#ippReadFile'><tt>ippReadFile()</tt></a> <span class='info'>&nbsp;CUPS 1.1.19&nbsp;</span></li>
-       <li><a href='#ippReadIO'><tt>ippReadIO()</tt></a> <span class='info'>&nbsp;CUPS 1.1.19&nbsp;</span></li>
-       <li><a href='#ippSetPort'><tt>ippSetPort()</tt></a> </li>
-       <li><a href='#ippTimeToDate'><tt>ippTimeToDate()</tt></a> </li>
-       <li><a href='#ippWrite'><tt>ippWrite()</tt></a> </li>
-       <li><a href='#ippWriteFile'><tt>ippWriteFile()</tt></a> <span class='info'>&nbsp;CUPS 1.1.19&nbsp;</span></li>
-       <li><a href='#ippWriteIO'><tt>ippWriteIO()</tt></a> <span class='info'>&nbsp;CUPS 1.1.19&nbsp;</span></li>
-</ul>
-<!-- NEW PAGE -->
-<h3 class='title'><a name='cupsAddDest'>cupsAddDest()</a></h3>
-<h4>Description</h4>
-<p>Add a destination to the list of destinations.
-
-Use the cupsSaveDests() function to save the updated list of destinations
-to the user's lpoptions file.</p>
-<h4>Syntax</h4>
-<pre>
-int
-cupsAddDest(
-    const <a href='#char'>char</a> * name,
-    const <a href='#char'>char</a> * instance,
-    int num_dests,
-    <a href='#cups_dest_t'>cups_dest_t</a> ** dests);
-</pre>
-<h4>Arguments</h4>
-<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
-<thead><tr><th>Name</th><th>Description</th></tr></thead>
-<tbody>
-<tr><td><tt>name</tt></td><td>Name of destination</td></tr>
-<tr><td><tt>instance</tt></td><td>Instance of destination or NULL for none/primary</td></tr>
-<tr><td><tt>num_dests</tt></td><td>Number of destinations</td></tr>
-<tr><td><tt>dests</tt></td><td>Destinations</td></tr>
-</tbody></table></div>
-<h4>Returns</h4>
-<p>New number of destinations</p>
-<!-- NEW PAGE -->
-<h3 class='title'><a name='cupsAddOption'>cupsAddOption()</a></h3>
-<h4>Description</h4>
-<p>Add an option to an option array.</p>
-<h4>Syntax</h4>
-<pre>
-int
-cupsAddOption(
-    const <a href='#char'>char</a> * name,
-    const <a href='#char'>char</a> * value,
-    int num_options,
-    <a href='#cups_option_t'>cups_option_t</a> ** options);
-</pre>
-<h4>Arguments</h4>
-<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
-<thead><tr><th>Name</th><th>Description</th></tr></thead>
-<tbody>
-<tr><td><tt>name</tt></td><td>Name of option</td></tr>
-<tr><td><tt>value</tt></td><td>Value of option</td></tr>
-<tr><td><tt>num_options</tt></td><td>Number of options</td></tr>
-<tr><td><tt>options</tt></td><td>Pointer to options</td></tr>
-</tbody></table></div>
-<h4>Returns</h4>
-<p>Number of options</p>
-<!-- NEW PAGE -->
-<h3 class='title'><a name='cupsCancelJob'>cupsCancelJob()</a></h3>
-<h4>Description</h4>
-<p>Cancel a print job on the default server.
-
-Use the cupsLastError() and cupsLastErrorString() functions to get
-the cause of any failure.</p>
-<h4>Syntax</h4>
-<pre>
-int
-cupsCancelJob(
-    const <a href='#char'>char</a> * name,
-    int job);
-</pre>
-<h4>Arguments</h4>
-<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
-<thead><tr><th>Name</th><th>Description</th></tr></thead>
-<tbody>
-<tr><td><tt>name</tt></td><td>Name of printer or class</td></tr>
-<tr><td><tt>job</tt></td><td>Job ID</td></tr>
-</tbody></table></div>
-<h4>Returns</h4>
-<p>1 on success, 0 on failure</p>
-<!-- NEW PAGE -->
-<h3 class='title'><span class='info'>&nbsp;CUPS 1.1.20&nbsp;</span><a name='cupsDoAuthentication'>cupsDoAuthentication()</a></h3>
-<h4>Description</h4>
-<p>Authenticate a request.
-
-This function should be called in response to a HTTP_UNAUTHORIZED
-status, prior to resubmitting your request.
-
-</p>
-<h4>Syntax</h4>
-<pre>
-int
-cupsDoAuthentication(
-    <a href='#http_t'>http_t</a> * http,
-    const <a href='#char'>char</a> * method,
-    const <a href='#char'>char</a> * resource);
-</pre>
-<h4>Arguments</h4>
-<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
-<thead><tr><th>Name</th><th>Description</th></tr></thead>
-<tbody>
-<tr><td><tt>http</tt></td><td>HTTP connection to server</td></tr>
-<tr><td><tt>method</tt></td><td>Request method (GET, POST, PUT)</td></tr>
-<tr><td><tt>resource</tt></td><td>Resource path</td></tr>
-</tbody></table></div>
-<h4>Returns</h4>
-<p>0 on success, -1 on error</p>
-<!-- NEW PAGE -->
-<h3 class='title'><a name='cupsDoFileRequest'>cupsDoFileRequest()</a></h3>
-<h4>Description</h4>
-<p>Do an IPP request.
-
-This function sends any IPP request to the specified server, retrying
-and authenticating as necessary.</p>
-<h4>Syntax</h4>
-<pre>
-<a href='#ipp_t'>ipp_t</a> *
-cupsDoFileRequest(
-    <a href='#http_t'>http_t</a> * http,
-    <a href='#ipp_t'>ipp_t</a> * request,
-    const <a href='#char'>char</a> * resource,
-    const <a href='#char'>char</a> * filename);
-</pre>
-<h4>Arguments</h4>
-<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
-<thead><tr><th>Name</th><th>Description</th></tr></thead>
-<tbody>
-<tr><td><tt>http</tt></td><td>HTTP connection to server</td></tr>
-<tr><td><tt>request</tt></td><td>IPP request</td></tr>
-<tr><td><tt>resource</tt></td><td>HTTP resource for POST</td></tr>
-<tr><td><tt>filename</tt></td><td>File to send or NULL for none</td></tr>
-</tbody></table></div>
-<h4>Returns</h4>
-<p>Response data</p>
-<!-- NEW PAGE -->
-<h3 class='title'><a name='cupsEncodeOptions'>cupsEncodeOptions()</a></h3>
-<h4>Description</h4>
-<p>Encode printer options into IPP attributes.
-
-This function adds operation, job, and then subscription attributes,
-in that order. Use the cupsEncodeOptions2() function to add attributes
-for a single group.</p>
-<h4>Syntax</h4>
-<pre>
-void
-cupsEncodeOptions(
-    <a href='#ipp_t'>ipp_t</a> * ipp,
-    int num_options,
-    <a href='#cups_option_t'>cups_option_t</a> * options);
-</pre>
-<h4>Arguments</h4>
-<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
-<thead><tr><th>Name</th><th>Description</th></tr></thead>
-<tbody>
-<tr><td><tt>ipp</tt></td><td>Request to add to</td></tr>
-<tr><td><tt>num_options</tt></td><td>Number of options</td></tr>
-<tr><td><tt>options</tt></td><td>Options</td></tr>
-</tbody></table></div>
-<h4>Returns</h4>
-<p>Nothing.</p>
-<!-- NEW PAGE -->
-<h3 class='title'><span class='info'>&nbsp;CUPS 1.2&nbsp;</span><a name='cupsEncodeOptions2'>cupsEncodeOptions2()</a></h3>
-<h4>Description</h4>
-<p>Encode printer options into IPP attributes for a group.
-
-This function only adds attributes for a single group. Call this
-function multiple times for each group, or use cupsEncodeOptions()
-to add the standard groups.
-
-</p>
-<h4>Syntax</h4>
-<pre>
-void
-cupsEncodeOptions2(
-    <a href='#ipp_t'>ipp_t</a> * ipp,
-    int num_options,
-    <a href='#cups_option_t'>cups_option_t</a> * options,
-    ipp_tag_t group_tag);
-</pre>
-<h4>Arguments</h4>
-<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
-<thead><tr><th>Name</th><th>Description</th></tr></thead>
-<tbody>
-<tr><td><tt>ipp</tt></td><td>Request to add to</td></tr>
-<tr><td><tt>num_options</tt></td><td>Number of options</td></tr>
-<tr><td><tt>options</tt></td><td>Options</td></tr>
-<tr><td><tt>group_tag</tt></td><td>Group to encode</td></tr>
-</tbody></table></div>
-<h4>Returns</h4>
-<p>Nothing.</p>
-<!-- NEW PAGE -->
-<h3 class='title'><a name='cupsEncryption'>cupsEncryption()</a></h3>
-<h4>Description</h4>
-<p>Get the default encryption settings.
-
-The default encryption setting comes from the CUPS_ENCRYPTION
-environment variable, then the ~/.cupsrc file, and finally the
-/etc/cups/client.conf file. If not set, the default is
-HTTP_ENCRYPT_IF_REQUESTED.</p>
-<h4>Syntax</h4>
-<pre>
-<a href='#http_encryption_t'>http_encryption_t</a>
-cupsEncryption(void);
-</pre>
-<h4>Arguments</h4>
-<p>None.</p>
-<h4>Returns</h4>
-<p>Encryption settings</p>
-<!-- NEW PAGE -->
-<h3 class='title'><a name='cupsFreeDests'>cupsFreeDests()</a></h3>
-<h4>Description</h4>
-<p>Free the memory used by the list of destinations.</p>
-<h4>Syntax</h4>
-<pre>
-void
-cupsFreeDests(
-    int num_dests,
-    <a href='#cups_dest_t'>cups_dest_t</a> * dests);
-</pre>
-<h4>Arguments</h4>
-<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
-<thead><tr><th>Name</th><th>Description</th></tr></thead>
-<tbody>
-<tr><td><tt>num_dests</tt></td><td>Number of destinations</td></tr>
-<tr><td><tt>dests</tt></td><td>Destinations</td></tr>
-</tbody></table></div>
-<h4>Returns</h4>
-<p>Nothing.</p>
-<!-- NEW PAGE -->
-<h3 class='title'><a name='cupsFreeJobs'>cupsFreeJobs()</a></h3>
-<h4>Description</h4>
-<p>Free memory used by job data.</p>
-<h4>Syntax</h4>
-<pre>
-void
-cupsFreeJobs(
-    int num_jobs,
-    <a href='#cups_job_t'>cups_job_t</a> * jobs);
-</pre>
-<h4>Arguments</h4>
-<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
-<thead><tr><th>Name</th><th>Description</th></tr></thead>
-<tbody>
-<tr><td><tt>num_jobs</tt></td><td>Number of jobs</td></tr>
-<tr><td><tt>jobs</tt></td><td>Jobs</td></tr>
-</tbody></table></div>
-<h4>Returns</h4>
-<p>Nothing.</p>
-<!-- NEW PAGE -->
-<h3 class='title'><a name='cupsFreeOptions'>cupsFreeOptions()</a></h3>
-<h4>Description</h4>
-<p>Free all memory used by options.</p>
-<h4>Syntax</h4>
-<pre>
-void
-cupsFreeOptions(
-    int num_options,
-    <a href='#cups_option_t'>cups_option_t</a> * options);
-</pre>
-<h4>Arguments</h4>
-<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
-<thead><tr><th>Name</th><th>Description</th></tr></thead>
-<tbody>
-<tr><td><tt>num_options</tt></td><td>Number of options</td></tr>
-<tr><td><tt>options</tt></td><td>Pointer to options</td></tr>
-</tbody></table></div>
-<h4>Returns</h4>
-<p>Nothing.</p>
-<!-- NEW PAGE -->
-<h3 class='title'><span class='info'>&nbsp;DEPRECATED&nbsp;</span><a name='cupsGetClasses'>cupsGetClasses()</a></h3>
-<h4>Description</h4>
-<p>Get a list of printer classes from the default server.
-
-This function is deprecated - use cupsGetDests() instead.
-
-</p>
-<h4>Syntax</h4>
-<pre>
-int
-cupsGetClasses(
-    <a href='#char'>char</a> *** classes);
-</pre>
-<h4>Arguments</h4>
-<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
-<thead><tr><th>Name</th><th>Description</th></tr></thead>
-<tbody>
-<tr><td><tt>classes</tt></td><td>Classes</td></tr>
-</tbody></table></div>
-<h4>Returns</h4>
-<p>Number of classes</p>
-<!-- NEW PAGE -->
-<h3 class='title'><a name='cupsGetDefault'>cupsGetDefault()</a></h3>
-<h4>Description</h4>
-<p>Get the default printer or class for the default server.
-
-This function returns the default printer or class as defined by
-the LPDEST or PRINTER environment variables. If these environment
-variables are not set, the server default destination is returned.
-Applications should use the cupsGetDests() and cupsGetDest() functions
-to get the user-defined default printer, as this function does not
-support the lpoptions-defined default printer.</p>
-<h4>Syntax</h4>
-<pre>
-const <a href='#char'>char</a> *
-cupsGetDefault(void);
-</pre>
-<h4>Arguments</h4>
-<p>None.</p>
-<h4>Returns</h4>
-<p>Default printer or NULL</p>
-<!-- NEW PAGE -->
-<h3 class='title'><span class='info'>&nbsp;CUPS 1.1.21&nbsp;</span><a name='cupsGetDefault2'>cupsGetDefault2()</a></h3>
-<h4>Description</h4>
-<p>Get the default printer or class for the specified server.
-
-This function returns the default printer or class as defined by
-the LPDEST or PRINTER environment variables. If these environment
-variables are not set, the server default destination is returned.
-Applications should use the cupsGetDests() and cupsGetDest() functions
-to get the user-defined default printer, as this function does not
-support the lpoptions-defined default printer.
-
-</p>
-<h4>Syntax</h4>
-<pre>
-const <a href='#char'>char</a> *
-cupsGetDefault2(
-    <a href='#http_t'>http_t</a> * http);
-</pre>
-<h4>Arguments</h4>
-<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
-<thead><tr><th>Name</th><th>Description</th></tr></thead>
-<tbody>
-<tr><td><tt>http</tt></td><td>HTTP connection</td></tr>
-</tbody></table></div>
-<h4>Returns</h4>
-<p>Default printer or NULL</p>
-<!-- NEW PAGE -->
-<h3 class='title'><a name='cupsGetDest'>cupsGetDest()</a></h3>
-<h4>Description</h4>
-<p>Get the named destination from the list.
-
-Use the cupsGetDests() or cupsGetDests2() functions to get a
-list of supported destinations for the current user.</p>
-<h4>Syntax</h4>
-<pre>
-<a href='#cups_dest_t'>cups_dest_t</a> *
-cupsGetDest(
-    const <a href='#char'>char</a> * name,
-    const <a href='#char'>char</a> * instance,
-    int num_dests,
-    <a href='#cups_dest_t'>cups_dest_t</a> * dests);
-</pre>
-<h4>Arguments</h4>
-<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
-<thead><tr><th>Name</th><th>Description</th></tr></thead>
-<tbody>
-<tr><td><tt>name</tt></td><td>Name of destination</td></tr>
-<tr><td><tt>instance</tt></td><td>Instance of destination</td></tr>
-<tr><td><tt>num_dests</tt></td><td>Number of destinations</td></tr>
-<tr><td><tt>dests</tt></td><td>Destinations</td></tr>
-</tbody></table></div>
-<h4>Returns</h4>
-<p>Destination pointer or NULL</p>
-<!-- NEW PAGE -->
-<h3 class='title'><a name='cupsGetDests'>cupsGetDests()</a></h3>
-<h4>Description</h4>
-<p>Get the list of destinations from the default server.</p>
-<h4>Syntax</h4>
-<pre>
-int
-cupsGetDests(
-    <a href='#cups_dest_t'>cups_dest_t</a> ** dests);
-</pre>
-<h4>Arguments</h4>
-<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
-<thead><tr><th>Name</th><th>Description</th></tr></thead>
-<tbody>
-<tr><td><tt>dests</tt></td><td>Destinations</td></tr>
-</tbody></table></div>
-<h4>Returns</h4>
-<p>Number of destinations</p>
-<!-- NEW PAGE -->
-<h3 class='title'><span class='info'>&nbsp;CUPS 1.1.21&nbsp;</span><a name='cupsGetDests2'>cupsGetDests2()</a></h3>
-<h4>Description</h4>
-<p>Get the list of destinations from the specified server.
-
-</p>
-<h4>Syntax</h4>
-<pre>
-int
-cupsGetDests2(
-    <a href='#http_t'>http_t</a> * http,
-    <a href='#cups_dest_t'>cups_dest_t</a> ** dests);
-</pre>
-<h4>Arguments</h4>
-<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
-<thead><tr><th>Name</th><th>Description</th></tr></thead>
-<tbody>
-<tr><td><tt>http</tt></td><td>HTTP connection</td></tr>
-<tr><td><tt>dests</tt></td><td>Destinations</td></tr>
-</tbody></table></div>
-<h4>Returns</h4>
-<p>Number of destinations</p>
-<!-- NEW PAGE -->
-<h3 class='title'><span class='info'>&nbsp;CUPS 1.1.20&nbsp;</span><a name='cupsGetFd'>cupsGetFd()</a></h3>
-<h4>Description</h4>
-<p>Get a file from the server.
-
-This function returns HTTP_OK when the file is successfully retrieved.
-
-</p>
-<h4>Syntax</h4>
-<pre>
-http_status_t
-cupsGetFd(
-    <a href='#http_t'>http_t</a> * http,
-    const <a href='#char'>char</a> * resource,
-    int fd);
-</pre>
-<h4>Arguments</h4>
-<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
-<thead><tr><th>Name</th><th>Description</th></tr></thead>
-<tbody>
-<tr><td><tt>http</tt></td><td>HTTP connection to server</td></tr>
-<tr><td><tt>resource</tt></td><td>Resource name</td></tr>
-<tr><td><tt>fd</tt></td><td>File descriptor</td></tr>
-</tbody></table></div>
-<h4>Returns</h4>
-<p>Status</p>
-<!-- NEW PAGE -->
-<h3 class='title'><span class='info'>&nbsp;CUPS 1.1.20&nbsp;</span><a name='cupsGetFile'>cupsGetFile()</a></h3>
-<h4>Description</h4>
-<p>Get a file from the server.
-
-This function returns HTTP_OK when the file is successfully retrieved.
-
-</p>
-<h4>Syntax</h4>
-<pre>
-http_status_t
-cupsGetFile(
-    <a href='#http_t'>http_t</a> * http,
-    const <a href='#char'>char</a> * resource,
-    const <a href='#char'>char</a> * filename);
-</pre>
-<h4>Arguments</h4>
-<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
-<thead><tr><th>Name</th><th>Description</th></tr></thead>
-<tbody>
-<tr><td><tt>http</tt></td><td>HTTP connection to server</td></tr>
-<tr><td><tt>resource</tt></td><td>Resource name</td></tr>
-<tr><td><tt>filename</tt></td><td>Filename</td></tr>
-</tbody></table></div>
-<h4>Returns</h4>
-<p>Status</p>
-<!-- NEW PAGE -->
-<h3 class='title'><a name='cupsGetJobs'>cupsGetJobs()</a></h3>
-<h4>Description</h4>
-<p>Get the jobs from the default server.</p>
-<h4>Syntax</h4>
-<pre>
-int
-cupsGetJobs(
-    <a href='#cups_job_t'>cups_job_t</a> ** jobs,
-    const <a href='#char'>char</a> * mydest,
-    int myjobs,
-    int completed);
-</pre>
-<h4>Arguments</h4>
-<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
-<thead><tr><th>Name</th><th>Description</th></tr></thead>
-<tbody>
-<tr><td><tt>jobs</tt></td><td>Job data</td></tr>
-<tr><td><tt>mydest</tt></td><td>Only show jobs for dest?</td></tr>
-<tr><td><tt>myjobs</tt></td><td>Only show my jobs?</td></tr>
-<tr><td><tt>completed</tt></td><td>Only show completed jobs?</td></tr>
-</tbody></table></div>
-<h4>Returns</h4>
-<p>Number of jobs</p>
-<!-- NEW PAGE -->
-<h3 class='title'><span class='info'>&nbsp;CUPS 1.1.21&nbsp;</span><a name='cupsGetJobs2'>cupsGetJobs2()</a></h3>
-<h4>Description</h4>
-<p>Get the jobs from the specified server.
-
-</p>
-<h4>Syntax</h4>
-<pre>
-int
-cupsGetJobs2(
-    <a href='#http_t'>http_t</a> * http,
-    <a href='#cups_job_t'>cups_job_t</a> ** jobs,
-    const <a href='#char'>char</a> * mydest,
-    int myjobs,
-    int completed);
-</pre>
-<h4>Arguments</h4>
-<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
-<thead><tr><th>Name</th><th>Description</th></tr></thead>
-<tbody>
-<tr><td><tt>http</tt></td><td>HTTP connection</td></tr>
-<tr><td><tt>jobs</tt></td><td>Job data</td></tr>
-<tr><td><tt>mydest</tt></td><td>Only show jobs for dest?</td></tr>
-<tr><td><tt>myjobs</tt></td><td>Only show my jobs?</td></tr>
-<tr><td><tt>completed</tt></td><td>Only show completed jobs?</td></tr>
-</tbody></table></div>
-<h4>Returns</h4>
-<p>Number of jobs</p>
-<!-- NEW PAGE -->
-<h3 class='title'><a name='cupsGetOption'>cupsGetOption()</a></h3>
-<h4>Description</h4>
-<p>Get an option value.</p>
-<h4>Syntax</h4>
-<pre>
-const <a href='#char'>char</a> *
-cupsGetOption(
-    const <a href='#char'>char</a> * name,
-    int num_options,
-    <a href='#cups_option_t'>cups_option_t</a> * options);
-</pre>
-<h4>Arguments</h4>
-<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
-<thead><tr><th>Name</th><th>Description</th></tr></thead>
-<tbody>
-<tr><td><tt>name</tt></td><td>Name of option</td></tr>
-<tr><td><tt>num_options</tt></td><td>Number of options</td></tr>
-<tr><td><tt>options</tt></td><td>Options</td></tr>
-</tbody></table></div>
-<h4>Returns</h4>
-<p>Option value or NULL</p>
-<!-- NEW PAGE -->
-<h3 class='title'><a name='cupsGetPPD'>cupsGetPPD()</a></h3>
-<h4>Description</h4>
-<p>Get the PPD file for a printer on the default server.
-
-For classes, cupsGetPPD() returns the PPD file for the first printer
-in the class.</p>
-<h4>Syntax</h4>
-<pre>
-const <a href='#char'>char</a> *
-cupsGetPPD(
-    const <a href='#char'>char</a> * name);
-</pre>
-<h4>Arguments</h4>
-<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
-<thead><tr><th>Name</th><th>Description</th></tr></thead>
-<tbody>
-<tr><td><tt>name</tt></td><td>Printer name</td></tr>
-</tbody></table></div>
-<h4>Returns</h4>
-<p>Filename for PPD file</p>
-<!-- NEW PAGE -->
-<h3 class='title'><span class='info'>&nbsp;CUPS 1.1.21&nbsp;</span><a name='cupsGetPPD2'>cupsGetPPD2()</a></h3>
-<h4>Description</h4>
-<p>Get the PPD file for a printer from the specified server.
-
-For classes, cupsGetPPD2() returns the PPD file for the first printer
-in the class.
-
-</p>
-<h4>Syntax</h4>
-<pre>
-const <a href='#char'>char</a> *
-cupsGetPPD2(
-    <a href='#http_t'>http_t</a> * http,
-    const <a href='#char'>char</a> * name);
-</pre>
-<h4>Arguments</h4>
-<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
-<thead><tr><th>Name</th><th>Description</th></tr></thead>
-<tbody>
-<tr><td><tt>http</tt></td><td>HTTP connection</td></tr>
-<tr><td><tt>name</tt></td><td>Printer name</td></tr>
-</tbody></table></div>
-<h4>Returns</h4>
-<p>Filename for PPD file</p>
-<!-- NEW PAGE -->
-<h3 class='title'><a name='cupsGetPassword'>cupsGetPassword()</a></h3>
-<h4>Description</h4>
-<p>Get a password from the user.
-
-Returns NULL if the user does not provide a password.</p>
-<h4>Syntax</h4>
-<pre>
-const <a href='#char'>char</a> *
-cupsGetPassword(
-    const <a href='#char'>char</a> * prompt);
-</pre>
-<h4>Arguments</h4>
-<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
-<thead><tr><th>Name</th><th>Description</th></tr></thead>
-<tbody>
-<tr><td><tt>prompt</tt></td><td>Prompt string</td></tr>
-</tbody></table></div>
-<h4>Returns</h4>
-<p>Password</p>
-<!-- NEW PAGE -->
-<h3 class='title'><span class='info'>&nbsp;DEPRECATED&nbsp;</span><a name='cupsGetPrinters'>cupsGetPrinters()</a></h3>
-<h4>Description</h4>
-<p>Get a list of printers from the default server.
-
-This function is deprecated - use cupsGetDests() instead.
-
-</p>
-<h4>Syntax</h4>
-<pre>
-int
-cupsGetPrinters(
-    <a href='#char'>char</a> *** printers);
-</pre>
-<h4>Arguments</h4>
-<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
-<thead><tr><th>Name</th><th>Description</th></tr></thead>
-<tbody>
-<tr><td><tt>printers</tt></td><td>Printers</td></tr>
-</tbody></table></div>
-<h4>Returns</h4>
-<p>Number of printers</p>
-<!-- NEW PAGE -->
-<h3 class='title'><a name='cupsLastError'>cupsLastError()</a></h3>
-<h4>Description</h4>
-<p>Return the last IPP status code.</p>
-<h4>Syntax</h4>
-<pre>
-ipp_status_t
-cupsLastError(void);
-</pre>
-<h4>Arguments</h4>
-<p>None.</p>
-<h4>Returns</h4>
-<p>IPP status code from last request</p>
-<!-- NEW PAGE -->
-<h3 class='title'><span class='info'>&nbsp;CUPS 1.2&nbsp;</span><a name='cupsLastErrorString'>cupsLastErrorString()</a></h3>
-<h4>Description</h4>
-<p>Return the last IPP status-message.
-
-</p>
-<h4>Syntax</h4>
-<pre>
-const <a href='#char'>char</a> *
-cupsLastErrorString(void);
-</pre>
-<h4>Arguments</h4>
-<p>None.</p>
-<h4>Returns</h4>
-<p>status-message text from last request</p>
-<!-- NEW PAGE -->
-<h3 class='title'><a name='cupsMarkOptions'>cupsMarkOptions()</a></h3>
-<h4>Description</h4>
-<p>Mark command-line options in a PPD file.</p>
-<h4>Syntax</h4>
-<pre>
-int
-cupsMarkOptions(
-    ppd_file_t * ppd,
-    int num_options,
-    <a href='#cups_option_t'>cups_option_t</a> * options);
-</pre>
-<h4>Arguments</h4>
-<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
-<thead><tr><th>Name</th><th>Description</th></tr></thead>
-<tbody>
-<tr><td><tt>ppd</tt></td><td>PPD file</td></tr>
-<tr><td><tt>num_options</tt></td><td>Number of options</td></tr>
-<tr><td><tt>options</tt></td><td>Options</td></tr>
-</tbody></table></div>
-<h4>Returns</h4>
-<p>1 if conflicting</p>
-<!-- NEW PAGE -->
-<h3 class='title'><a name='cupsParseOptions'>cupsParseOptions()</a></h3>
-<h4>Description</h4>
-<p>Parse options from a command-line argument.
-
-This function converts space-delimited name/value pairs according
-to the PAPI text option ABNF specification. Collection values
-(&quot;name={a=... b=... c=...}&quot;) are stored with the curley brackets
-intact - use cupsParseOptions() on the value to extract the collection
-attributes.</p>
-<h4>Syntax</h4>
-<pre>
-int
-cupsParseOptions(
-    const <a href='#char'>char</a> * arg,
-    int num_options,
-    <a href='#cups_option_t'>cups_option_t</a> ** options);
-</pre>
-<h4>Arguments</h4>
-<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
-<thead><tr><th>Name</th><th>Description</th></tr></thead>
-<tbody>
-<tr><td><tt>arg</tt></td><td>Argument to parse</td></tr>
-<tr><td><tt>num_options</tt></td><td>Number of options</td></tr>
-<tr><td><tt>options</tt></td><td>Options found</td></tr>
-</tbody></table></div>
-<h4>Returns</h4>
-<p>Number of options found</p>
-<!-- NEW PAGE -->
-<h3 class='title'><a name='cupsPrintFile'>cupsPrintFile()</a></h3>
-<h4>Description</h4>
-<p>Print a file to a printer or class on the default server.</p>
-<h4>Syntax</h4>
-<pre>
-int
-cupsPrintFile(
-    const <a href='#char'>char</a> * name,
-    const <a href='#char'>char</a> * filename,
-    const <a href='#char'>char</a> * title,
-    int num_options,
-    <a href='#cups_option_t'>cups_option_t</a> * options);
-</pre>
-<h4>Arguments</h4>
-<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
-<thead><tr><th>Name</th><th>Description</th></tr></thead>
-<tbody>
-<tr><td><tt>name</tt></td><td>Printer or class name</td></tr>
-<tr><td><tt>filename</tt></td><td>File to print</td></tr>
-<tr><td><tt>title</tt></td><td>Title of job</td></tr>
-<tr><td><tt>num_options</tt></td><td>Number of options</td></tr>
-<tr><td><tt>options</tt></td><td>Options</td></tr>
-</tbody></table></div>
-<h4>Returns</h4>
-<p>Job ID</p>
-<!-- NEW PAGE -->
-<h3 class='title'><span class='info'>&nbsp;CUPS 1.1.21&nbsp;</span><a name='cupsPrintFile2'>cupsPrintFile2()</a></h3>
-<h4>Description</h4>
-<p>Print a file to a printer or class on the specified server.
-
-</p>
-<h4>Syntax</h4>
-<pre>
-int
-cupsPrintFile2(
-    <a href='#http_t'>http_t</a> * http,
-    const <a href='#char'>char</a> * name,
-    const <a href='#char'>char</a> * filename,
-    const <a href='#char'>char</a> * title,
-    int num_options,
-    <a href='#cups_option_t'>cups_option_t</a> * options);
-</pre>
-<h4>Arguments</h4>
-<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
-<thead><tr><th>Name</th><th>Description</th></tr></thead>
-<tbody>
-<tr><td><tt>http</tt></td><td>HTTP connection</td></tr>
-<tr><td><tt>name</tt></td><td>Printer or class name</td></tr>
-<tr><td><tt>filename</tt></td><td>File to print</td></tr>
-<tr><td><tt>title</tt></td><td>Title of job</td></tr>
-<tr><td><tt>num_options</tt></td><td>Number of options</td></tr>
-<tr><td><tt>options</tt></td><td>Options</td></tr>
-</tbody></table></div>
-<h4>Returns</h4>
-<p>Job ID</p>
-<!-- NEW PAGE -->
-<h3 class='title'><a name='cupsPrintFiles'>cupsPrintFiles()</a></h3>
-<h4>Description</h4>
-<p>Print one or more files to a printer or class on the default server.</p>
-<h4>Syntax</h4>
-<pre>
-int
-cupsPrintFiles(
-    const <a href='#char'>char</a> * name,
-    int num_files,
-    const <a href='#char'>char</a> ** files,
-    const <a href='#char'>char</a> * title,
-    int num_options,
-    <a href='#cups_option_t'>cups_option_t</a> * options);
-</pre>
-<h4>Arguments</h4>
-<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
-<thead><tr><th>Name</th><th>Description</th></tr></thead>
-<tbody>
-<tr><td><tt>name</tt></td><td>Printer or class name</td></tr>
-<tr><td><tt>num_files</tt></td><td>Number of files</td></tr>
-<tr><td><tt>files</tt></td><td>File(s) to print</td></tr>
-<tr><td><tt>title</tt></td><td>Title of job</td></tr>
-<tr><td><tt>num_options</tt></td><td>Number of options</td></tr>
-<tr><td><tt>options</tt></td><td>Options</td></tr>
-</tbody></table></div>
-<h4>Returns</h4>
-<p>Job ID</p>
+       <li><a href='#ippAddIntegers'><tt>ippAddIntegers()</tt></a> </li>
+       <li><a href='#ippAddOctetString'><tt>ippAddOctetString()</tt></a> <span class='info'>&nbsp;CUPS 1.2&nbsp;</span></li>
+       <li><a href='#ippAddRange'><tt>ippAddRange()</tt></a> </li>
+       <li><a href='#ippAddRanges'><tt>ippAddRanges()</tt></a> </li>
+       <li><a href='#ippAddResolution'><tt>ippAddResolution()</tt></a> </li>
+       <li><a href='#ippAddResolutions'><tt>ippAddResolutions()</tt></a> </li>
+       <li><a href='#ippAddSeparator'><tt>ippAddSeparator()</tt></a> </li>
+       <li><a href='#ippAddString'><tt>ippAddString()</tt></a> </li>
+       <li><a href='#ippAddStrings'><tt>ippAddStrings()</tt></a> </li>
+       <li><a href='#ippDateToTime'><tt>ippDateToTime()</tt></a> </li>
+       <li><a href='#ippDelete'><tt>ippDelete()</tt></a> </li>
+       <li><a href='#ippDeleteAttribute'><tt>ippDeleteAttribute()</tt></a> <span class='info'>&nbsp;CUPS 1.1.19&nbsp;</span></li>
+       <li><a href='#ippErrorString'><tt>ippErrorString()</tt></a> </li>
+       <li><a href='#ippErrorValue'><tt>ippErrorValue()</tt></a> <span class='info'>&nbsp;CUPS 1.2&nbsp;</span></li>
+       <li><a href='#ippFindAttribute'><tt>ippFindAttribute()</tt></a> </li>
+       <li><a href='#ippFindNextAttribute'><tt>ippFindNextAttribute()</tt></a> </li>
+       <li><a href='#ippLength'><tt>ippLength()</tt></a> </li>
+       <li><a href='#ippNew'><tt>ippNew()</tt></a> </li>
+       <li><a href='#ippNewRequest'><tt>ippNewRequest()</tt></a> <span class='info'>&nbsp;CUPS 1.2&nbsp;</span></li>
+       <li><a href='#ippOpString'><tt>ippOpString()</tt></a> <span class='info'>&nbsp;CUPS 1.2&nbsp;</span></li>
+       <li><a href='#ippOpValue'><tt>ippOpValue()</tt></a> <span class='info'>&nbsp;CUPS 1.2&nbsp;</span></li>
+       <li><a href='#ippPort'><tt>ippPort()</tt></a> </li>
+       <li><a href='#ippRead'><tt>ippRead()</tt></a> </li>
+       <li><a href='#ippReadFile'><tt>ippReadFile()</tt></a> <span class='info'>&nbsp;CUPS 1.1.19&nbsp;</span></li>
+       <li><a href='#ippReadIO'><tt>ippReadIO()</tt></a> <span class='info'>&nbsp;CUPS 1.2&nbsp;</span></li>
+       <li><a href='#ippSetPort'><tt>ippSetPort()</tt></a> </li>
+       <li><a href='#ippTimeToDate'><tt>ippTimeToDate()</tt></a> </li>
+       <li><a href='#ippWrite'><tt>ippWrite()</tt></a> </li>
+       <li><a href='#ippWriteFile'><tt>ippWriteFile()</tt></a> <span class='info'>&nbsp;CUPS 1.1.19&nbsp;</span></li>
+       <li><a href='#ippWriteIO'><tt>ippWriteIO()</tt></a> <span class='info'>&nbsp;CUPS 1.2&nbsp;</span></li>
+</ul>
 <!-- NEW PAGE -->
-<h3 class='title'><span class='info'>&nbsp;CUPS 1.1.21&nbsp;</span><a name='cupsPrintFiles2'>cupsPrintFiles2()</a></h3>
+<h3 class='title'><span class='info'>&nbsp;CUPS 1.1.20&nbsp;</span><a name='cupsDoAuthentication'>cupsDoAuthentication()</a></h3>
 <h4>Description</h4>
-<p>Print one or more files to a printer or class on the specified server.
+<p>Authenticate a request.
+
+This function should be called in response to a HTTP_UNAUTHORIZED
+status, prior to resubmitting your request.
 
 </p>
 <h4>Syntax</h4>
 <pre>
 int
-cupsPrintFiles2(
+cupsDoAuthentication(
     <a href='#http_t'>http_t</a> * http,
-    const <a href='#char'>char</a> * name,
-    int num_files,
-    const <a href='#char'>char</a> ** files,
-    const <a href='#char'>char</a> * title,
-    int num_options,
-    <a href='#cups_option_t'>cups_option_t</a> * options);
+    const char * method,
+    const char * resource);
 </pre>
 <h4>Arguments</h4>
 <div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
 <thead><tr><th>Name</th><th>Description</th></tr></thead>
 <tbody>
-<tr><td><tt>http</tt></td><td>HTTP connection</td></tr>
-<tr><td><tt>name</tt></td><td>Printer or class name</td></tr>
-<tr><td><tt>num_files</tt></td><td>Number of files</td></tr>
-<tr><td><tt>files</tt></td><td>File(s) to print</td></tr>
-<tr><td><tt>title</tt></td><td>Title of job</td></tr>
-<tr><td><tt>num_options</tt></td><td>Number of options</td></tr>
-<tr><td><tt>options</tt></td><td>Options</td></tr>
+<tr><td><tt>http</tt></td><td>HTTP connection to server</td></tr>
+<tr><td><tt>method</tt></td><td>Request method (GET, POST, PUT)</td></tr>
+<tr><td><tt>resource</tt></td><td>Resource path</td></tr>
 </tbody></table></div>
 <h4>Returns</h4>
-<p>Job ID</p>
+<p>0 on success, -1 on error</p>
 <!-- NEW PAGE -->
-<h3 class='title'><span class='info'>&nbsp;CUPS 1.1.20&nbsp;</span><a name='cupsPutFd'>cupsPutFd()</a></h3>
+<h3 class='title'><a name='cupsDoFileRequest'>cupsDoFileRequest()</a></h3>
 <h4>Description</h4>
-<p>Put a file on the server.
-
-This function returns HTTP_CREATED when the file is stored successfully.
+<p>Do an IPP request with a file.
 
-</p>
+This function sends the IPP request to the specified server, retrying
+and authenticating as necessary.  The request is freed with ippDelete()
+after receiving a valid IPP response.</p>
 <h4>Syntax</h4>
 <pre>
-http_status_t
-cupsPutFd(
+<a href='#ipp_t'>ipp_t</a> *
+cupsDoFileRequest(
     <a href='#http_t'>http_t</a> * http,
-    const <a href='#char'>char</a> * resource,
-    int fd);
+    <a href='#ipp_t'>ipp_t</a> * request,
+    const char * resource,
+    const char * filename);
 </pre>
 <h4>Arguments</h4>
 <div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
 <thead><tr><th>Name</th><th>Description</th></tr></thead>
 <tbody>
 <tr><td><tt>http</tt></td><td>HTTP connection to server</td></tr>
-<tr><td><tt>resource</tt></td><td>Resource name</td></tr>
-<tr><td><tt>fd</tt></td><td>File descriptor</td></tr>
+<tr><td><tt>request</tt></td><td>IPP request</td></tr>
+<tr><td><tt>resource</tt></td><td>HTTP resource for POST</td></tr>
+<tr><td><tt>filename</tt></td><td>File to send or NULL for none</td></tr>
 </tbody></table></div>
 <h4>Returns</h4>
-<p>Status</p>
+<p>Response data</p>
 <!-- NEW PAGE -->
-<h3 class='title'><span class='info'>&nbsp;CUPS 1.1.20&nbsp;</span><a name='cupsPutFile'>cupsPutFile()</a></h3>
+<h3 class='title'><a name='cupsDoRequest'>cupsDoRequest()</a></h3>
 <h4>Description</h4>
-<p>Put a file on the server.
-
-This function returns HTTP_CREATED when the file is stored successfully.
+<p>Do an IPP request.
 
-</p>
+This function sends the IPP request to the specified server, retrying
+and authenticating as necessary.  The request is freed with ippDelete()
+after receiving a valid IPP response.</p>
 <h4>Syntax</h4>
 <pre>
-http_status_t
-cupsPutFile(
+<a href='#ipp_t'>ipp_t</a> *
+cupsDoRequest(
     <a href='#http_t'>http_t</a> * http,
-    const <a href='#char'>char</a> * resource,
-    const <a href='#char'>char</a> * filename);
+    <a href='#ipp_t'>ipp_t</a> * request,
+    const char * resource);
 </pre>
 <h4>Arguments</h4>
 <div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
 <thead><tr><th>Name</th><th>Description</th></tr></thead>
 <tbody>
 <tr><td><tt>http</tt></td><td>HTTP connection to server</td></tr>
-<tr><td><tt>resource</tt></td><td>Resource name</td></tr>
-<tr><td><tt>filename</tt></td><td>Filename</td></tr>
+<tr><td><tt>request</tt></td><td>IPP request</td></tr>
+<tr><td><tt>resource</tt></td><td>HTTP resource for POST</td></tr>
 </tbody></table></div>
 <h4>Returns</h4>
-<p>Status</p>
-<!-- NEW PAGE -->
-<h3 class='title'><a name='cupsServer'>cupsServer()</a></h3>
-<h4>Description</h4>
-<p>Return the hostname/address of the default server.
-
-The returned value can be a fully-qualified hostname, a numeric
-IPv4 or IPv6 address, or a domain socket pathname.</p>
-<h4>Syntax</h4>
-<pre>
-const <a href='#char'>char</a> *
-cupsServer(void);
-</pre>
-<h4>Arguments</h4>
-<p>None.</p>
-<h4>Returns</h4>
-<p>Server name</p>
+<p>Response data</p>
 <!-- NEW PAGE -->
-<h3 class='title'><a name='cupsSetDests'>cupsSetDests()</a></h3>
+<h3 class='title'><a name='cupsEncodeOptions'>cupsEncodeOptions()</a></h3>
 <h4>Description</h4>
-<p>Save the list of destinations for the default server.
+<p>Encode printer options into IPP attributes.
 
-This function saves the destinations to /etc/cups/lpoptions when run
-as root and ~/.lpoptions when run as a normal user.</p>
+This function adds operation, job, and then subscription attributes,
+in that order. Use the cupsEncodeOptions2() function to add attributes
+for a single group.</p>
 <h4>Syntax</h4>
 <pre>
 void
-cupsSetDests(
-    int num_dests,
-    <a href='#cups_dest_t'>cups_dest_t</a> * dests);
+cupsEncodeOptions(
+    <a href='#ipp_t'>ipp_t</a> * ipp,
+    int num_options,
+    cups_option_t * options);
 </pre>
 <h4>Arguments</h4>
 <div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
 <thead><tr><th>Name</th><th>Description</th></tr></thead>
 <tbody>
-<tr><td><tt>num_dests</tt></td><td>Number of destinations</td></tr>
-<tr><td><tt>dests</tt></td><td>Destinations</td></tr>
+<tr><td><tt>ipp</tt></td><td>Request to add to</td></tr>
+<tr><td><tt>num_options</tt></td><td>Number of options</td></tr>
+<tr><td><tt>options</tt></td><td>Options</td></tr>
 </tbody></table></div>
 <h4>Returns</h4>
 <p>Nothing.</p>
 <!-- NEW PAGE -->
-<h3 class='title'><span class='info'>&nbsp;CUPS 1.1.21&nbsp;</span><a name='cupsSetDests2'>cupsSetDests2()</a></h3>
+<h3 class='title'><span class='info'>&nbsp;CUPS 1.2&nbsp;</span><a name='cupsEncodeOptions2'>cupsEncodeOptions2()</a></h3>
 <h4>Description</h4>
-<p>Save the list of destinations for the specified server.
+<p>Encode printer options into IPP attributes for a group.
 
-This function saves the destinations to /etc/cups/lpoptions when run
-as root and ~/.lpoptions when run as a normal user.
+This function only adds attributes for a single group. Call this
+function multiple times for each group, or use cupsEncodeOptions()
+to add the standard groups.
 
 </p>
 <h4>Syntax</h4>
 <pre>
-int
-cupsSetDests2(
-    <a href='#http_t'>http_t</a> * http,
-    int num_dests,
-    <a href='#cups_dest_t'>cups_dest_t</a> * dests);
-</pre>
-<h4>Arguments</h4>
-<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
-<thead><tr><th>Name</th><th>Description</th></tr></thead>
-<tbody>
-<tr><td><tt>http</tt></td><td>HTTP connection</td></tr>
-<tr><td><tt>num_dests</tt></td><td>Number of destinations</td></tr>
-<tr><td><tt>dests</tt></td><td>Destinations</td></tr>
-</tbody></table></div>
-<h4>Returns</h4>
-<p>0 on success, -1 on error</p>
-<!-- NEW PAGE -->
-<h3 class='title'><a name='cupsSetEncryption'>cupsSetEncryption()</a></h3>
-<h4>Description</h4>
-<p>Set the encryption preference.</p>
-<h4>Syntax</h4>
-<pre>
-void
-cupsSetEncryption(
-    <a href='#http_encryption_t'>http_encryption_t</a> e);
-</pre>
-<h4>Arguments</h4>
-<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
-<thead><tr><th>Name</th><th>Description</th></tr></thead>
-<tbody>
-<tr><td><tt>e</tt></td><td>New encryption preference</td></tr>
-</tbody></table></div>
-<h4>Returns</h4>
-<p>Nothing.</p>
-<!-- NEW PAGE -->
-<h3 class='title'><a name='cupsSetPasswordCB'>cupsSetPasswordCB()</a></h3>
-<h4>Description</h4>
-<p>Set the password callback for CUPS.
-
-Pass NULL to restore the default (console) password callback.</p>
-<h4>Syntax</h4>
-<pre>
-void
-cupsSetPasswordCB(
-    cups_password_cb_t cb);
-</pre>
-<h4>Arguments</h4>
-<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
-<thead><tr><th>Name</th><th>Description</th></tr></thead>
-<tbody>
-<tr><td><tt>cb</tt></td><td>Callback function</td></tr>
-</tbody></table></div>
-<h4>Returns</h4>
-<p>Nothing.</p>
-<!-- NEW PAGE -->
-<h3 class='title'><a name='cupsSetServer'>cupsSetServer()</a></h3>
-<h4>Description</h4>
-<p>Set the default server name.
-
-The &quot;server&quot; string can be a fully-qualified hostname, a numeric
-IPv4 or IPv6 address, or a domain socket pathname. Pass NULL to
-restore the default server name.</p>
-<h4>Syntax</h4>
-<pre>
-void
-cupsSetServer(
-    const <a href='#char'>char</a> * server);
-</pre>
-<h4>Arguments</h4>
-<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
-<thead><tr><th>Name</th><th>Description</th></tr></thead>
-<tbody>
-<tr><td><tt>server</tt></td><td>Server name</td></tr>
-</tbody></table></div>
-<h4>Returns</h4>
-<p>Nothing.</p>
-<!-- NEW PAGE -->
-<h3 class='title'><a name='cupsSetUser'>cupsSetUser()</a></h3>
-<h4>Description</h4>
-<p>Set the default user name.
-
-Pass NULL to restore the default user name.</p>
-<h4>Syntax</h4>
-<pre>
 void
-cupsSetUser(
-    const <a href='#char'>char</a> * user);
+cupsEncodeOptions2(
+    <a href='#ipp_t'>ipp_t</a> * ipp,
+    int num_options,
+    cups_option_t * options,
+    ipp_tag_t group_tag);
 </pre>
 <h4>Arguments</h4>
 <div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
 <thead><tr><th>Name</th><th>Description</th></tr></thead>
 <tbody>
-<tr><td><tt>user</tt></td><td>User name</td></tr>
+<tr><td><tt>ipp</tt></td><td>Request to add to</td></tr>
+<tr><td><tt>num_options</tt></td><td>Number of options</td></tr>
+<tr><td><tt>options</tt></td><td>Options</td></tr>
+<tr><td><tt>group_tag</tt></td><td>Group to encode</td></tr>
 </tbody></table></div>
 <h4>Returns</h4>
 <p>Nothing.</p>
 <!-- NEW PAGE -->
-<h3 class='title'><a name='cupsUser'>cupsUser()</a></h3>
-<h4>Description</h4>
-<p>Return the current user's name.</p>
-<h4>Syntax</h4>
-<pre>
-const <a href='#char'>char</a> *
-cupsUser(void);
-</pre>
-<h4>Arguments</h4>
-<p>None.</p>
-<h4>Returns</h4>
-<p>User name</p>
-<!-- NEW PAGE -->
 <h3 class='title'><span class='info'>&nbsp;CUPS 1.2&nbsp;</span><a name='httpAddrAny'>httpAddrAny()</a></h3>
 <h4>Description</h4>
 <p>Check for the &quot;any&quot; address.
@@ -1446,7 +620,7 @@ httpAddrEqual(
 <tr><td><tt>addr2</tt></td><td>Second address</td></tr>
 </tbody></table></div>
 <h4>Returns</h4>
-<p>1 if equal, 0 if !=</p>
+<p>1 if equal, 0 if not</p>
 <!-- NEW PAGE -->
 <h3 class='title'><span class='info'>&nbsp;CUPS 1.2&nbsp;</span><a name='httpAddrLength'>httpAddrLength()</a></h3>
 <h4>Description</h4>
@@ -1495,10 +669,10 @@ httpAddrLocalhost(
 </p>
 <h4>Syntax</h4>
 <pre>
-<a href='#char'>char</a> *
+char *
 httpAddrLookup(
     const <a href='#http_addr_t'>http_addr_t</a> * addr,
-    <a href='#char'>char</a> * name,
+    char * name,
     int namelen);
 </pre>
 <h4>Arguments</h4>
@@ -1514,15 +688,15 @@ httpAddrLookup(
 <!-- NEW PAGE -->
 <h3 class='title'><span class='info'>&nbsp;CUPS 1.2&nbsp;</span><a name='httpAddrString'>httpAddrString()</a></h3>
 <h4>Description</h4>
-<p>Convert an IP address to a dotted string.
+<p>Convert an address to a numeric string.
 
 </p>
 <h4>Syntax</h4>
 <pre>
-<a href='#char'>char</a> *
+char *
 httpAddrString(
     const <a href='#http_addr_t'>http_addr_t</a> * addr,
-    <a href='#char'>char</a> * s,
+    char * s,
     int slen);
 </pre>
 <h4>Arguments</h4>
@@ -1534,34 +708,37 @@ httpAddrString(
 <tr><td><tt>slen</tt></td><td>Length of string</td></tr>
 </tbody></table></div>
 <h4>Returns</h4>
-<p>IP string</p>
+<p>Numeric address string</p>
 <!-- NEW PAGE -->
 <h3 class='title'><span class='info'>&nbsp;CUPS 1.2&nbsp;</span><a name='httpAssembleURI'>httpAssembleURI()</a></h3>
 <h4>Description</h4>
 <p>Assemble a uniform resource identifier from its
 components.
 
-This function properly escapes all reserved characters in a URI.  You
-should use this function in place of traditional string functions
-whenever you need to create a URI string.
+This function escapes reserved characters in the URI depending on the
+value of the &quot;encoding&quot; argument.  You should use this function in
+place of traditional string functions whenever you need to create a
+URI string.
 
 </p>
 <h4>Syntax</h4>
 <pre>
 http_uri_status_t
 httpAssembleURI(
-    <a href='#char'>char</a> * uri,
+    http_uri_coding_t encoding,
+    char * uri,
     int urilen,
-    const <a href='#char'>char</a> * scheme,
-    const <a href='#char'>char</a> * username,
-    const <a href='#char'>char</a> * host,
+    const char * scheme,
+    const char * username,
+    const char * host,
     int port,
-    const <a href='#char'>char</a> * resource);
+    const char * resource);
 </pre>
 <h4>Arguments</h4>
 <div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
 <thead><tr><th>Name</th><th>Description</th></tr></thead>
 <tbody>
+<tr><td><tt>encoding</tt></td><td>Encoding flags</td></tr>
 <tr><td><tt>uri</tt></td><td>URI buffer</td></tr>
 <tr><td><tt>urilen</tt></td><td>Size of URI buffer</td></tr>
 <tr><td><tt>scheme</tt></td><td>Scheme name</td></tr>
@@ -1579,28 +756,31 @@ httpAssembleURI(
 components with a formatted resource.
 
 This function creates a formatted version of the resource string
-argument &quot;resourcef&quot; and properly escapes all reserved characters
-in a URI.  You should use this function in place of traditional
-string functions whenever you need to create a URI string.
+argument &quot;resourcef&quot; and escapes reserved characters in the URI
+depending on the value of the &quot;encoding&quot; argument.  You should use
+this function in place of traditional string functions whenever
+you need to create a URI string.
 
 </p>
 <h4>Syntax</h4>
 <pre>
 http_uri_status_t
 httpAssembleURIf(
-    <a href='#char'>char</a> * uri,
+    http_uri_coding_t encoding,
+    char * uri,
     int urilen,
-    const <a href='#char'>char</a> * scheme,
-    const <a href='#char'>char</a> * username,
-    const <a href='#char'>char</a> * host,
+    const char * scheme,
+    const char * username,
+    const char * host,
     int port,
-    const <a href='#char'>char</a> * resourcef,
+    const char * resourcef,
     ...);
 </pre>
 <h4>Arguments</h4>
 <div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
 <thead><tr><th>Name</th><th>Description</th></tr></thead>
 <tbody>
+<tr><td><tt>encoding</tt></td><td>Encoding flags</td></tr>
 <tr><td><tt>uri</tt></td><td>URI buffer</td></tr>
 <tr><td><tt>urilen</tt></td><td>Size of URI buffer</td></tr>
 <tr><td><tt>scheme</tt></td><td>Scheme name</td></tr>
@@ -1613,6 +793,26 @@ httpAssembleURIf(
 <h4>Returns</h4>
 <p>URI status</p>
 <!-- NEW PAGE -->
+<h3 class='title'><a name='httpBlocking'>httpBlocking()</a></h3>
+<h4>Description</h4>
+<p>Set blocking/non-blocking behavior on a connection.</p>
+<h4>Syntax</h4>
+<pre>
+void
+httpBlocking(
+    <a href='#http_t'>http_t</a> * http,
+    int b);
+</pre>
+<h4>Arguments</h4>
+<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
+<thead><tr><th>Name</th><th>Description</th></tr></thead>
+<tbody>
+<tr><td><tt>http</tt></td><td>HTTP connection</td></tr>
+<tr><td><tt>b</tt></td><td>1 = blocking, 0 = non-blocking</td></tr>
+</tbody></table></div>
+<h4>Returns</h4>
+<p>Nothing.</p>
+<!-- NEW PAGE -->
 <h3 class='title'><a name='httpCheck'>httpCheck()</a></h3>
 <h4>Description</h4>
 <p>Check to see if there is a pending response from the server.</p>
@@ -1646,7 +846,25 @@ httpClearCookie(
 <div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
 <thead><tr><th>Name</th><th>Description</th></tr></thead>
 <tbody>
-<tr><td><tt>http</tt></td><td>Connection</td></tr>
+<tr><td><tt>http</tt></td><td>HTTP connection</td></tr>
+</tbody></table></div>
+<h4>Returns</h4>
+<p>Nothing.</p>
+<!-- NEW PAGE -->
+<h3 class='title'><a name='httpClearFields'>httpClearFields()</a></h3>
+<h4>Description</h4>
+<p>Clear HTTP request fields.</p>
+<h4>Syntax</h4>
+<pre>
+void
+httpClearFields(
+    <a href='#http_t'>http_t</a> * http);
+</pre>
+<h4>Arguments</h4>
+<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
+<thead><tr><th>Name</th><th>Description</th></tr></thead>
+<tbody>
+<tr><td><tt>http</tt></td><td>HTTP connection</td></tr>
 </tbody></table></div>
 <h4>Returns</h4>
 <p>Nothing.</p>
@@ -1664,7 +882,7 @@ httpClose(
 <div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
 <thead><tr><th>Name</th><th>Description</th></tr></thead>
 <tbody>
-<tr><td><tt>http</tt></td><td>Connection to close</td></tr>
+<tr><td><tt>http</tt></td><td>HTTP connection</td></tr>
 </tbody></table></div>
 <h4>Returns</h4>
 <p>Nothing.</p>
@@ -1676,7 +894,7 @@ httpClose(
 <pre>
 <a href='#http_t'>http_t</a> *
 httpConnect(
-    const <a href='#char'>char</a> * host,
+    const char * host,
     int port);
 </pre>
 <h4>Arguments</h4>
@@ -1696,7 +914,7 @@ httpConnect(
 <pre>
 <a href='#http_t'>http_t</a> *
 httpConnectEncrypt(
-    const <a href='#char'>char</a> * host,
+    const char * host,
     int port,
     <a href='#http_encryption_t'>http_encryption_t</a> encryption);
 </pre>
@@ -1711,15 +929,20 @@ httpConnectEncrypt(
 <h4>Returns</h4>
 <p>New HTTP connection</p>
 <!-- NEW PAGE -->
-<h3 class='title'><a name='httpDecode64'>httpDecode64()</a></h3>
+<h3 class='title'><span class='info'>&nbsp;DEPRECATED&nbsp;</span><a name='httpDecode64'>httpDecode64()</a></h3>
 <h4>Description</h4>
-<p>Base64-decode a string.</p>
+<p>Base64-decode a string.
+
+This function is deprecated. Use the httpDecode64_2() function instead
+which provides buffer length arguments.
+
+</p>
 <h4>Syntax</h4>
 <pre>
-<a href='#char'>char</a> *
+char *
 httpDecode64(
-    <a href='#char'>char</a> * out,
-    const <a href='#char'>char</a> * in);
+    char * out,
+    const char * in);
 </pre>
 <h4>Arguments</h4>
 <div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
@@ -1738,11 +961,11 @@ httpDecode64(
 </p>
 <h4>Syntax</h4>
 <pre>
-<a href='#char'>char</a> *
+char *
 httpDecode64_2(
-    <a href='#char'>char</a> * out,
+    char * out,
     int * outlen,
-    const <a href='#char'>char</a> * in);
+    const char * in);
 </pre>
 <h4>Arguments</h4>
 <div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
@@ -1763,27 +986,32 @@ httpDecode64_2(
 int
 httpDelete(
     <a href='#http_t'>http_t</a> * http,
-    const <a href='#char'>char</a> * uri);
+    const char * uri);
 </pre>
 <h4>Arguments</h4>
 <div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
 <thead><tr><th>Name</th><th>Description</th></tr></thead>
 <tbody>
-<tr><td><tt>http</tt></td><td>HTTP data</td></tr>
+<tr><td><tt>http</tt></td><td>HTTP connection</td></tr>
 <tr><td><tt>uri</tt></td><td>URI to delete</td></tr>
 </tbody></table></div>
 <h4>Returns</h4>
 <p>Status of call (0 = success)</p>
 <!-- NEW PAGE -->
-<h3 class='title'><a name='httpEncode64'>httpEncode64()</a></h3>
+<h3 class='title'><span class='info'>&nbsp;DEPRECATED&nbsp;</span><a name='httpEncode64'>httpEncode64()</a></h3>
 <h4>Description</h4>
-<p>Base64-encode a string.</p>
+<p>Base64-encode a string.
+
+This function is deprecated. Use the httpEncode64_2() function instead
+which provides buffer length arguments.
+
+</p>
 <h4>Syntax</h4>
 <pre>
-<a href='#char'>char</a> *
+char *
 httpEncode64(
-    <a href='#char'>char</a> * out,
-    const <a href='#char'>char</a> * in);
+    char * out,
+    const char * in);
 </pre>
 <h4>Arguments</h4>
 <div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
@@ -1802,11 +1030,11 @@ httpEncode64(
 </p>
 <h4>Syntax</h4>
 <pre>
-<a href='#char'>char</a> *
+char *
 httpEncode64_2(
-    <a href='#char'>char</a> * out,
+    char * out,
     int outlen,
-    const <a href='#char'>char</a> * in,
+    const char * in,
     int inlen);
 </pre>
 <h4>Arguments</h4>
@@ -1835,12 +1063,30 @@ httpEncryption(
 <div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
 <thead><tr><th>Name</th><th>Description</th></tr></thead>
 <tbody>
-<tr><td><tt>http</tt></td><td>HTTP data</td></tr>
+<tr><td><tt>http</tt></td><td>HTTP connection</td></tr>
 <tr><td><tt>e</tt></td><td>New encryption preference</td></tr>
 </tbody></table></div>
 <h4>Returns</h4>
 <p>-1 on error, 0 on success</p>
 <!-- NEW PAGE -->
+<h3 class='title'><a name='httpError'>httpError()</a></h3>
+<h4>Description</h4>
+<p>Get the last error on a connection.</p>
+<h4>Syntax</h4>
+<pre>
+int
+httpError(
+    <a href='#http_t'>http_t</a> * http);
+</pre>
+<h4>Arguments</h4>
+<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
+<thead><tr><th>Name</th><th>Description</th></tr></thead>
+<tbody>
+<tr><td><tt>http</tt></td><td>HTTP connection</td></tr>
+</tbody></table></div>
+<h4>Returns</h4>
+<p>Error code (errno) value</p>
+<!-- NEW PAGE -->
 <h3 class='title'><a name='httpFlush'>httpFlush()</a></h3>
 <h4>Description</h4>
 <p>Flush data from a HTTP connection.</p>
@@ -1854,7 +1100,7 @@ httpFlush(
 <div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
 <thead><tr><th>Name</th><th>Description</th></tr></thead>
 <tbody>
-<tr><td><tt>http</tt></td><td>HTTP data</td></tr>
+<tr><td><tt>http</tt></td><td>HTTP connection</td></tr>
 </tbody></table></div>
 <h4>Returns</h4>
 <p>Nothing.</p>
@@ -1874,30 +1120,68 @@ httpFlushWrite(
 <div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
 <thead><tr><th>Name</th><th>Description</th></tr></thead>
 <tbody>
-<tr><td><tt>http</tt></td><td>HTTP data</td></tr>
+<tr><td><tt>http</tt></td><td>HTTP connection</td></tr>
+</tbody></table></div>
+<h4>Returns</h4>
+<p>Bytes written or -1 on error</p>
+<!-- NEW PAGE -->
+<h3 class='title'><a name='httpGet'>httpGet()</a></h3>
+<h4>Description</h4>
+<p>Send a GET request to the server.</p>
+<h4>Syntax</h4>
+<pre>
+int
+httpGet(
+    <a href='#http_t'>http_t</a> * http,
+    const char * uri);
+</pre>
+<h4>Arguments</h4>
+<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
+<thead><tr><th>Name</th><th>Description</th></tr></thead>
+<tbody>
+<tr><td><tt>http</tt></td><td>HTTP connection</td></tr>
+<tr><td><tt>uri</tt></td><td>URI to get</td></tr>
+</tbody></table></div>
+<h4>Returns</h4>
+<p>Status of call (0 = success)</p>
+<!-- NEW PAGE -->
+<h3 class='title'><span class='info'>&nbsp;CUPS 1.2&nbsp;</span><a name='httpGetBlocking'>httpGetBlocking()</a></h3>
+<h4>Description</h4>
+<p>Get the blocking/non-block state of a connection.
+
+</p>
+<h4>Syntax</h4>
+<pre>
+int
+httpGetBlocking(
+    <a href='#http_t'>http_t</a> * http);
+</pre>
+<h4>Arguments</h4>
+<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
+<thead><tr><th>Name</th><th>Description</th></tr></thead>
+<tbody>
+<tr><td><tt>http</tt></td><td>HTTP connection</td></tr>
 </tbody></table></div>
 <h4>Returns</h4>
-<p>Bytes written or -1 on error</p>
+<p>1 if blocking, 0 if non-blocking</p>
 <!-- NEW PAGE -->
-<h3 class='title'><a name='httpGet'>httpGet()</a></h3>
+<h3 class='title'><a name='httpGetCookie'>httpGetCookie()</a></h3>
 <h4>Description</h4>
-<p>Send a GET request to the server.</p>
+<p>Get any cookie data from the response.</p>
 <h4>Syntax</h4>
 <pre>
-int
-httpGet(
-    <a href='#http_t'>http_t</a> * http,
-    const <a href='#char'>char</a> * uri);
+const char *
+httpGetCookie(
+    <a href='#http_t'>http_t</a> * http);
 </pre>
 <h4>Arguments</h4>
 <div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
 <thead><tr><th>Name</th><th>Description</th></tr></thead>
 <tbody>
-<tr><td><tt>http</tt></td><td>HTTP data</td></tr>
-<tr><td><tt>uri</tt></td><td>URI to get</td></tr>
+<tr><td><tt>http</tt></td><td>HTTP connecion</td></tr>
 </tbody></table></div>
 <h4>Returns</h4>
-<p>Status of call (0 = success)</p>
+<p>Cookie data or NULL</p>
 <!-- NEW PAGE -->
 <h3 class='title'><span class='info'>&nbsp;DEPRECATED&nbsp;</span><a name='httpGetDateString'>httpGetDateString()</a></h3>
 <h4>Description</h4>
@@ -1906,7 +1190,7 @@ httpGet(
 </p>
 <h4>Syntax</h4>
 <pre>
-const <a href='#char'>char</a> *
+const char *
 httpGetDateString(
     time_t t);
 </pre>
@@ -1926,10 +1210,10 @@ httpGetDateString(
 </p>
 <h4>Syntax</h4>
 <pre>
-const <a href='#char'>char</a> *
+const char *
 httpGetDateString2(
     time_t t,
-    <a href='#char'>char</a> * s,
+    char * s,
     int slen);
 </pre>
 <h4>Arguments</h4>
@@ -1950,7 +1234,7 @@ httpGetDateString2(
 <pre>
 time_t
 httpGetDateTime(
-    const <a href='#char'>char</a> * s);
+    const char * s);
 </pre>
 <h4>Arguments</h4>
 <div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
@@ -1961,6 +1245,46 @@ httpGetDateTime(
 <h4>Returns</h4>
 <p>UNIX time</p>
 <!-- NEW PAGE -->
+<h3 class='title'><span class='info'>&nbsp;CUPS 1.2&nbsp;</span><a name='httpGetFd'>httpGetFd()</a></h3>
+<h4>Description</h4>
+<p>Get the file descriptor associated with a connection.
+
+</p>
+<h4>Syntax</h4>
+<pre>
+int
+httpGetFd(
+    <a href='#http_t'>http_t</a> * http);
+</pre>
+<h4>Arguments</h4>
+<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
+<thead><tr><th>Name</th><th>Description</th></tr></thead>
+<tbody>
+<tr><td><tt>http</tt></td><td>HTTP connection</td></tr>
+</tbody></table></div>
+<h4>Returns</h4>
+<p>File descriptor or -1 if none</p>
+<!-- NEW PAGE -->
+<h3 class='title'><a name='httpGetField'>httpGetField()</a></h3>
+<h4>Description</h4>
+<p>Get a field value from a request/response.</p>
+<h4>Syntax</h4>
+<pre>
+const char *
+httpGetField(
+    <a href='#http_t'>http_t</a> * http,
+    http_field_t field);
+</pre>
+<h4>Arguments</h4>
+<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
+<thead><tr><th>Name</th><th>Description</th></tr></thead>
+<tbody>
+<tr><td><tt>http</tt></td><td>HTTP connection</td></tr>
+<tr><td><tt>field</tt></td><td>Field to get</td></tr>
+</tbody></table></div>
+<h4>Returns</h4>
+<p>Field value</p>
+<!-- NEW PAGE -->
 <h3 class='title'><span class='info'>&nbsp;DEPRECATED&nbsp;</span><a name='httpGetHostByName'>httpGetHostByName()</a></h3>
 <h4>Description</h4>
 <p>Lookup a hostname or IPv4 address, and return
@@ -1971,7 +1295,7 @@ address records for the specified name.
 <pre>
 struct hostent *
 httpGetHostByName(
-    const <a href='#char'>char</a> * name);
+    const char * name);
 </pre>
 <h4>Arguments</h4>
 <div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
@@ -1992,9 +1316,9 @@ get the local hostname with domain.
 </p>
 <h4>Syntax</h4>
 <pre>
-const <a href='#char'>char</a> *
+const char *
 httpGetHostname(
-    <a href='#char'>char</a> * s,
+    char * s,
     int slen);
 </pre>
 <h4>Arguments</h4>
@@ -2007,7 +1331,7 @@ httpGetHostname(
 <h4>Returns</h4>
 <p>FQDN for this system</p>
 <!-- NEW PAGE -->
-<h3 class='title'><span class='info'>&nbsp;CUPS 1.2&nbsp;</span><a name='httpGetLength'>httpGetLength()</a></h3>
+<h3 class='title'><span class='info'>&nbsp;DEPRECATED&nbsp;</span><a name='httpGetLength'>httpGetLength()</a></h3>
 <h4>Description</h4>
 <p>Get the amount of data remaining from the
 content-length or transfer-encoding fields.
@@ -2026,18 +1350,20 @@ httpGetLength(
 <div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
 <thead><tr><th>Name</th><th>Description</th></tr></thead>
 <tbody>
-<tr><td><tt>http</tt></td><td>HTTP data</td></tr>
+<tr><td><tt>http</tt></td><td>HTTP connection</td></tr>
 </tbody></table></div>
 <h4>Returns</h4>
 <p>Content length</p>
 <!-- NEW PAGE -->
-<h3 class='title'><a name='httpGetLength2'>httpGetLength2()</a></h3>
+<h3 class='title'><span class='info'>&nbsp;CUPS 1.2&nbsp;</span><a name='httpGetLength2'>httpGetLength2()</a></h3>
 <h4>Description</h4>
 <p>Get the amount of data remaining from the
 content-length or transfer-encoding fields.
 
 This function returns the complete content length, even for
-content larger than 2^31 - 1.</p>
+content larger than 2^31 - 1.
+
+</p>
 <h4>Syntax</h4>
 <pre>
 off_t
@@ -2048,11 +1374,31 @@ httpGetLength2(
 <div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
 <thead><tr><th>Name</th><th>Description</th></tr></thead>
 <tbody>
-<tr><td><tt>http</tt></td><td>HTTP data</td></tr>
+<tr><td><tt>http</tt></td><td>HTTP connection</td></tr>
 </tbody></table></div>
 <h4>Returns</h4>
 <p>Content length</p>
 <!-- NEW PAGE -->
+<h3 class='title'><span class='info'>&nbsp;CUPS 1.2&nbsp;</span><a name='httpGetStatus'>httpGetStatus()</a></h3>
+<h4>Description</h4>
+<p>Get the status of the last HTTP request.
+
+</p>
+<h4>Syntax</h4>
+<pre>
+http_status_t
+httpGetStatus(
+    <a href='#http_t'>http_t</a> * http);
+</pre>
+<h4>Arguments</h4>
+<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
+<thead><tr><th>Name</th><th>Description</th></tr></thead>
+<tbody>
+<tr><td><tt>http</tt></td><td>HTTP connection</td></tr>
+</tbody></table></div>
+<h4>Returns</h4>
+<p>HTTP status</p>
+<!-- NEW PAGE -->
 <h3 class='title'><span class='info'>&nbsp;DEPRECATED&nbsp;</span><a name='httpGetSubField'>httpGetSubField()</a></h3>
 <h4>Description</h4>
 <p>Get a sub-field value.
@@ -2060,18 +1406,18 @@ httpGetLength2(
 </p>
 <h4>Syntax</h4>
 <pre>
-<a href='#char'>char</a> *
+char *
 httpGetSubField(
     <a href='#http_t'>http_t</a> * http,
     http_field_t field,
-    const <a href='#char'>char</a> * name,
-    <a href='#char'>char</a> * value);
+    const char * name,
+    char * value);
 </pre>
 <h4>Arguments</h4>
 <div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
 <thead><tr><th>Name</th><th>Description</th></tr></thead>
 <tbody>
-<tr><td><tt>http</tt></td><td>HTTP data</td></tr>
+<tr><td><tt>http</tt></td><td>HTTP connection</td></tr>
 <tr><td><tt>field</tt></td><td>Field index</td></tr>
 <tr><td><tt>name</tt></td><td>Name of sub-field</td></tr>
 <tr><td><tt>value</tt></td><td>Value string</td></tr>
@@ -2086,19 +1432,19 @@ httpGetSubField(
 </p>
 <h4>Syntax</h4>
 <pre>
-<a href='#char'>char</a> *
+char *
 httpGetSubField2(
     <a href='#http_t'>http_t</a> * http,
     http_field_t field,
-    const <a href='#char'>char</a> * name,
-    <a href='#char'>char</a> * value,
+    const char * name,
+    char * value,
     int valuelen);
 </pre>
 <h4>Arguments</h4>
 <div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
 <thead><tr><th>Name</th><th>Description</th></tr></thead>
 <tbody>
-<tr><td><tt>http</tt></td><td>HTTP data</td></tr>
+<tr><td><tt>http</tt></td><td>HTTP connection</td></tr>
 <tr><td><tt>field</tt></td><td>Field index</td></tr>
 <tr><td><tt>name</tt></td><td>Name of sub-field</td></tr>
 <tr><td><tt>value</tt></td><td>Value string</td></tr>
@@ -2112,9 +1458,9 @@ httpGetSubField2(
 <p>Get a line of text from a HTTP connection.</p>
 <h4>Syntax</h4>
 <pre>
-<a href='#char'>char</a> *
+char *
 httpGets(
-    <a href='#char'>char</a> * line,
+    char * line,
     int length,
     <a href='#http_t'>http_t</a> * http);
 </pre>
@@ -2124,7 +1470,7 @@ httpGets(
 <tbody>
 <tr><td><tt>line</tt></td><td>Line to read into</td></tr>
 <tr><td><tt>length</tt></td><td>Max length of buffer</td></tr>
-<tr><td><tt>http</tt></td><td>HTTP data</td></tr>
+<tr><td><tt>http</tt></td><td>HTTP connection</td></tr>
 </tbody></table></div>
 <h4>Returns</h4>
 <p>Line or NULL</p>
@@ -2137,13 +1483,13 @@ httpGets(
 int
 httpHead(
     <a href='#http_t'>http_t</a> * http,
-    const <a href='#char'>char</a> * uri);
+    const char * uri);
 </pre>
 <h4>Arguments</h4>
 <div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
 <thead><tr><th>Name</th><th>Description</th></tr></thead>
 <tbody>
-<tr><td><tt>http</tt></td><td>HTTP data</td></tr>
+<tr><td><tt>http</tt></td><td>HTTP connection</td></tr>
 <tr><td><tt>uri</tt></td><td>URI for head</td></tr>
 </tbody></table></div>
 <h4>Returns</h4>
@@ -2168,12 +1514,12 @@ httpInitialize(void);
 <p>Compute the MD5 sum of the username:group:password.</p>
 <h4>Syntax</h4>
 <pre>
-<a href='#char'>char</a> *
+char *
 httpMD5(
-    const <a href='#char'>char</a> * username,
-    const <a href='#char'>char</a> * realm,
-    const <a href='#char'>char</a> * passwd,
-    <a href='#char'>char</a> md5[33]);
+    const char * username,
+    const char * realm,
+    const char * passwd,
+    char md5[33]);
 </pre>
 <h4>Arguments</h4>
 <div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
@@ -2194,12 +1540,12 @@ with the server-supplied nonce value, method, and
 request-uri.</p>
 <h4>Syntax</h4>
 <pre>
-<a href='#char'>char</a> *
+char *
 httpMD5Final(
-    const <a href='#char'>char</a> * nonce,
-    const <a href='#char'>char</a> * method,
-    const <a href='#char'>char</a> * resource,
-    <a href='#char'>char</a> md5[33]);
+    const char * nonce,
+    const char * method,
+    const char * resource,
+    char md5[33]);
 </pre>
 <h4>Arguments</h4>
 <div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
@@ -2218,10 +1564,10 @@ httpMD5Final(
 <p>Convert an MD5 sum to a character string.</p>
 <h4>Syntax</h4>
 <pre>
-<a href='#char'>char</a> *
+char *
 httpMD5String(
-    const unsigned <a href='#char'>char</a> * sum,
-    <a href='#char'>char</a> md5[33]);
+    const unsigned char * sum,
+    char md5[33]);
 </pre>
 <h4>Arguments</h4>
 <div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
@@ -2241,13 +1587,13 @@ httpMD5String(
 int
 httpOptions(
     <a href='#http_t'>http_t</a> * http,
-    const <a href='#char'>char</a> * uri);
+    const char * uri);
 </pre>
 <h4>Arguments</h4>
 <div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
 <thead><tr><th>Name</th><th>Description</th></tr></thead>
 <tbody>
-<tr><td><tt>http</tt></td><td>HTTP data</td></tr>
+<tr><td><tt>http</tt></td><td>HTTP connection</td></tr>
 <tr><td><tt>uri</tt></td><td>URI for options</td></tr>
 </tbody></table></div>
 <h4>Returns</h4>
@@ -2261,76 +1607,83 @@ httpOptions(
 int
 httpPost(
     <a href='#http_t'>http_t</a> * http,
-    const <a href='#char'>char</a> * uri);
+    const char * uri);
 </pre>
 <h4>Arguments</h4>
 <div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
 <thead><tr><th>Name</th><th>Description</th></tr></thead>
 <tbody>
-<tr><td><tt>http</tt></td><td>HTTP data</td></tr>
+<tr><td><tt>http</tt></td><td>HTTP connection</td></tr>
 <tr><td><tt>uri</tt></td><td>URI for post</td></tr>
 </tbody></table></div>
 <h4>Returns</h4>
 <p>Status of call (0 = success)</p>
 <!-- NEW PAGE -->
-<h3 class='title'><a name='httpPrintf'>httpPrintf()</a></h3>
+<h3 class='title'><a name='httpPut'>httpPut()</a></h3>
 <h4>Description</h4>
-<p>Print a formatted string to a HTTP connection.</p>
+<p>Send a PUT request to the server.</p>
 <h4>Syntax</h4>
 <pre>
 int
-httpPrintf(
+httpPut(
     <a href='#http_t'>http_t</a> * http,
-    const <a href='#char'>char</a> * format,
-    ...);
+    const char * uri);
 </pre>
 <h4>Arguments</h4>
 <div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
 <thead><tr><th>Name</th><th>Description</th></tr></thead>
 <tbody>
-<tr><td><tt>http</tt></td><td>HTTP data</td></tr>
-<tr><td><tt>format</tt></td><td>printf-style format string</td></tr>
-<tr><td><tt>...</tt></td><td>Additional args as needed</td></tr>
+<tr><td><tt>http</tt></td><td>HTTP connection</td></tr>
+<tr><td><tt>uri</tt></td><td>URI to put</td></tr>
 </tbody></table></div>
 <h4>Returns</h4>
-<p>Number of bytes written</p>
+<p>Status of call (0 = success)</p>
 <!-- NEW PAGE -->
-<h3 class='title'><a name='httpPut'>httpPut()</a></h3>
+<h3 class='title'><span class='info'>&nbsp;DEPRECATED&nbsp;</span><a name='httpRead'>httpRead()</a></h3>
 <h4>Description</h4>
-<p>Send a PUT request to the server.</p>
+<p>Read data from a HTTP connection.
+
+This function is deprecated. Use the httpRead2() function which can
+read more than 2GB of data.
+
+</p>
 <h4>Syntax</h4>
 <pre>
 int
-httpPut(
+httpRead(
     <a href='#http_t'>http_t</a> * http,
-    const <a href='#char'>char</a> * uri);
+    char * buffer,
+    int length);
 </pre>
 <h4>Arguments</h4>
 <div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
 <thead><tr><th>Name</th><th>Description</th></tr></thead>
 <tbody>
-<tr><td><tt>http</tt></td><td>HTTP data</td></tr>
-<tr><td><tt>uri</tt></td><td>URI to put</td></tr>
+<tr><td><tt>http</tt></td><td>HTTP connection</td></tr>
+<tr><td><tt>buffer</tt></td><td>Buffer for data</td></tr>
+<tr><td><tt>length</tt></td><td>Maximum number of bytes</td></tr>
 </tbody></table></div>
 <h4>Returns</h4>
-<p>Status of call (0 = success)</p>
+<p>Number of bytes read</p>
 <!-- NEW PAGE -->
-<h3 class='title'><a name='httpRead'>httpRead()</a></h3>
+<h3 class='title'><span class='info'>&nbsp;CUPS 1.2&nbsp;</span><a name='httpRead2'>httpRead2()</a></h3>
 <h4>Description</h4>
-<p>Read data from a HTTP connection.</p>
+<p>Read data from a HTTP connection.
+
+</p>
 <h4>Syntax</h4>
 <pre>
-int
-httpRead(
+ssize_t
+httpRead2(
     <a href='#http_t'>http_t</a> * http,
-    <a href='#char'>char</a> * buffer,
-    int length);
+    char * buffer,
+    size_t length);
 </pre>
 <h4>Arguments</h4>
 <div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
 <thead><tr><th>Name</th><th>Description</th></tr></thead>
 <tbody>
-<tr><td><tt>http</tt></td><td>HTTP data</td></tr>
+<tr><td><tt>http</tt></td><td>HTTP connection</td></tr>
 <tr><td><tt>buffer</tt></td><td>Buffer for data</td></tr>
 <tr><td><tt>length</tt></td><td>Maximum number of bytes</td></tr>
 </tbody></table></div>
@@ -2339,7 +1692,7 @@ httpRead(
 <!-- NEW PAGE -->
 <h3 class='title'><a name='httpReconnect'>httpReconnect()</a></h3>
 <h4>Description</h4>
-<p>Reconnect to a HTTP server...</p>
+<p>Reconnect to a HTTP server.</p>
 <h4>Syntax</h4>
 <pre>
 int
@@ -2350,25 +1703,29 @@ httpReconnect(
 <div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
 <thead><tr><th>Name</th><th>Description</th></tr></thead>
 <tbody>
-<tr><td><tt>http</tt></td><td>HTTP data</td></tr>
+<tr><td><tt>http</tt></td><td>HTTP connection</td></tr>
 </tbody></table></div>
 <h4>Returns</h4>
 <p>0 on success, non-zero on failure</p>
 <!-- NEW PAGE -->
-<h3 class='title'><a name='httpSeparate'>httpSeparate()</a></h3>
+<h3 class='title'><span class='info'>&nbsp;DEPRECATED&nbsp;</span><a name='httpSeparate'>httpSeparate()</a></h3>
 <h4>Description</h4>
 <p>Separate a Universal Resource Identifier into its
-components.</p>
+components.
+
+This function is deprecated; use the httpSeparateURI() function instead.
+
+</p>
 <h4>Syntax</h4>
 <pre>
 void
 httpSeparate(
-    const <a href='#char'>char</a> * uri,
-    <a href='#char'>char</a> * scheme,
-    <a href='#char'>char</a> * username,
-    <a href='#char'>char</a> * host,
+    const char * uri,
+    char * scheme,
+    char * username,
+    char * host,
     int * port,
-    <a href='#char'>char</a> * resource);
+    char * resource);
 </pre>
 <h4>Arguments</h4>
 <div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
@@ -2389,20 +1746,23 @@ httpSeparate(
 <p>Separate a Universal Resource Identifier into its
 components.
 
+This function is deprecated; use the httpSeparateURI() function instead.
+
+
 </p>
 <h4>Syntax</h4>
 <pre>
 void
 httpSeparate2(
-    const <a href='#char'>char</a> * uri,
-    <a href='#char'>char</a> * scheme,
+    const char * uri,
+    char * scheme,
     int schemelen,
-    <a href='#char'>char</a> * username,
+    char * username,
     int usernamelen,
-    <a href='#char'>char</a> * host,
+    char * host,
     int hostlen,
     int * port,
-    <a href='#char'>char</a> * resource,
+    char * resource,
     int resourcelen);
 </pre>
 <h4>Arguments</h4>
@@ -2433,21 +1793,23 @@ components.
 <pre>
 http_uri_status_t
 httpSeparateURI(
-    const <a href='#char'>char</a> * uri,
-    <a href='#char'>char</a> * scheme,
+    http_uri_coding_t decoding,
+    const char * uri,
+    char * scheme,
     int schemelen,
-    <a href='#char'>char</a> * username,
+    char * username,
     int usernamelen,
-    <a href='#char'>char</a> * host,
+    char * host,
     int hostlen,
     int * port,
-    <a href='#char'>char</a> * resource,
+    char * resource,
     int resourcelen);
 </pre>
 <h4>Arguments</h4>
 <div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
 <thead><tr><th>Name</th><th>Description</th></tr></thead>
 <tbody>
+<tr><td><tt>decoding</tt></td><td>Decoding flags</td></tr>
 <tr><td><tt>uri</tt></td><td>Universal Resource Identifier</td></tr>
 <tr><td><tt>scheme</tt></td><td>Scheme (http, https, etc.)</td></tr>
 <tr><td><tt>schemelen</tt></td><td>Size of scheme buffer</td></tr>
@@ -2472,7 +1834,7 @@ httpSeparateURI(
 void
 httpSetCookie(
     <a href='#http_t'>http_t</a> * http,
-    const <a href='#char'>char</a> * cookie);
+    const char * cookie);
 </pre>
 <h4>Arguments</h4>
 <div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
@@ -2493,13 +1855,13 @@ void
 httpSetField(
     <a href='#http_t'>http_t</a> * http,
     http_field_t field,
-    const <a href='#char'>char</a> * value);
+    const char * value);
 </pre>
 <h4>Arguments</h4>
 <div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
 <thead><tr><th>Name</th><th>Description</th></tr></thead>
 <tbody>
-<tr><td><tt>http</tt></td><td>HTTP data</td></tr>
+<tr><td><tt>http</tt></td><td>HTTP connection</td></tr>
 <tr><td><tt>field</tt></td><td>Field index</td></tr>
 <tr><td><tt>value</tt></td><td>Value</td></tr>
 </tbody></table></div>
@@ -2522,7 +1884,7 @@ httpSetLength(
 <div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
 <thead><tr><th>Name</th><th>Description</th></tr></thead>
 <tbody>
-<tr><td><tt>http</tt></td><td>HTTP data</td></tr>
+<tr><td><tt>http</tt></td><td>HTTP connection</td></tr>
 <tr><td><tt>length</tt></td><td>Length (0 for chunked)</td></tr>
 </tbody></table></div>
 <h4>Returns</h4>
@@ -2533,7 +1895,7 @@ httpSetLength(
 <p>Return a short string describing a HTTP status code.</p>
 <h4>Syntax</h4>
 <pre>
-const <a href='#char'>char</a> *
+const char *
 httpStatus(
     http_status_t status);
 </pre>
@@ -2554,13 +1916,13 @@ httpStatus(
 int
 httpTrace(
     <a href='#http_t'>http_t</a> * http,
-    const <a href='#char'>char</a> * uri);
+    const char * uri);
 </pre>
 <h4>Arguments</h4>
 <div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
 <thead><tr><th>Name</th><th>Description</th></tr></thead>
 <tbody>
-<tr><td><tt>http</tt></td><td>HTTP data</td></tr>
+<tr><td><tt>http</tt></td><td>HTTP connection</td></tr>
 <tr><td><tt>uri</tt></td><td>URI for trace</td></tr>
 </tbody></table></div>
 <h4>Returns</h4>
@@ -2579,7 +1941,7 @@ httpUpdate(
 <div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
 <thead><tr><th>Name</th><th>Description</th></tr></thead>
 <tbody>
-<tr><td><tt>http</tt></td><td>HTTP data</td></tr>
+<tr><td><tt>http</tt></td><td>HTTP connection</td></tr>
 </tbody></table></div>
 <h4>Returns</h4>
 <p>HTTP status</p>
@@ -2600,28 +1962,57 @@ httpWait(
 <div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
 <thead><tr><th>Name</th><th>Description</th></tr></thead>
 <tbody>
-<tr><td><tt>http</tt></td><td>HTTP data</td></tr>
+<tr><td><tt>http</tt></td><td>HTTP connection</td></tr>
 <tr><td><tt>msec</tt></td><td>Milliseconds to wait</td></tr>
 </tbody></table></div>
 <h4>Returns</h4>
 <p>1 if data is available, 0 otherwise</p>
 <!-- NEW PAGE -->
-<h3 class='title'><a name='httpWrite'>httpWrite()</a></h3>
+<h3 class='title'><span class='info'>&nbsp;DEPRECATED&nbsp;</span><a name='httpWrite'>httpWrite()</a></h3>
 <h4>Description</h4>
-<p>Write data to a HTTP connection.</p>
+<p>Write data to a HTTP connection.
+
+This function is deprecated. Use the httpWrite2() function which can
+write more than 2GB of data.
+
+</p>
 <h4>Syntax</h4>
 <pre>
 int
 httpWrite(
     <a href='#http_t'>http_t</a> * http,
-    const <a href='#char'>char</a> * buffer,
+    const char * buffer,
     int length);
 </pre>
 <h4>Arguments</h4>
 <div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
 <thead><tr><th>Name</th><th>Description</th></tr></thead>
 <tbody>
-<tr><td><tt>http</tt></td><td>HTTP data</td></tr>
+<tr><td><tt>http</tt></td><td>HTTP connection</td></tr>
+<tr><td><tt>buffer</tt></td><td>Buffer for data</td></tr>
+<tr><td><tt>length</tt></td><td>Number of bytes to write</td></tr>
+</tbody></table></div>
+<h4>Returns</h4>
+<p>Number of bytes written</p>
+<!-- NEW PAGE -->
+<h3 class='title'><span class='info'>&nbsp;CUPS 1.2&nbsp;</span><a name='httpWrite2'>httpWrite2()</a></h3>
+<h4>Description</h4>
+<p>Write data to a HTTP connection.
+
+</p>
+<h4>Syntax</h4>
+<pre>
+ssize_t
+httpWrite2(
+    <a href='#http_t'>http_t</a> * http,
+    const char * buffer,
+    size_t length);
+</pre>
+<h4>Arguments</h4>
+<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
+<thead><tr><th>Name</th><th>Description</th></tr></thead>
+<tbody>
+<tr><td><tt>http</tt></td><td>HTTP connection</td></tr>
 <tr><td><tt>buffer</tt></td><td>Buffer for data</td></tr>
 <tr><td><tt>length</tt></td><td>Number of bytes to write</td></tr>
 </tbody></table></div>
@@ -2630,21 +2021,21 @@ httpWrite(
 <!-- NEW PAGE -->
 <h3 class='title'><a name='ippAddBoolean'>ippAddBoolean()</a></h3>
 <h4>Description</h4>
-<p>Add a boolean attribute to an IPP request.</p>
+<p>Add a boolean attribute to an IPP message.</p>
 <h4>Syntax</h4>
 <pre>
 <a href='#ipp_attribute_t'>ipp_attribute_t</a> *
 ippAddBoolean(
     <a href='#ipp_t'>ipp_t</a> * ipp,
     ipp_tag_t group,
-    const <a href='#char'>char</a> * name,
-    <a href='#char'>char</a> value);
+    const char * name,
+    char value);
 </pre>
 <h4>Arguments</h4>
 <div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
 <thead><tr><th>Name</th><th>Description</th></tr></thead>
 <tbody>
-<tr><td><tt>ipp</tt></td><td>IPP request</td></tr>
+<tr><td><tt>ipp</tt></td><td>IPP message</td></tr>
 <tr><td><tt>group</tt></td><td>IPP group</td></tr>
 <tr><td><tt>name</tt></td><td>Name of attribute</td></tr>
 <tr><td><tt>value</tt></td><td>Value of attribute</td></tr>
@@ -2661,15 +2052,15 @@ ippAddBoolean(
 ippAddBooleans(
     <a href='#ipp_t'>ipp_t</a> * ipp,
     ipp_tag_t group,
-    const <a href='#char'>char</a> * name,
+    const char * name,
     int num_values,
-    const <a href='#char'>char</a> * values);
+    const char * values);
 </pre>
 <h4>Arguments</h4>
 <div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
 <thead><tr><th>Name</th><th>Description</th></tr></thead>
 <tbody>
-<tr><td><tt>ipp</tt></td><td>IPP request</td></tr>
+<tr><td><tt>ipp</tt></td><td>IPP message</td></tr>
 <tr><td><tt>group</tt></td><td>IPP group</td></tr>
 <tr><td><tt>name</tt></td><td>Name of attribute</td></tr>
 <tr><td><tt>num_values</tt></td><td>Number of values</td></tr>
@@ -2689,14 +2080,14 @@ ippAddBooleans(
 ippAddCollection(
     <a href='#ipp_t'>ipp_t</a> * ipp,
     ipp_tag_t group,
-    const <a href='#char'>char</a> * name,
+    const char * name,
     <a href='#ipp_t'>ipp_t</a> * value);
 </pre>
 <h4>Arguments</h4>
 <div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
 <thead><tr><th>Name</th><th>Description</th></tr></thead>
 <tbody>
-<tr><td><tt>ipp</tt></td><td>IPP request</td></tr>
+<tr><td><tt>ipp</tt></td><td>IPP message</td></tr>
 <tr><td><tt>group</tt></td><td>IPP group</td></tr>
 <tr><td><tt>name</tt></td><td>Name of attribute</td></tr>
 <tr><td><tt>value</tt></td><td>Value</td></tr>
@@ -2715,7 +2106,7 @@ ippAddCollection(
 ippAddCollections(
     <a href='#ipp_t'>ipp_t</a> * ipp,
     ipp_tag_t group,
-    const <a href='#char'>char</a> * name,
+    const char * name,
     int num_values,
     const <a href='#ipp_t'>ipp_t</a> ** values);
 </pre>
@@ -2723,7 +2114,7 @@ ippAddCollections(
 <div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
 <thead><tr><th>Name</th><th>Description</th></tr></thead>
 <tbody>
-<tr><td><tt>ipp</tt></td><td>IPP request</td></tr>
+<tr><td><tt>ipp</tt></td><td>IPP message</td></tr>
 <tr><td><tt>group</tt></td><td>IPP group</td></tr>
 <tr><td><tt>name</tt></td><td>Name of attribute</td></tr>
 <tr><td><tt>num_values</tt></td><td>Number of values</td></tr>
@@ -2734,21 +2125,21 @@ ippAddCollections(
 <!-- NEW PAGE -->
 <h3 class='title'><a name='ippAddDate'>ippAddDate()</a></h3>
 <h4>Description</h4>
-<p>Add a date attribute to an IPP request.</p>
+<p>Add a date attribute to an IPP message.</p>
 <h4>Syntax</h4>
 <pre>
 <a href='#ipp_attribute_t'>ipp_attribute_t</a> *
 ippAddDate(
     <a href='#ipp_t'>ipp_t</a> * ipp,
     ipp_tag_t group,
-    const <a href='#char'>char</a> * name,
+    const char * name,
     const <a href='#ipp_uchar_t'>ipp_uchar_t</a> * value);
 </pre>
 <h4>Arguments</h4>
 <div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
 <thead><tr><th>Name</th><th>Description</th></tr></thead>
 <tbody>
-<tr><td><tt>ipp</tt></td><td>IPP request</td></tr>
+<tr><td><tt>ipp</tt></td><td>IPP message</td></tr>
 <tr><td><tt>group</tt></td><td>IPP group</td></tr>
 <tr><td><tt>name</tt></td><td>Name of attribute</td></tr>
 <tr><td><tt>value</tt></td><td>Value</td></tr>
@@ -2758,7 +2149,7 @@ ippAddDate(
 <!-- NEW PAGE -->
 <h3 class='title'><a name='ippAddInteger'>ippAddInteger()</a></h3>
 <h4>Description</h4>
-<p>Add a integer attribute to an IPP request.</p>
+<p>Add a integer attribute to an IPP message.</p>
 <h4>Syntax</h4>
 <pre>
 <a href='#ipp_attribute_t'>ipp_attribute_t</a> *
@@ -2766,14 +2157,14 @@ ippAddInteger(
     <a href='#ipp_t'>ipp_t</a> * ipp,
     ipp_tag_t group,
     ipp_tag_t type,
-    const <a href='#char'>char</a> * name,
+    const char * name,
     int value);
 </pre>
 <h4>Arguments</h4>
 <div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
 <thead><tr><th>Name</th><th>Description</th></tr></thead>
 <tbody>
-<tr><td><tt>ipp</tt></td><td>IPP request</td></tr>
+<tr><td><tt>ipp</tt></td><td>IPP message</td></tr>
 <tr><td><tt>group</tt></td><td>IPP group</td></tr>
 <tr><td><tt>type</tt></td><td>Type of attribute</td></tr>
 <tr><td><tt>name</tt></td><td>Name of attribute</td></tr>
@@ -2792,7 +2183,7 @@ ippAddIntegers(
     <a href='#ipp_t'>ipp_t</a> * ipp,
     ipp_tag_t group,
     ipp_tag_t type,
-    const <a href='#char'>char</a> * name,
+    const char * name,
     int num_values,
     const int * values);
 </pre>
@@ -2800,7 +2191,7 @@ ippAddIntegers(
 <div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
 <thead><tr><th>Name</th><th>Description</th></tr></thead>
 <tbody>
-<tr><td><tt>ipp</tt></td><td>IPP request</td></tr>
+<tr><td><tt>ipp</tt></td><td>IPP message</td></tr>
 <tr><td><tt>group</tt></td><td>IPP group</td></tr>
 <tr><td><tt>type</tt></td><td>Type of attribute</td></tr>
 <tr><td><tt>name</tt></td><td>Name of attribute</td></tr>
@@ -2812,7 +2203,7 @@ ippAddIntegers(
 <!-- NEW PAGE -->
 <h3 class='title'><span class='info'>&nbsp;CUPS 1.2&nbsp;</span><a name='ippAddOctetString'>ippAddOctetString()</a></h3>
 <h4>Description</h4>
-<p>Add an octetString value to an IPP request.
+<p>Add an octetString value to an IPP message.
 
 </p>
 <h4>Syntax</h4>
@@ -2821,7 +2212,7 @@ ippAddIntegers(
 ippAddOctetString(
     <a href='#ipp_t'>ipp_t</a> * ipp,
     ipp_tag_t group,
-    const <a href='#char'>char</a> * name,
+    const char * name,
     const void * data,
     int datalen);
 </pre>
@@ -2829,7 +2220,7 @@ ippAddOctetString(
 <div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
 <thead><tr><th>Name</th><th>Description</th></tr></thead>
 <tbody>
-<tr><td><tt>ipp</tt></td><td>IPP request</td></tr>
+<tr><td><tt>ipp</tt></td><td>IPP message</td></tr>
 <tr><td><tt>group</tt></td><td>IPP group</td></tr>
 <tr><td><tt>name</tt></td><td>Name of attribute</td></tr>
 <tr><td><tt>data</tt></td><td>octetString data</td></tr>
@@ -2840,14 +2231,14 @@ ippAddOctetString(
 <!-- NEW PAGE -->
 <h3 class='title'><a name='ippAddRange'>ippAddRange()</a></h3>
 <h4>Description</h4>
-<p>Add a range of values to an IPP request.</p>
+<p>Add a range of values to an IPP message.</p>
 <h4>Syntax</h4>
 <pre>
 <a href='#ipp_attribute_t'>ipp_attribute_t</a> *
 ippAddRange(
     <a href='#ipp_t'>ipp_t</a> * ipp,
     ipp_tag_t group,
-    const <a href='#char'>char</a> * name,
+    const char * name,
     int lower,
     int upper);
 </pre>
@@ -2855,7 +2246,7 @@ ippAddRange(
 <div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
 <thead><tr><th>Name</th><th>Description</th></tr></thead>
 <tbody>
-<tr><td><tt>ipp</tt></td><td>IPP request</td></tr>
+<tr><td><tt>ipp</tt></td><td>IPP message</td></tr>
 <tr><td><tt>group</tt></td><td>IPP group</td></tr>
 <tr><td><tt>name</tt></td><td>Name of attribute</td></tr>
 <tr><td><tt>lower</tt></td><td>Lower value</td></tr>
@@ -2866,14 +2257,14 @@ ippAddRange(
 <!-- NEW PAGE -->
 <h3 class='title'><a name='ippAddRanges'>ippAddRanges()</a></h3>
 <h4>Description</h4>
-<p>Add ranges of values to an IPP request.</p>
+<p>Add ranges of values to an IPP message.</p>
 <h4>Syntax</h4>
 <pre>
 <a href='#ipp_attribute_t'>ipp_attribute_t</a> *
 ippAddRanges(
     <a href='#ipp_t'>ipp_t</a> * ipp,
     ipp_tag_t group,
-    const <a href='#char'>char</a> * name,
+    const char * name,
     int num_values,
     const int * lower,
     const int * upper);
@@ -2882,7 +2273,7 @@ ippAddRanges(
 <div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
 <thead><tr><th>Name</th><th>Description</th></tr></thead>
 <tbody>
-<tr><td><tt>ipp</tt></td><td>IPP request</td></tr>
+<tr><td><tt>ipp</tt></td><td>IPP message</td></tr>
 <tr><td><tt>group</tt></td><td>IPP group</td></tr>
 <tr><td><tt>name</tt></td><td>Name of attribute</td></tr>
 <tr><td><tt>num_values</tt></td><td>Number of values</td></tr>
@@ -2894,14 +2285,14 @@ ippAddRanges(
 <!-- NEW PAGE -->
 <h3 class='title'><a name='ippAddResolution'>ippAddResolution()</a></h3>
 <h4>Description</h4>
-<p>Add a resolution value to an IPP request.</p>
+<p>Add a resolution value to an IPP message.</p>
 <h4>Syntax</h4>
 <pre>
 <a href='#ipp_attribute_t'>ipp_attribute_t</a> *
 ippAddResolution(
     <a href='#ipp_t'>ipp_t</a> * ipp,
     ipp_tag_t group,
-    const <a href='#char'>char</a> * name,
+    const char * name,
     ipp_res_t units,
     int xres,
     int yres);
@@ -2910,7 +2301,7 @@ ippAddResolution(
 <div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
 <thead><tr><th>Name</th><th>Description</th></tr></thead>
 <tbody>
-<tr><td><tt>ipp</tt></td><td>IPP request</td></tr>
+<tr><td><tt>ipp</tt></td><td>IPP message</td></tr>
 <tr><td><tt>group</tt></td><td>IPP group</td></tr>
 <tr><td><tt>name</tt></td><td>Name of attribute</td></tr>
 <tr><td><tt>units</tt></td><td>Units for resolution</td></tr>
@@ -2922,14 +2313,14 @@ ippAddResolution(
 <!-- NEW PAGE -->
 <h3 class='title'><a name='ippAddResolutions'>ippAddResolutions()</a></h3>
 <h4>Description</h4>
-<p>Add resolution values to an IPP request.</p>
+<p>Add resolution values to an IPP message.</p>
 <h4>Syntax</h4>
 <pre>
 <a href='#ipp_attribute_t'>ipp_attribute_t</a> *
 ippAddResolutions(
     <a href='#ipp_t'>ipp_t</a> * ipp,
     ipp_tag_t group,
-    const <a href='#char'>char</a> * name,
+    const char * name,
     int num_values,
     ipp_res_t units,
     const int * xres,
@@ -2939,7 +2330,7 @@ ippAddResolutions(
 <div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
 <thead><tr><th>Name</th><th>Description</th></tr></thead>
 <tbody>
-<tr><td><tt>ipp</tt></td><td>IPP request</td></tr>
+<tr><td><tt>ipp</tt></td><td>IPP message</td></tr>
 <tr><td><tt>group</tt></td><td>IPP group</td></tr>
 <tr><td><tt>name</tt></td><td>Name of attribute</td></tr>
 <tr><td><tt>num_values</tt></td><td>Number of values</td></tr>
@@ -2952,7 +2343,7 @@ ippAddResolutions(
 <!-- NEW PAGE -->
 <h3 class='title'><a name='ippAddSeparator'>ippAddSeparator()</a></h3>
 <h4>Description</h4>
-<p>Add a group separator to an IPP request.</p>
+<p>Add a group separator to an IPP message.</p>
 <h4>Syntax</h4>
 <pre>
 <a href='#ipp_attribute_t'>ipp_attribute_t</a> *
@@ -2963,14 +2354,14 @@ ippAddSeparator(
 <div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
 <thead><tr><th>Name</th><th>Description</th></tr></thead>
 <tbody>
-<tr><td><tt>ipp</tt></td><td>IPP request</td></tr>
+<tr><td><tt>ipp</tt></td><td>IPP message</td></tr>
 </tbody></table></div>
 <h4>Returns</h4>
 <p>New attribute</p>
 <!-- NEW PAGE -->
 <h3 class='title'><a name='ippAddString'>ippAddString()</a></h3>
 <h4>Description</h4>
-<p>Add a language-encoded string to an IPP request.</p>
+<p>Add a language-encoded string to an IPP message.</p>
 <h4>Syntax</h4>
 <pre>
 <a href='#ipp_attribute_t'>ipp_attribute_t</a> *
@@ -2978,15 +2369,15 @@ ippAddString(
     <a href='#ipp_t'>ipp_t</a> * ipp,
     ipp_tag_t group,
     ipp_tag_t type,
-    const <a href='#char'>char</a> * name,
-    const <a href='#char'>char</a> * charset,
-    const <a href='#char'>char</a> * value);
+    const char * name,
+    const char * charset,
+    const char * value);
 </pre>
 <h4>Arguments</h4>
 <div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
 <thead><tr><th>Name</th><th>Description</th></tr></thead>
 <tbody>
-<tr><td><tt>ipp</tt></td><td>IPP request</td></tr>
+<tr><td><tt>ipp</tt></td><td>IPP message</td></tr>
 <tr><td><tt>group</tt></td><td>IPP group</td></tr>
 <tr><td><tt>type</tt></td><td>Type of attribute</td></tr>
 <tr><td><tt>name</tt></td><td>Name of attribute</td></tr>
@@ -2998,7 +2389,7 @@ ippAddString(
 <!-- NEW PAGE -->
 <h3 class='title'><a name='ippAddStrings'>ippAddStrings()</a></h3>
 <h4>Description</h4>
-<p>Add language-encoded strings to an IPP request.</p>
+<p>Add language-encoded strings to an IPP message.</p>
 <h4>Syntax</h4>
 <pre>
 <a href='#ipp_attribute_t'>ipp_attribute_t</a> *
@@ -3006,16 +2397,16 @@ ippAddStrings(
     <a href='#ipp_t'>ipp_t</a> * ipp,
     ipp_tag_t group,
     ipp_tag_t type,
-    const <a href='#char'>char</a> * name,
+    const char * name,
     int num_values,
-    const <a href='#char'>char</a> * charset,
-    const <a href='#char'>char</a> *const * values);
+    const char * charset,
+    const char *const * values);
 </pre>
 <h4>Arguments</h4>
 <div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
 <thead><tr><th>Name</th><th>Description</th></tr></thead>
 <tbody>
-<tr><td><tt>ipp</tt></td><td>IPP request</td></tr>
+<tr><td><tt>ipp</tt></td><td>IPP message</td></tr>
 <tr><td><tt>group</tt></td><td>IPP group</td></tr>
 <tr><td><tt>type</tt></td><td>Type of attribute</td></tr>
 <tr><td><tt>name</tt></td><td>Name of attribute</td></tr>
@@ -3047,7 +2438,7 @@ ippDateToTime(
 <!-- NEW PAGE -->
 <h3 class='title'><a name='ippDelete'>ippDelete()</a></h3>
 <h4>Description</h4>
-<p>Delete an IPP request.</p>
+<p>Delete an IPP message.</p>
 <h4>Syntax</h4>
 <pre>
 void
@@ -3058,14 +2449,14 @@ ippDelete(
 <div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
 <thead><tr><th>Name</th><th>Description</th></tr></thead>
 <tbody>
-<tr><td><tt>ipp</tt></td><td>IPP request</td></tr>
+<tr><td><tt>ipp</tt></td><td>IPP message</td></tr>
 </tbody></table></div>
 <h4>Returns</h4>
 <p>Nothing.</p>
 <!-- NEW PAGE -->
 <h3 class='title'><span class='info'>&nbsp;CUPS 1.1.19&nbsp;</span><a name='ippDeleteAttribute'>ippDeleteAttribute()</a></h3>
 <h4>Description</h4>
-<p>Delete a single attribute in an IPP request.
+<p>Delete a single attribute in an IPP message.
 
 </p>
 <h4>Syntax</h4>
@@ -3079,7 +2470,7 @@ ippDeleteAttribute(
 <div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
 <thead><tr><th>Name</th><th>Description</th></tr></thead>
 <tbody>
-<tr><td><tt>ipp</tt></td><td>IPP request</td></tr>
+<tr><td><tt>ipp</tt></td><td>IPP message</td></tr>
 <tr><td><tt>attr</tt></td><td>Attribute to delete</td></tr>
 </tbody></table></div>
 <h4>Returns</h4>
@@ -3090,7 +2481,7 @@ ippDeleteAttribute(
 <p>Return a name for the given status code.</p>
 <h4>Syntax</h4>
 <pre>
-const <a href='#char'>char</a> *
+const char *
 ippErrorString(
     ipp_status_t error);
 </pre>
@@ -3112,7 +2503,7 @@ ippErrorString(
 <pre>
 ipp_status_t
 ippErrorValue(
-    const <a href='#char'>char</a> * name);
+    const char * name);
 </pre>
 <h4>Arguments</h4>
 <div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
@@ -3131,14 +2522,14 @@ ippErrorValue(
 <a href='#ipp_attribute_t'>ipp_attribute_t</a> *
 ippFindAttribute(
     <a href='#ipp_t'>ipp_t</a> * ipp,
-    const <a href='#char'>char</a> * name,
+    const char * name,
     ipp_tag_t type);
 </pre>
 <h4>Arguments</h4>
 <div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
 <thead><tr><th>Name</th><th>Description</th></tr></thead>
 <tbody>
-<tr><td><tt>ipp</tt></td><td>IPP request</td></tr>
+<tr><td><tt>ipp</tt></td><td>IPP message</td></tr>
 <tr><td><tt>name</tt></td><td>Name of attribute</td></tr>
 <tr><td><tt>type</tt></td><td>Type of attribute</td></tr>
 </tbody></table></div>
@@ -3153,14 +2544,14 @@ ippFindAttribute(
 <a href='#ipp_attribute_t'>ipp_attribute_t</a> *
 ippFindNextAttribute(
     <a href='#ipp_t'>ipp_t</a> * ipp,
-    const <a href='#char'>char</a> * name,
+    const char * name,
     ipp_tag_t type);
 </pre>
 <h4>Arguments</h4>
 <div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
 <thead><tr><th>Name</th><th>Description</th></tr></thead>
 <tbody>
-<tr><td><tt>ipp</tt></td><td>IPP request</td></tr>
+<tr><td><tt>ipp</tt></td><td>IPP message</td></tr>
 <tr><td><tt>name</tt></td><td>Name of attribute</td></tr>
 <tr><td><tt>type</tt></td><td>Type of attribute</td></tr>
 </tbody></table></div>
@@ -3169,7 +2560,7 @@ ippFindNextAttribute(
 <!-- NEW PAGE -->
 <h3 class='title'><a name='ippLength'>ippLength()</a></h3>
 <h4>Description</h4>
-<p>Compute the length of an IPP request.</p>
+<p>Compute the length of an IPP message.</p>
 <h4>Syntax</h4>
 <pre>
 size_t
@@ -3180,14 +2571,14 @@ ippLength(
 <div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
 <thead><tr><th>Name</th><th>Description</th></tr></thead>
 <tbody>
-<tr><td><tt>ipp</tt></td><td>IPP request</td></tr>
+<tr><td><tt>ipp</tt></td><td>IPP message</td></tr>
 </tbody></table></div>
 <h4>Returns</h4>
-<p>Size of IPP request</p>
+<p>Size of IPP message</p>
 <!-- NEW PAGE -->
 <h3 class='title'><a name='ippNew'>ippNew()</a></h3>
 <h4>Description</h4>
-<p>Allocate a new IPP request.</p>
+<p>Allocate a new IPP message.</p>
 <h4>Syntax</h4>
 <pre>
 <a href='#ipp_t'>ipp_t</a> *
@@ -3196,7 +2587,31 @@ ippNew(void);
 <h4>Arguments</h4>
 <p>None.</p>
 <h4>Returns</h4>
-<p>New IPP request</p>
+<p>New IPP message</p>
+<!-- NEW PAGE -->
+<h3 class='title'><span class='info'>&nbsp;CUPS 1.2&nbsp;</span><a name='ippNewRequest'>ippNewRequest()</a></h3>
+<h4>Description</h4>
+<p>Allocate a new IPP request message.
+
+The new request message is initialized with the attributes-charset and
+attributes-natural-language attributes added. The
+attributes-natural-language value is derived from the current locale.
+
+</p>
+<h4>Syntax</h4>
+<pre>
+<a href='#ipp_t'>ipp_t</a> *
+ippNewRequest(
+    ipp_op_t op);
+</pre>
+<h4>Arguments</h4>
+<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
+<thead><tr><th>Name</th><th>Description</th></tr></thead>
+<tbody>
+<tr><td><tt>op</tt></td><td>Operation code</td></tr>
+</tbody></table></div>
+<h4>Returns</h4>
+<p>IPP request message</p>
 <!-- NEW PAGE -->
 <h3 class='title'><span class='info'>&nbsp;CUPS 1.2&nbsp;</span><a name='ippOpString'>ippOpString()</a></h3>
 <h4>Description</h4>
@@ -3205,7 +2620,7 @@ ippNew(void);
 </p>
 <h4>Syntax</h4>
 <pre>
-const <a href='#char'>char</a> *
+const char *
 ippOpString(
     ipp_op_t op);
 </pre>
@@ -3227,7 +2642,7 @@ ippOpString(
 <pre>
 ipp_op_t
 ippOpValue(
-    const <a href='#char'>char</a> * name);
+    const char * name);
 </pre>
 <h4>Arguments</h4>
 <div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
@@ -3253,7 +2668,7 @@ ippPort(void);
 <!-- NEW PAGE -->
 <h3 class='title'><a name='ippRead'>ippRead()</a></h3>
 <h4>Description</h4>
-<p>Read data for an IPP request from a HTTP connection.</p>
+<p>Read data for an IPP message from a HTTP connection.</p>
 <h4>Syntax</h4>
 <pre>
 ipp_state_t
@@ -3273,7 +2688,7 @@ ippRead(
 <!-- NEW PAGE -->
 <h3 class='title'><span class='info'>&nbsp;CUPS 1.1.19&nbsp;</span><a name='ippReadFile'>ippReadFile()</a></h3>
 <h4>Description</h4>
-<p>Read data for an IPP request from a file.
+<p>Read data for an IPP message from a file.
 
 </p>
 <h4>Syntax</h4>
@@ -3293,9 +2708,9 @@ ippReadFile(
 <h4>Returns</h4>
 <p>Current state</p>
 <!-- NEW PAGE -->
-<h3 class='title'><span class='info'>&nbsp;CUPS 1.1.19&nbsp;</span><a name='ippReadIO'>ippReadIO()</a></h3>
+<h3 class='title'><span class='info'>&nbsp;CUPS 1.2&nbsp;</span><a name='ippReadIO'>ippReadIO()</a></h3>
 <h4>Description</h4>
-<p>Read data for an IPP request.
+<p>Read data for an IPP message.
 
 </p>
 <h4>Syntax</h4>
@@ -3359,7 +2774,7 @@ ippTimeToDate(
 <!-- NEW PAGE -->
 <h3 class='title'><a name='ippWrite'>ippWrite()</a></h3>
 <h4>Description</h4>
-<p>Write data for an IPP request to a HTTP connection.</p>
+<p>Write data for an IPP message to a HTTP connection.</p>
 <h4>Syntax</h4>
 <pre>
 ipp_state_t
@@ -3379,7 +2794,7 @@ ippWrite(
 <!-- NEW PAGE -->
 <h3 class='title'><span class='info'>&nbsp;CUPS 1.1.19&nbsp;</span><a name='ippWriteFile'>ippWriteFile()</a></h3>
 <h4>Description</h4>
-<p>Write data for an IPP request to a file.
+<p>Write data for an IPP message to a file.
 
 </p>
 <h4>Syntax</h4>
@@ -3399,9 +2814,9 @@ ippWriteFile(
 <h4>Returns</h4>
 <p>Current state</p>
 <!-- NEW PAGE -->
-<h3 class='title'><span class='info'>&nbsp;CUPS 1.1.19&nbsp;</span><a name='ippWriteIO'>ippWriteIO()</a></h3>
+<h3 class='title'><span class='info'>&nbsp;CUPS 1.2&nbsp;</span><a name='ippWriteIO'>ippWriteIO()</a></h3>
 <h4>Description</h4>
-<p>Write data for an IPP request.
+<p>Write data for an IPP message.
 
 </p>
 <h4>Syntax</h4>
@@ -3421,7 +2836,7 @@ ippWriteIO(
 <tr><td><tt>dst</tt></td><td>Destination</td></tr>
 <tr><td><tt>cb</tt></td><td>Write callback function</td></tr>
 <tr><td><tt>blocking</tt></td><td>Use blocking IO?</td></tr>
-<tr><td><tt>parent</tt></td><td>Parent IPP request</td></tr>
+<tr><td><tt>parent</tt></td><td>Parent IPP message</td></tr>
 <tr><td><tt>ipp</tt></td><td>IPP data</td></tr>
 </tbody></table></div>
 <h4>Returns</h4>
@@ -3429,82 +2844,11 @@ ippWriteIO(
 <!-- NEW PAGE -->
 <h2 class='title'><a name='STRUCTURES'>Structures</a></h2>
 <ul>
-       <li><a href='#cups_dest_s'><tt>cups_dest_s</tt></a> </li>
-       <li><a href='#cups_job_s'><tt>cups_job_s</tt></a> </li>
-       <li><a href='#cups_option_s'><tt>cups_option_s</tt></a> </li>
        <li><a href='#http_addrlist_s'><tt>http_addrlist_s</tt></a> <span class='info'>&nbsp;CUPS 1.2&nbsp;</span></li>
-       <li><a href='#http_s'><tt>http_s</tt></a> </li>
        <li><a href='#ipp_attribute_s'><tt>ipp_attribute_s</tt></a> </li>
-       <li><a href='#ipp_str'><tt>ipp_str</tt></a> </li>
+       <li><a href='#ipp_s'><tt>ipp_s</tt></a> </li>
 </ul>
 <!-- NEW PAGE -->
-<h3 class='title'><a name='cups_dest_s'>cups_dest_s</a></h3>
-<h4>Description</h4>
-<p>Destination</p>
-<h4>Definition</h4>
-<pre>
-struct cups_dest_s
-{
-  <a href='#char'>char</a> *name, * instance;
-  int is_default;
-  int num_options;
-  <a href='#cups_option_t'>cups_option_t</a> * options;
-};
-</pre>
-<h4>Members</h4>
-<div class='table'><table align='center' border='1' width='80%'>
-<thead><tr><th>Name</th><th>Description</th></tr></thead>
-<tbody>
-<tr><td><tt>instance</tt> </td><td>Local instance name or NULL</td></tr>
-<tr><td><tt>is_default</tt> </td><td>Is this printer the default?</td></tr>
-<tr><td><tt>num_options</tt> </td><td>Number of options</td></tr>
-<tr><td><tt>options</tt> </td><td>Options</td></tr>
-</tbody></table></div>
-<!-- NEW PAGE -->
-<h3 class='title'><a name='cups_job_s'>cups_job_s</a></h3>
-<h4>Description</h4>
-<p>Job</p>
-<h4>Definition</h4>
-<pre>
-struct cups_job_s
-{
-  <a href='#char'>char</a> *dest, *title, *user, * format;
-  int id;
-  int size, priority;
-  time_t completed_time, creation_time, processing_time;
-  ipp_jstate_t state;
-};
-</pre>
-<h4>Members</h4>
-<div class='table'><table align='center' border='1' width='80%'>
-<thead><tr><th>Name</th><th>Description</th></tr></thead>
-<tbody>
-<tr><td><tt>format</tt> </td><td>Document format</td></tr>
-<tr><td><tt>id</tt> </td><td>The job ID</td></tr>
-<tr><td><tt>priority</tt> </td><td>Priority (1-100)</td></tr>
-<tr><td><tt>processing_time</tt> </td><td>Time the job was processed</td></tr>
-<tr><td><tt>state</tt> </td><td>Job state</td></tr>
-</tbody></table></div>
-<!-- NEW PAGE -->
-<h3 class='title'><a name='cups_option_s'>cups_option_s</a></h3>
-<h4>Description</h4>
-<p>Types and structures...</p>
-<h4>Definition</h4>
-<pre>
-struct cups_option_s
-{
-  <a href='#char'>char</a> * name;
-  <a href='#char'>char</a> * value;
-};
-</pre>
-<h4>Members</h4>
-<div class='table'><table align='center' border='1' width='80%'>
-<thead><tr><th>Name</th><th>Description</th></tr></thead>
-<tbody>
-<tr><td><tt>name</tt> </td><td>Name of option</td></tr>
-<tr><td><tt>value</tt> </td><td>Value of option</td></tr>
-</tbody></table></div>
-<!-- NEW PAGE -->
 <h3 class='title'><span class='info'>&nbsp;CUPS 1.2&nbsp;</span><a name='http_addrlist_s'>http_addrlist_s</a></h3>
 <h4>Description</h4>
 <p>Socket address list, which is
@@ -3527,79 +2871,6 @@ struct http_addrlist_s
 <tr><td><tt>next</tt> </td><td>Pointer to next address in list</td></tr>
 </tbody></table></div>
 <!-- NEW PAGE -->
-<h3 class='title'><a name='http_s'>http_s</a></h3>
-<h4>Description</h4>
-<p>HTTP connection structure.</p>
-<h4>Definition</h4>
-<pre>
-struct http_s
-{
-  time_t activity;
-  <a href='#http_addrlist_t'>http_addrlist_t</a> * addrlist;
-  int auth_type;
-  int blocking;
-  <a href='#char'>char</a> buffer[HTTP_MAX_BUFFER];
-  <a href='#char'>char</a> * cookie;
-  <a href='#char'>char</a> * data;
-  <a href='#http_encoding_t'>http_encoding_t</a> data_encoding;
-  off_t data_remaining;
-  int digest_tries;
-  <a href='#http_encryption_t'>http_encryption_t</a> encryption;
-  int error;
-  http_status_t expect;
-  int fd;
-  <a href='#char'>char</a> hostname[HTTP_MAX_HOST], fields[HTTP_FIELD_MAX][HTTP_MAX_VALUE];
-  <a href='#http_addr_t'>http_addr_t</a> * hostaddr;
-  fd_set * input_set;
-  http_keepalive_t keep_alive;
-  _cups_md5_state_t md5_state;
-  <a href='#char'>char</a> nonce[HTTP_MAX_VALUE];
-  int nonce_count;
-  <a href='#http_state_t'>http_state_t</a> state;
-  http_status_t status;
-  void * tls;
-  int used;
-  <a href='#char'>char</a> authstring[HTTP_MAX_VALUE], userpass[HTTP_MAX_VALUE];
-  http_version_t version;
-  <a href='#char'>char</a> wbuffer[HTTP_MAX_BUFFER];
-  int wused;
-};
-</pre>
-<h4>Members</h4>
-<div class='table'><table align='center' border='1' width='80%'>
-<thead><tr><th>Name</th><th>Description</th></tr></thead>
-<tbody>
-<tr><td><tt>activity</tt> </td><td>Time since last read/write</td></tr>
-<tr><td><tt>addrlist</tt> <span class='info'>&nbsp;CUPS 1.2&nbsp;</span></td><td>List of valid addresses </td></tr>
-<tr><td><tt>auth_type</tt> </td><td>Authentication in use</td></tr>
-<tr><td><tt>blocking</tt> </td><td>To block or not to block</td></tr>
-<tr><td><tt>buffer[HTTP_MAX_BUFFER]</tt> </td><td>Buffer for incoming data</td></tr>
-<tr><td><tt>cookie</tt> <span class='info'>&nbsp;CUPS 1.1.19&nbsp;</span></td><td>Cookie value(s) </td></tr>
-<tr><td><tt>data</tt> </td><td>Pointer to data buffer</td></tr>
-<tr><td><tt>data_encoding</tt> </td><td>Chunked or not</td></tr>
-<tr><td><tt>data_remaining</tt> <span class='info'>&nbsp;CUPS 1.2&nbsp;</span></td><td>Number of bytes left </td></tr>
-<tr><td><tt>digest_tries</tt> <span class='info'>&nbsp;CUPS 1.1.20&nbsp;</span></td><td>Number of tries for digest auth </td></tr>
-<tr><td><tt>encryption</tt> </td><td>Encryption requirements</td></tr>
-<tr><td><tt>error</tt> </td><td>Last error on read</td></tr>
-<tr><td><tt>expect</tt> <span class='info'>&nbsp;CUPS 1.1.19&nbsp;</span></td><td>Expect: header </td></tr>
-<tr><td><tt>fd</tt> </td><td>File descriptor for this socket</td></tr>
-<tr><td><tt>fields[HTTP_FIELD_MAX][HTTP_MAX_VALUE]</tt> </td><td>Field values</td></tr>
-<tr><td><tt>hostaddr</tt> <span class='info'>&nbsp;CUPS 1.2&nbsp;</span></td><td>Current host address and port </td></tr>
-<tr><td><tt>input_set</tt> <span class='info'>&nbsp;CUPS 1.1.19&nbsp;</span></td><td>select() set for httpWait() </td></tr>
-<tr><td><tt>keep_alive</tt> </td><td>Keep-alive supported?</td></tr>
-<tr><td><tt>md5_state</tt> </td><td>MD5 state</td></tr>
-<tr><td><tt>nonce[HTTP_MAX_VALUE]</tt> </td><td>Nonce value</td></tr>
-<tr><td><tt>nonce_count</tt> </td><td>Nonce count</td></tr>
-<tr><td><tt>state</tt> </td><td>State of client</td></tr>
-<tr><td><tt>status</tt> </td><td>Status of last request</td></tr>
-<tr><td><tt>tls</tt> </td><td>TLS state information</td></tr>
-<tr><td><tt>used</tt> </td><td>Number of bytes used in buffer</td></tr>
-<tr><td><tt>userpass[HTTP_MAX_VALUE]</tt> <span class='info'>&nbsp;CUPS 1.1.20&nbsp;</span></td><td>Username:password string </td></tr>
-<tr><td><tt>version</tt> </td><td>Protocol version</td></tr>
-<tr><td><tt>wbuffer[HTTP_MAX_BUFFER]</tt> </td><td>Buffer for outgoing data</td></tr>
-<tr><td><tt>wused</tt> <span class='info'>&nbsp;CUPS 1.2&nbsp;</span></td><td>Write buffer bytes used </td></tr>
-</tbody></table></div>
-<!-- NEW PAGE -->
 <h3 class='title'><a name='ipp_attribute_s'>ipp_attribute_s</a></h3>
 <h4>Description</h4>
 <p>Attribute</p>
@@ -3607,7 +2878,7 @@ struct http_s
 <pre>
 struct ipp_attribute_s
 {
-  <a href='#char'>char</a> * name;
+  char * name;
   struct <a href='#ipp_attribute_s'>ipp_attribute_s</a> * next;
   int num_values;
   ipp_tag_t group_tag, value_tag;
@@ -3625,15 +2896,17 @@ struct ipp_attribute_s
 <tr><td><tt>values[1]</tt> </td><td>Values</td></tr>
 </tbody></table></div>
 <!-- NEW PAGE -->
-<h3 class='title'><a name='ipp_str'>ipp_str</a></h3>
+<h3 class='title'><a name='ipp_s'>ipp_s</a></h3>
 <h4>Description</h4>
 <p>IPP Request/Response/Notification</p>
 <h4>Definition</h4>
 <pre>
-struct ipp_str
+struct ipp_s
 {
-  <a href='#ipp_attribute_t'>ipp_attribute_t</a> *attrs, *last, * current;
+  <a href='#ipp_attribute_t'>ipp_attribute_t</a> * attrs;
+  <a href='#ipp_attribute_t'>ipp_attribute_t</a> * current;
   ipp_tag_t curtag;
+  <a href='#ipp_attribute_t'>ipp_attribute_t</a> * last;
   <a href='#ipp_attribute_t'>ipp_attribute_t</a> * prev;
   <a href='#ipp_request_t'>ipp_request_t</a> request;
   ipp_state_t state;
@@ -3643,8 +2916,10 @@ struct ipp_str
 <div class='table'><table align='center' border='1' width='80%'>
 <thead><tr><th>Name</th><th>Description</th></tr></thead>
 <tbody>
+<tr><td><tt>attrs</tt> </td><td>Attributes</td></tr>
 <tr><td><tt>current</tt> </td><td>Current attribute (for read/write)</td></tr>
 <tr><td><tt>curtag</tt> </td><td>Current attribute group tag</td></tr>
+<tr><td><tt>last</tt> </td><td>Last attribute in list</td></tr>
 <tr><td><tt>prev</tt> </td><td>Previous attribute (for read)</td></tr>
 <tr><td><tt>request</tt> </td><td>Request header</td></tr>
 <tr><td><tt>state</tt> </td><td>State of request</td></tr>
@@ -3652,63 +2927,19 @@ struct ipp_str
 <!-- NEW PAGE -->
 <h2 class='title'><a name='TYPES'>Types</a></h2>
 <ul>
-       <li><a href='#char'><tt>char</tt></a> </li>
-       <li><a href='#cups_dest_t'><tt>cups_dest_t</tt></a> </li>
-       <li><a href='#cups_job_t'><tt>cups_job_t</tt></a> </li>
-       <li><a href='#cups_option_t'><tt>cups_option_t</tt></a> </li>
-       <li><a href='#cups_ptype_t'><tt>cups_ptype_t</tt></a> </li>
        <li><a href='#http_addrlist_t'><tt>http_addrlist_t</tt></a> <span class='info'>&nbsp;CUPS 1.2&nbsp;</span></li>
        <li><a href='#http_auth_t'><tt>http_auth_t</tt></a> </li>
        <li><a href='#http_encoding_t'><tt>http_encoding_t</tt></a> </li>
        <li><a href='#http_encryption_t'><tt>http_encryption_t</tt></a> </li>
        <li><a href='#http_t'><tt>http_t</tt></a> </li>
        <li><a href='#ipp_attribute_t'><tt>ipp_attribute_t</tt></a> </li>
-       <li><a href='#ipp_iocb_t'><tt>ipp_iocb_t</tt></a> </li>
+       <li><a href='#ipp_iocb_t'><tt>ipp_iocb_t</tt></a> <span class='info'>&nbsp;CUPS 1.2&nbsp;</span></li>
        <li><a href='#ipp_request_t'><tt>ipp_request_t</tt></a> </li>
        <li><a href='#ipp_t'><tt>ipp_t</tt></a> </li>
+       <li><a href='#ipp_uchar_t'><tt>ipp_uchar_t</tt></a> </li>
        <li><a href='#ipp_value_t'><tt>ipp_value_t</tt></a> </li>
 </ul>
 <!-- NEW PAGE -->
-<h3 class='title'><a name='char'>char</a></h3>
-<h4>Description</h4>
-<p>Printer Options</p>
-<h4>Definition</h4>
-<pre>
-typedef const * (*charcups_password_cb_t)(const <a href='#char'>char</a> *);
-</pre>
-<!-- NEW PAGE -->
-<h3 class='title'><a name='cups_dest_t'>cups_dest_t</a></h3>
-<h4>Description</h4>
-<p>Destination</p>
-<h4>Definition</h4>
-<pre>
-typedef struct <a href='#cups_dest_s'>cups_dest_s</a> cups_dest_t;
-</pre>
-<!-- NEW PAGE -->
-<h3 class='title'><a name='cups_job_t'>cups_job_t</a></h3>
-<h4>Description</h4>
-<p>Job</p>
-<h4>Definition</h4>
-<pre>
-typedef struct <a href='#cups_job_s'>cups_job_s</a> cups_job_t;
-</pre>
-<!-- NEW PAGE -->
-<h3 class='title'><a name='cups_option_t'>cups_option_t</a></h3>
-<h4>Description</h4>
-<p>Types and structures...</p>
-<h4>Definition</h4>
-<pre>
-typedef struct <a href='#cups_option_s'>cups_option_s</a> cups_option_t;
-</pre>
-<!-- NEW PAGE -->
-<h3 class='title'><a name='cups_ptype_t'>cups_ptype_t</a></h3>
-<h4>Description</h4>
-<p>Printer Type/Capability Bits</p>
-<h4>Definition</h4>
-<pre>
-typedef unsigned cups_ptype_t;
-</pre>
-<!-- NEW PAGE -->
 <h3 class='title'><span class='info'>&nbsp;CUPS 1.2&nbsp;</span><a name='http_addrlist_t'>http_addrlist_t</a></h3>
 <h4>Description</h4>
 <p>Socket address list, which is
@@ -3749,7 +2980,7 @@ typedef enum <a href='#http_encryption_e'>http_encryption_e</a> http_encryption_
 <p>HTTP connection structure.</p>
 <h4>Definition</h4>
 <pre>
-typedef struct <a href='#http_s'>http_s</a> http_t;
+typedef struct _http_s http_t;
 </pre>
 <!-- NEW PAGE -->
 <h3 class='title'><a name='ipp_attribute_t'>ipp_attribute_t</a></h3>
@@ -3760,12 +2991,12 @@ typedef struct <a href='#http_s'>http_s</a> http_t;
 typedef struct <a href='#ipp_attribute_s'>ipp_attribute_s</a> ipp_attribute_t;
 </pre>
 <!-- NEW PAGE -->
-<h3 class='title'><a name='ipp_iocb_t'>ipp_iocb_t</a></h3>
+<h3 class='title'><span class='info'>&nbsp;CUPS 1.2&nbsp;</span><a name='ipp_iocb_t'>ipp_iocb_t</a></h3>
 <h4>Description</h4>
-<p>IPP IO Callback Function</p>
+<p>IPP IO Callback Function </p>
 <h4>Definition</h4>
 <pre>
-typedef int (*ipp_iocb_t)(void *, <a href='#ipp_uchar_t'>ipp_uchar_t</a> *, int);
+typedef ssize_t (*ipp_iocb_t)(void *, <a href='#ipp_uchar_t'>ipp_uchar_t</a> *, size_t);
 </pre>
 <!-- NEW PAGE -->
 <h3 class='title'><a name='ipp_request_t'>ipp_request_t</a></h3>
@@ -3773,7 +3004,7 @@ typedef int (*ipp_iocb_t)(void *, <a href='#ipp_uchar_t'>ipp_uchar_t</a> *, int)
 <p>Request Header</p>
 <h4>Definition</h4>
 <pre>
-typedef union ipp_request_t;
+typedef union <a href='#ipp_request_u'>ipp_request_u</a> ipp_request_t;
 </pre>
 <!-- NEW PAGE -->
 <h3 class='title'><a name='ipp_t'>ipp_t</a></h3>
@@ -3781,7 +3012,15 @@ typedef union ipp_request_t;
 <p>Attribute Value</p>
 <h4>Definition</h4>
 <pre>
-typedef struct <a href='#ipp_str'>ipp_str</a> ipp_t;
+typedef struct <a href='#ipp_s'>ipp_s</a> ipp_t;
+</pre>
+<!-- NEW PAGE -->
+<h3 class='title'><a name='ipp_uchar_t'>ipp_uchar_t</a></h3>
+<h4>Description</h4>
+<p>IPP status codes...</p>
+<h4>Definition</h4>
+<pre>
+typedef typedef unsigned char ipp_uchar_t;
 </pre>
 <!-- NEW PAGE -->
 <h3 class='title'><a name='ipp_value_t'>ipp_value_t</a></h3>
@@ -3789,7 +3028,51 @@ typedef struct <a href='#ipp_str'>ipp_str</a> ipp_t;
 <p>New in CUPS 1.1.19</p>
 <h4>Definition</h4>
 <pre>
-typedef union ipp_value_t;
+typedef union <a href='#ipp_value_u'>ipp_value_u</a> ipp_value_t;
+</pre>
+<!-- NEW PAGE -->
+<h2 class='title'><a name='UNIONS'>Unions</a></h2>
+<ul>
+       <li><a href='#ipp_request_u'><tt>ipp_request_u</tt></a> </li>
+       <li><a href='#ipp_value_u'><tt>ipp_value_u</tt></a> </li>
+</ul>
+<!-- NEW PAGE -->
+<h3 class='title'><a name='ipp_request_u'>ipp_request_u</a></h3>
+<h4>Description</h4>
+<p>Request Header</p>
+<h4>Definition</h4>
+<pre>
+union ipp_request_u
+{
+};
+</pre>
+<h4>Members</h4>
+<div class='table'><table align='center' border='1' width='80%'>
+<thead><tr><th>Name</th><th>Description</th></tr></thead>
+<tbody>
+</tbody></table></div>
+<!-- NEW PAGE -->
+<h3 class='title'><a name='ipp_value_u'>ipp_value_u</a></h3>
+<h4>Description</h4>
+<p>New in CUPS 1.1.19</p>
+<h4>Definition</h4>
+<pre>
+union ipp_value_u
+{
+  char boolean;
+  <a href='#ipp_t'>ipp_t</a> * collection;
+  <a href='#ipp_uchar_t'>ipp_uchar_t</a> date[11];
+  int integer;
+};
 </pre>
+<h4>Members</h4>
+<div class='table'><table align='center' border='1' width='80%'>
+<thead><tr><th>Name</th><th>Description</th></tr></thead>
+<tbody>
+<tr><td><tt>boolean</tt> </td><td>Boolean value</td></tr>
+<tr><td><tt>collection</tt> </td><td>Collection value</td></tr>
+<tr><td><tt>date[11]</tt> </td><td>Date/time value</td></tr>
+<tr><td><tt>integer</tt> </td><td>Integer/enumerated value</td></tr>
+</tbody></table></div>
 </body>
 </html>
index 341908af0ad0a2e4ba96e791b619d98e423ed789..61ad7d67b4b56a19e8176ef0eacfbec6dadbff96 100644 (file)
@@ -74,13 +74,30 @@ library:</p>
 <!-- NEW PAGE -->
 <h2 class='title'><a name='ENUMERATIONS'>Enumerations</a></h2>
 <ul>
+       <li><a href='#ppd_cptype_e'><tt>ppd_cptype_e</tt></a> <span class='info'>&nbsp;CUPS 1.2&nbsp;</span></li>
        <li><a href='#ppd_cs_e'><tt>ppd_cs_e</tt></a> </li>
-       <li><a href='#ppd_ext_ui_e'><tt>ppd_ext_ui_e</tt></a> <span class='info'>&nbsp;CUPS 1.2&nbsp;</span></li>
        <li><a href='#ppd_section_e'><tt>ppd_section_e</tt></a> </li>
        <li><a href='#ppd_status_e'><tt>ppd_status_e</tt></a> </li>
        <li><a href='#ppd_ui_e'><tt>ppd_ui_e</tt></a> </li>
 </ul>
 <!-- NEW PAGE -->
+<h3 class='title'><span class='info'>&nbsp;CUPS 1.2&nbsp;</span><a name='ppd_cptype_e'>ppd_cptype_e</a></h3>
+<h4>Description</h4>
+<p>Custom Parameter Type </p>
+<h4>Values</h4>
+<div class='table'><table align='center' border='1' width='80%'>
+<thead><tr><th>Name</th><th>Description</th></tr></thead>
+<tbody>
+<tr><td><tt>PPD_CUSTOM_CURVE</tt> </td><td>Curve value for f(x) = x^value</td></tr>
+<tr><td><tt>PPD_CUSTOM_INT</tt> </td><td>Integer number value</td></tr>
+<tr><td><tt>PPD_CUSTOM_INVCURVE</tt> </td><td>Curve value for f(x) = x^(1/value)</td></tr>
+<tr><td><tt>PPD_CUSTOM_PASSCODE</tt> </td><td>String of (hidden) numbers</td></tr>
+<tr><td><tt>PPD_CUSTOM_PASSWORD</tt> </td><td>String of (hidden) characters</td></tr>
+<tr><td><tt>PPD_CUSTOM_POINTS</tt> </td><td>Measurement value in points</td></tr>
+<tr><td><tt>PPD_CUSTOM_REAL</tt> </td><td>Real number value</td></tr>
+<tr><td><tt>PPD_CUSTOM_STRING</tt> </td><td>String of characters</td></tr>
+</tbody></table></div>
+<!-- NEW PAGE -->
 <h3 class='title'><a name='ppd_cs_e'>ppd_cs_e</a></h3>
 <h4>Description</h4>
 <p>Colorspaces</p>
@@ -96,23 +113,6 @@ library:</p>
 <tr><td><tt>PPD_CS_RGBK</tt> </td><td>RGBK (K = gray) colorspace</td></tr>
 </tbody></table></div>
 <!-- NEW PAGE -->
-<h3 class='title'><span class='info'>&nbsp;CUPS 1.2&nbsp;</span><a name='ppd_ext_ui_e'>ppd_ext_ui_e</a></h3>
-<h4>Description</h4>
-<p>Extended UI Types </p>
-<h4>Values</h4>
-<div class='table'><table align='center' border='1' width='80%'>
-<thead><tr><th>Name</th><th>Description</th></tr></thead>
-<tbody>
-<tr><td><tt>PPD_UI_CUPS_CURVE</tt> </td><td>Specify start, end, and gamma numbers</td></tr>
-<tr><td><tt>PPD_UI_CUPS_GAMMA</tt> </td><td>Specify a gamma number</td></tr>
-<tr><td><tt>PPD_UI_CUPS_INTEGER</tt> </td><td>Specify an integer number</td></tr>
-<tr><td><tt>PPD_UI_CUPS_INTEGER_ARRAY</tt> </td><td>Specify an array of integer numbers</td></tr>
-<tr><td><tt>PPD_UI_CUPS_REAL</tt> </td><td>Specify a real number</td></tr>
-<tr><td><tt>PPD_UI_CUPS_REAL_ARRAY</tt> </td><td>Specify an array of real numbers</td></tr>
-<tr><td><tt>PPD_UI_CUPS_TEXT</tt> </td><td>Specify a string</td></tr>
-<tr><td><tt>PPD_UI_CUPS_XY_ARRAY</tt> </td><td>Specify an array of X/Y real numbers</td></tr>
-</tbody></table></div>
-<!-- NEW PAGE -->
 <h3 class='title'><a name='ppd_section_e'>ppd_section_e</a></h3>
 <h4>Description</h4>
 <p>Order dependency sections</p>
@@ -136,6 +136,7 @@ library:</p>
 <thead><tr><th>Name</th><th>Description</th></tr></thead>
 <tbody>
 <tr><td><tt>PPD_ALLOC_ERROR</tt> </td><td>Memory allocation error</td></tr>
+<tr><td><tt>PPD_BAD_CUSTOM_PARAM</tt> </td><td>Bad custom parameter</td></tr>
 <tr><td><tt>PPD_BAD_OPEN_GROUP</tt> </td><td>Bad OpenGroup</td></tr>
 <tr><td><tt>PPD_BAD_OPEN_UI</tt> </td><td>Bad OpenUI/JCLOpenUI</td></tr>
 <tr><td><tt>PPD_BAD_ORDER_DEPENDENCY</tt> </td><td>Bad OrderDependency</td></tr>
@@ -173,8 +174,10 @@ library:</p>
 <ul>
        <li><a href='#ppdClose'><tt>ppdClose()</tt></a> </li>
        <li><a href='#ppdCollect'><tt>ppdCollect()</tt></a> </li>
+       <li><a href='#ppdCollect2'><tt>ppdCollect2()</tt></a> <span class='info'>&nbsp;CUPS 1.2&nbsp;</span></li>
        <li><a href='#ppdConflicts'><tt>ppdConflicts()</tt></a> </li>
        <li><a href='#ppdEmit'><tt>ppdEmit()</tt></a> </li>
+       <li><a href='#ppdEmitAfterOrder'><tt>ppdEmitAfterOrder()</tt></a> <span class='info'>&nbsp;CUPS 1.2&nbsp;</span></li>
        <li><a href='#ppdEmitFd'><tt>ppdEmitFd()</tt></a> </li>
        <li><a href='#ppdEmitJCL'><tt>ppdEmitJCL()</tt></a> </li>
        <li><a href='#ppdEmitJCLEnd'><tt>ppdEmitJCLEnd()</tt></a> <span class='info'>&nbsp;CUPS 1.2&nbsp;</span></li>
@@ -184,10 +187,12 @@ library:</p>
        <li><a href='#ppdFindMarkedChoice'><tt>ppdFindMarkedChoice()</tt></a> </li>
        <li><a href='#ppdFindNextAttr'><tt>ppdFindNextAttr()</tt></a> <span class='info'>&nbsp;CUPS 1.1.19&nbsp;</span></li>
        <li><a href='#ppdFindOption'><tt>ppdFindOption()</tt></a> </li>
+       <li><a href='#ppdFirstOption'><tt>ppdFirstOption()</tt></a> <span class='info'>&nbsp;CUPS 1.2&nbsp;</span></li>
        <li><a href='#ppdIsMarked'><tt>ppdIsMarked()</tt></a> </li>
        <li><a href='#ppdLastError'><tt>ppdLastError()</tt></a> <span class='info'>&nbsp;CUPS 1.1.19&nbsp;</span></li>
        <li><a href='#ppdMarkDefaults'><tt>ppdMarkDefaults()</tt></a> </li>
        <li><a href='#ppdMarkOption'><tt>ppdMarkOption()</tt></a> </li>
+       <li><a href='#ppdNextOption'><tt>ppdNextOption()</tt></a> <span class='info'>&nbsp;CUPS 1.2&nbsp;</span></li>
        <li><a href='#ppdOpen'><tt>ppdOpen()</tt></a> </li>
        <li><a href='#ppdOpen2'><tt>ppdOpen2()</tt></a> <span class='info'>&nbsp;CUPS 1.2&nbsp;</span></li>
        <li><a href='#ppdOpenFd'><tt>ppdOpenFd()</tt></a> </li>
@@ -239,6 +244,33 @@ ppdCollect(
 <h4>Returns</h4>
 <p>Number of options marked</p>
 <!-- NEW PAGE -->
+<h3 class='title'><span class='info'>&nbsp;CUPS 1.2&nbsp;</span><a name='ppdCollect2'>ppdCollect2()</a></h3>
+<h4>Description</h4>
+<p>Collect all marked options that reside in the
+specified section and minimum order.
+
+</p>
+<h4>Syntax</h4>
+<pre>
+int
+ppdCollect2(
+    <a href='#ppd_file_t'>ppd_file_t</a> * ppd,
+    <a href='#ppd_section_t'>ppd_section_t</a> section,
+    float min_order,
+    <a href='#ppd_choice_t'>ppd_choice_t</a> *** choices);
+</pre>
+<h4>Arguments</h4>
+<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
+<thead><tr><th>Name</th><th>Description</th></tr></thead>
+<tbody>
+<tr><td><tt>ppd</tt></td><td>PPD file data</td></tr>
+<tr><td><tt>section</tt></td><td>Section to collect</td></tr>
+<tr><td><tt>min_order</tt></td><td>Minimum OrderDependency value</td></tr>
+<tr><td><tt>choices</tt></td><td>Pointers to choices</td></tr>
+</tbody></table></div>
+<h4>Returns</h4>
+<p>Number of options marked</p>
+<!-- NEW PAGE -->
 <h3 class='title'><a name='ppdConflicts'>ppdConflicts()</a></h3>
 <h4>Description</h4>
 <p>Check to see if there are any conflicts.</p>
@@ -279,6 +311,39 @@ ppdEmit(
 <h4>Returns</h4>
 <p>0 on success, -1 on failure</p>
 <!-- NEW PAGE -->
+<h3 class='title'><span class='info'>&nbsp;CUPS 1.2&nbsp;</span><a name='ppdEmitAfterOrder'>ppdEmitAfterOrder()</a></h3>
+<h4>Description</h4>
+<p>Emit a subset of the code for marked options to a file.
+
+When &quot;limit&quot; is non-zero, this function only emits options whose
+OrderDependency value is greater than or equal to &quot;min_order&quot;.
+
+When &quot;limit&quot; is zero, this function is identical to ppdEmit().
+
+</p>
+<h4>Syntax</h4>
+<pre>
+int
+ppdEmitAfterOrder(
+    <a href='#ppd_file_t'>ppd_file_t</a> * ppd,
+    FILE * fp,
+    <a href='#ppd_section_t'>ppd_section_t</a> section,
+    int limit,
+    float min_order);
+</pre>
+<h4>Arguments</h4>
+<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
+<thead><tr><th>Name</th><th>Description</th></tr></thead>
+<tbody>
+<tr><td><tt>ppd</tt></td><td>PPD file record</td></tr>
+<tr><td><tt>fp</tt></td><td>File to write to</td></tr>
+<tr><td><tt>section</tt></td><td>Section to write</td></tr>
+<tr><td><tt>limit</tt></td><td>Non-zero to use min_order, 0 to include all</td></tr>
+<tr><td><tt>min_order</tt></td><td>Lowest order dependency to include</td></tr>
+</tbody></table></div>
+<h4>Returns</h4>
+<p>0 on success, -1 on failure</p>
+<!-- NEW PAGE -->
 <h3 class='title'><a name='ppdEmitFd'>ppdEmitFd()</a></h3>
 <h4>Description</h4>
 <p>Emit code for marked options to a file.</p>
@@ -477,6 +542,28 @@ ppdFindOption(
 <h4>Returns</h4>
 <p>Pointer to option or NULL</p>
 <!-- NEW PAGE -->
+<h3 class='title'><span class='info'>&nbsp;CUPS 1.2&nbsp;</span><a name='ppdFirstOption'>ppdFirstOption()</a></h3>
+<h4>Description</h4>
+<p>Return the first option in the PPD file.
+
+Options are returned from all groups in sorted order.
+
+</p>
+<h4>Syntax</h4>
+<pre>
+<a href='#ppd_option_t'>ppd_option_t</a> *
+ppdFirstOption(
+    <a href='#ppd_file_t'>ppd_file_t</a> * ppd);
+</pre>
+<h4>Arguments</h4>
+<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
+<thead><tr><th>Name</th><th>Description</th></tr></thead>
+<tbody>
+<tr><td><tt>ppd</tt></td><td>PPD file</td></tr>
+</tbody></table></div>
+<h4>Returns</h4>
+<p>First option or NULL</p>
+<!-- NEW PAGE -->
 <h3 class='title'><a name='ppdIsMarked'>ppdIsMarked()</a></h3>
 <h4>Description</h4>
 <p>Check to see if an option is marked...</p>
@@ -564,6 +651,28 @@ ppdMarkOption(
 <h4>Returns</h4>
 <p>Number of conflicts</p>
 <!-- NEW PAGE -->
+<h3 class='title'><span class='info'>&nbsp;CUPS 1.2&nbsp;</span><a name='ppdNextOption'>ppdNextOption()</a></h3>
+<h4>Description</h4>
+<p>Return the next option in the PPD file.
+
+Options are returned from all groups in sorted order.
+
+</p>
+<h4>Syntax</h4>
+<pre>
+<a href='#ppd_option_t'>ppd_option_t</a> *
+ppdNextOption(
+    <a href='#ppd_file_t'>ppd_file_t</a> * ppd);
+</pre>
+<h4>Arguments</h4>
+<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
+<thead><tr><th>Name</th><th>Description</th></tr></thead>
+<tbody>
+<tr><td><tt>ppd</tt></td><td>PPD file</td></tr>
+</tbody></table></div>
+<h4>Returns</h4>
+<p>Next option or NULL</p>
+<!-- NEW PAGE -->
 <h3 class='title'><a name='ppdOpen'>ppdOpen()</a></h3>
 <h4>Description</h4>
 <p>Read a PPD file into memory.</p>
@@ -720,24 +829,24 @@ ppdSetConformance(
 <!-- NEW PAGE -->
 <h2 class='title'><a name='STRUCTURES'>Structures</a></h2>
 <ul>
-       <li><a href='#ppd_attr_str'><tt>ppd_attr_str</tt></a> <span class='info'>&nbsp;CUPS 1.1.19&nbsp;</span></li>
-       <li><a href='#ppd_choice_str'><tt>ppd_choice_str</tt></a> </li>
-       <li><a href='#ppd_emul_str'><tt>ppd_emul_str</tt></a> </li>
-       <li><a href='#ppd_ext_option_str'><tt>ppd_ext_option_str</tt></a> <span class='info'>&nbsp;CUPS 1.2&nbsp;</span></li>
-       <li><a href='#ppd_ext_param_str'><tt>ppd_ext_param_str</tt></a> <span class='info'>&nbsp;CUPS 1.2&nbsp;</span></li>
-       <li><a href='#ppd_file_str'><tt>ppd_file_str</tt></a> </li>
-       <li><a href='#ppd_group_str'><tt>ppd_group_str</tt></a> </li>
-       <li><a href='#ppd_option_str'><tt>ppd_option_str</tt></a> </li>
-       <li><a href='#ppd_profile_str'><tt>ppd_profile_str</tt></a> </li>
-       <li><a href='#ppd_size_str'><tt>ppd_size_str</tt></a> </li>
+       <li><a href='#ppd_attr_s'><tt>ppd_attr_s</tt></a> <span class='info'>&nbsp;CUPS 1.1.19&nbsp;</span></li>
+       <li><a href='#ppd_choice_s'><tt>ppd_choice_s</tt></a> </li>
+       <li><a href='#ppd_coption_s'><tt>ppd_coption_s</tt></a> <span class='info'>&nbsp;CUPS 1.2&nbsp;</span></li>
+       <li><a href='#ppd_cparam_s'><tt>ppd_cparam_s</tt></a> <span class='info'>&nbsp;CUPS 1.2&nbsp;</span></li>
+       <li><a href='#ppd_emul_s'><tt>ppd_emul_s</tt></a> </li>
+       <li><a href='#ppd_file_s'><tt>ppd_file_s</tt></a> </li>
+       <li><a href='#ppd_group_s'><tt>ppd_group_s</tt></a> </li>
+       <li><a href='#ppd_option_s'><tt>ppd_option_s</tt></a> </li>
+       <li><a href='#ppd_profile_s'><tt>ppd_profile_s</tt></a> </li>
+       <li><a href='#ppd_size_s'><tt>ppd_size_s</tt></a> </li>
 </ul>
 <!-- NEW PAGE -->
-<h3 class='title'><span class='info'>&nbsp;CUPS 1.1.19&nbsp;</span><a name='ppd_attr_str'>ppd_attr_str</a></h3>
+<h3 class='title'><span class='info'>&nbsp;CUPS 1.1.19&nbsp;</span><a name='ppd_attr_s'>ppd_attr_s</a></h3>
 <h4>Description</h4>
 <p>PPD Attribute Structure </p>
 <h4>Definition</h4>
 <pre>
-struct ppd_attr_str
+struct ppd_attr_s
 {
   char name[PPD_MAX_NAME];
   char spec[PPD_MAX_NAME];
@@ -755,12 +864,12 @@ struct ppd_attr_str
 <tr><td><tt>value</tt> </td><td>Value string</td></tr>
 </tbody></table></div>
 <!-- NEW PAGE -->
-<h3 class='title'><a name='ppd_choice_str'>ppd_choice_str</a></h3>
+<h3 class='title'><a name='ppd_choice_s'>ppd_choice_s</a></h3>
 <h4>Description</h4>
 <p>Option choices</p>
 <h4>Definition</h4>
 <pre>
-struct ppd_choice_str
+struct ppd_choice_s
 {
   char choice[PPD_MAX_NAME];
   char * code;
@@ -780,87 +889,81 @@ struct ppd_choice_str
 <tr><td><tt>text[PPD_MAX_TEXT]</tt> </td><td>Human-readable option name</td></tr>
 </tbody></table></div>
 <!-- NEW PAGE -->
-<h3 class='title'><a name='ppd_emul_str'>ppd_emul_str</a></h3>
+<h3 class='title'><span class='info'>&nbsp;CUPS 1.2&nbsp;</span><a name='ppd_coption_s'>ppd_coption_s</a></h3>
 <h4>Description</h4>
-<p>Emulators</p>
+<p>Custom Option </p>
 <h4>Definition</h4>
 <pre>
-struct ppd_emul_str
+struct ppd_coption_s
 {
-  char name[PPD_MAX_NAME];
-  char * start;
-  char * stop;
+  char keyword[PPD_MAX_NAME];
+  int marked;
+  <a href='#ppd_option_t'>ppd_option_t</a> * option;
+  cups_array_t * params;
 };
 </pre>
 <h4>Members</h4>
 <div class='table'><table align='center' border='1' width='80%'>
 <thead><tr><th>Name</th><th>Description</th></tr></thead>
 <tbody>
-<tr><td><tt>name[PPD_MAX_NAME]</tt> </td><td>Emulator name</td></tr>
-<tr><td><tt>start</tt> </td><td>Code to switch to this emulation</td></tr>
-<tr><td><tt>stop</tt> </td><td>Code to stop this emulation</td></tr>
+<tr><td><tt>keyword[PPD_MAX_NAME]</tt> </td><td>Name of option that is being extended...</td></tr>
+<tr><td><tt>marked</tt> </td><td>Extended option is marked</td></tr>
+<tr><td><tt>option</tt> </td><td>Option that is being extended...</td></tr>
+<tr><td><tt>params</tt> </td><td>Parameters</td></tr>
 </tbody></table></div>
 <!-- NEW PAGE -->
-<h3 class='title'><span class='info'>&nbsp;CUPS 1.2&nbsp;</span><a name='ppd_ext_option_str'>ppd_ext_option_str</a></h3>
+<h3 class='title'><span class='info'>&nbsp;CUPS 1.2&nbsp;</span><a name='ppd_cparam_s'>ppd_cparam_s</a></h3>
 <h4>Description</h4>
-<p>Extended Options </p>
+<p>Custom Parameter </p>
 <h4>Definition</h4>
 <pre>
-struct ppd_ext_option_str
+struct ppd_cparam_s
 {
-  char * code;
-  char keyword[PPD_MAX_NAME];
-  int marked;
-  int num_params;
-  <a href='#ppd_option_t'>ppd_option_t</a> * option;
-  <a href='#ppd_ext_param_t'>ppd_ext_param_t</a> ** params;
+  <a href='#ppd_cpvalue_t'>ppd_cpvalue_t</a> minimum, maximum, current;
+  char name[PPD_MAX_NAME];
+  int order;
+  char text[PPD_MAX_TEXT];
+  <a href='#ppd_cptype_t'>ppd_cptype_t</a> type;
 };
 </pre>
 <h4>Members</h4>
 <div class='table'><table align='center' border='1' width='80%'>
 <thead><tr><th>Name</th><th>Description</th></tr></thead>
 <tbody>
-<tr><td><tt>code</tt> </td><td>Generic PS code for extended options</td></tr>
-<tr><td><tt>keyword[PPD_MAX_NAME]</tt> </td><td>Name of option that is being extended...</td></tr>
-<tr><td><tt>marked</tt> </td><td>Extended option is marked</td></tr>
-<tr><td><tt>num_params</tt> </td><td>Number of parameters</td></tr>
-<tr><td><tt>option</tt> </td><td>Option that is being extended...</td></tr>
-<tr><td><tt>params</tt> </td><td>Parameters</td></tr>
+<tr><td><tt>current</tt> </td><td>Current value</td></tr>
+<tr><td><tt>name[PPD_MAX_NAME]</tt> </td><td>Parameter name</td></tr>
+<tr><td><tt>order</tt> </td><td>Order (0 to N)</td></tr>
+<tr><td><tt>text[PPD_MAX_TEXT]</tt> </td><td>Human-readable text</td></tr>
+<tr><td><tt>type</tt> </td><td>Parameter type</td></tr>
 </tbody></table></div>
 <!-- NEW PAGE -->
-<h3 class='title'><span class='info'>&nbsp;CUPS 1.2&nbsp;</span><a name='ppd_ext_param_str'>ppd_ext_param_str</a></h3>
+<h3 class='title'><a name='ppd_emul_s'>ppd_emul_s</a></h3>
 <h4>Description</h4>
-<p>Extended Parameter </p>
+<p>Emulators</p>
 <h4>Definition</h4>
 <pre>
-struct ppd_ext_param_str
+struct ppd_emul_s
 {
-  <a href='#ppd_ext_value_t'>ppd_ext_value_t</a> * defval;
-  char keyword[PPD_MAX_NAME];
-  <a href='#ppd_ext_value_t'>ppd_ext_value_t</a> * maxval;
-  <a href='#ppd_ext_value_t'>ppd_ext_value_t</a> * minval;
-  char text[PPD_MAX_TEXT];
-  <a href='#ppd_ext_value_t'>ppd_ext_value_t</a> * value;
+  char name[PPD_MAX_NAME];
+  char * start;
+  char * stop;
 };
 </pre>
 <h4>Members</h4>
 <div class='table'><table align='center' border='1' width='80%'>
 <thead><tr><th>Name</th><th>Description</th></tr></thead>
 <tbody>
-<tr><td><tt>defval</tt> </td><td>Default values</td></tr>
-<tr><td><tt>keyword[PPD_MAX_NAME]</tt> </td><td>Parameter name</td></tr>
-<tr><td><tt>maxval</tt> </td><td>Maximum numeric values</td></tr>
-<tr><td><tt>minval</tt> </td><td>Minimum numeric values</td></tr>
-<tr><td><tt>text[PPD_MAX_TEXT]</tt> </td><td>Human-readable text</td></tr>
-<tr><td><tt>value</tt> </td><td>Current values</td></tr>
+<tr><td><tt>name[PPD_MAX_NAME]</tt> </td><td>Emulator name</td></tr>
+<tr><td><tt>start</tt> </td><td>Code to switch to this emulation</td></tr>
+<tr><td><tt>stop</tt> </td><td>Code to stop this emulation</td></tr>
 </tbody></table></div>
 <!-- NEW PAGE -->
-<h3 class='title'><a name='ppd_file_str'>ppd_file_str</a></h3>
+<h3 class='title'><a name='ppd_file_s'>ppd_file_s</a></h3>
 <h4>Description</h4>
-<p>Files</p>
+<p>PPD File</p>
 <h4>Definition</h4>
 <pre>
-struct ppd_file_str
+struct ppd_file_s
 {
   int accurate_screens;
   <a href='#ppd_attr_t'>ppd_attr_t</a> ** attrs;
@@ -868,12 +971,12 @@ struct ppd_file_str
   ppd_cs_t colorspace;
   <a href='#ppd_const_t'>ppd_const_t</a> * consts;
   int contone_only;
+  cups_array_t * coptions;
   int cur_attr;
   float custom_margins[4];
   float custom_max[2];
   float custom_min[2];
   <a href='#ppd_emul_t'>ppd_emul_t</a> * emulations;
-  <a href='#ppd_ext_option_t'>ppd_ext_option_t</a> ** extended;
   char ** filters;
   int flip_duplex;
   char ** fonts;
@@ -893,12 +996,12 @@ struct ppd_file_str
   int num_attrs;
   int num_consts;
   int num_emulations;
-  int num_extended;
   int num_filters;
   int num_fonts;
   int num_groups;
   int num_profiles;
   int num_sizes;
+  cups_array_t * options;
   char * patches;
   char * pcfilename;
   char * product;
@@ -906,6 +1009,7 @@ struct ppd_file_str
   char * protocols;
   char * shortnickname;
   <a href='#ppd_size_t'>ppd_size_t</a> * sizes;
+  cups_array_t * sorted_attrs;
   int throughput;
   char * ttrasterizer;
   int variable_sizes;
@@ -916,17 +1020,17 @@ struct ppd_file_str
 <thead><tr><th>Name</th><th>Description</th></tr></thead>
 <tbody>
 <tr><td><tt>accurate_screens</tt> </td><td>1 = supports accurate screens, 0 = not</td></tr>
-<tr><td><tt>attrs</tt> <span class='info'>&nbsp;CUPS 1.1.19&nbsp;</span></td><td>Attributes </td></tr>
+<tr><td><tt>attrs</tt> <span class='info'>&nbsp;CUPS 1.1.19&nbsp;</span></td><td>Attributes  @private@</td></tr>
 <tr><td><tt>color_device</tt> </td><td>1 = color device, 0 = grayscale</td></tr>
 <tr><td><tt>colorspace</tt> </td><td>Default colorspace</td></tr>
 <tr><td><tt>consts</tt> </td><td>UI/Non-UI constraints</td></tr>
 <tr><td><tt>contone_only</tt> </td><td>1 = continuous tone only, 0 = not</td></tr>
-<tr><td><tt>cur_attr</tt> <span class='info'>&nbsp;CUPS 1.1.19&nbsp;</span></td><td>Current attribute </td></tr>
+<tr><td><tt>coptions</tt> <span class='info'>&nbsp;CUPS 1.2&nbsp;</span></td><td>Custom options array  @private@</td></tr>
+<tr><td><tt>cur_attr</tt> <span class='info'>&nbsp;CUPS 1.1.19&nbsp;</span></td><td>Current attribute  @private@</td></tr>
 <tr><td><tt>custom_margins[4]</tt> </td><td>Margins around page</td></tr>
 <tr><td><tt>custom_max[2]</tt> </td><td>Maximum variable page size</td></tr>
 <tr><td><tt>custom_min[2]</tt> </td><td>Minimum variable page size</td></tr>
 <tr><td><tt>emulations</tt> </td><td>Emulations and the code to invoke them</td></tr>
-<tr><td><tt>extended</tt> <span class='info'>&nbsp;CUPS 1.2&nbsp;</span></td><td>Extended options </td></tr>
 <tr><td><tt>filters</tt> </td><td>Filter strings...</td></tr>
 <tr><td><tt>flip_duplex</tt> <span class='info'>&nbsp;CUPS 1.1&nbsp;</span></td><td>1 = Flip page for back sides </td></tr>
 <tr><td><tt>fonts</tt> </td><td>Pre-loaded fonts</td></tr>
@@ -943,15 +1047,15 @@ struct ppd_file_str
 <tr><td><tt>model_number</tt> </td><td>Device-specific model number</td></tr>
 <tr><td><tt>modelname</tt> </td><td>Model name (general)</td></tr>
 <tr><td><tt>nickname</tt> </td><td>Nickname (specific)</td></tr>
-<tr><td><tt>num_attrs</tt> <span class='info'>&nbsp;CUPS 1.1.19&nbsp;</span></td><td>Number of attributes </td></tr>
+<tr><td><tt>num_attrs</tt> <span class='info'>&nbsp;CUPS 1.1.19&nbsp;</span></td><td>Number of attributes  @private@</td></tr>
 <tr><td><tt>num_consts</tt> </td><td>Number of UI/Non-UI constraints</td></tr>
 <tr><td><tt>num_emulations</tt> </td><td>Number of emulations supported</td></tr>
-<tr><td><tt>num_extended</tt> <span class='info'>&nbsp;CUPS 1.2&nbsp;</span></td><td>Number of extended options </td></tr>
 <tr><td><tt>num_filters</tt> </td><td>Number of filters</td></tr>
 <tr><td><tt>num_fonts</tt> </td><td>Number of pre-loaded fonts</td></tr>
 <tr><td><tt>num_groups</tt> </td><td>Number of UI groups</td></tr>
 <tr><td><tt>num_profiles</tt> </td><td>Number of sRGB color profiles</td></tr>
 <tr><td><tt>num_sizes</tt> </td><td>Number of page sizes</td></tr>
+<tr><td><tt>options</tt> <span class='info'>&nbsp;CUPS 1.2&nbsp;</span></td><td>Option lookup array  @private@</td></tr>
 <tr><td><tt>patches</tt> </td><td>Patch commands to be sent to printer</td></tr>
 <tr><td><tt>pcfilename</tt> <span class='info'>&nbsp;CUPS 1.1.19&nbsp;</span></td><td>PCFileName string </td></tr>
 <tr><td><tt>product</tt> </td><td>Product name (from PS RIP/interpreter)</td></tr>
@@ -959,24 +1063,25 @@ struct ppd_file_str
 <tr><td><tt>protocols</tt> <span class='info'>&nbsp;CUPS 1.1.19&nbsp;</span></td><td>Protocols (BCP, TBCP) string </td></tr>
 <tr><td><tt>shortnickname</tt> </td><td>Short version of nickname</td></tr>
 <tr><td><tt>sizes</tt> </td><td>Page sizes</td></tr>
+<tr><td><tt>sorted_attrs</tt> <span class='info'>&nbsp;CUPS 1.2&nbsp;</span></td><td>Attribute lookup array  @private@</td></tr>
 <tr><td><tt>throughput</tt> </td><td>Pages per minute</td></tr>
 <tr><td><tt>ttrasterizer</tt> </td><td>Truetype rasterizer</td></tr>
 <tr><td><tt>variable_sizes</tt> </td><td>1 = supports variable sizes, 0 = doesn't</td></tr>
 </tbody></table></div>
 <!-- NEW PAGE -->
-<h3 class='title'><a name='ppd_group_str'>ppd_group_str</a></h3>
+<h3 class='title'><a name='ppd_group_s'>ppd_group_s</a></h3>
 <h4>Description</h4>
 <p>Groups</p>
 <h4>Definition</h4>
 <pre>
-struct ppd_group_str
+struct ppd_group_s
 {
   char text[PPD_MAX_TEXT - PPD_MAX_NAME];
   char name[PPD_MAX_NAME];
   int num_options;
   int num_subgroups;
   <a href='#ppd_option_t'>ppd_option_t</a> * options;
-  struct <a href='#ppd_group_str'>ppd_group_str</a> * subgroups;
+  struct <a href='#ppd_group_s'>ppd_group_s</a> * subgroups;
 };
 </pre>
 <h4>Members</h4>
@@ -991,12 +1096,12 @@ struct ppd_group_str
 <tr><td><tt>subgroups</tt> </td><td>Sub-groups (max depth = 1)</td></tr>
 </tbody></table></div>
 <!-- NEW PAGE -->
-<h3 class='title'><a name='ppd_option_str'>ppd_option_str</a></h3>
+<h3 class='title'><a name='ppd_option_s'>ppd_option_s</a></h3>
 <h4>Description</h4>
 <p>Options</p>
 <h4>Definition</h4>
 <pre>
-struct ppd_option_str
+struct ppd_option_s
 {
   <a href='#ppd_choice_t'>ppd_choice_t</a> * choices;
   char conflicted;
@@ -1024,12 +1129,12 @@ struct ppd_option_str
 <tr><td><tt>ui</tt> </td><td>Type of UI option</td></tr>
 </tbody></table></div>
 <!-- NEW PAGE -->
-<h3 class='title'><a name='ppd_profile_str'>ppd_profile_str</a></h3>
+<h3 class='title'><a name='ppd_profile_s'>ppd_profile_s</a></h3>
 <h4>Description</h4>
 <p>sRGB Color Profiles</p>
 <h4>Definition</h4>
 <pre>
-struct ppd_profile_str
+struct ppd_profile_s
 {
   float density;
   float gamma;
@@ -1049,12 +1154,12 @@ struct ppd_profile_str
 <tr><td><tt>resolution[PPD_MAX_NAME]</tt> </td><td>Resolution or &quot;-&quot;</td></tr>
 </tbody></table></div>
 <!-- NEW PAGE -->
-<h3 class='title'><a name='ppd_size_str'>ppd_size_str</a></h3>
+<h3 class='title'><a name='ppd_size_s'>ppd_size_s</a></h3>
 <h4>Description</h4>
 <p>Page Sizes</p>
 <h4>Definition</h4>
 <pre>
-struct ppd_size_str
+struct ppd_size_s
 {
   float bottom;
   float left;
@@ -1085,11 +1190,11 @@ struct ppd_size_str
        <li><a href='#ppd_attr_t'><tt>ppd_attr_t</tt></a> <span class='info'>&nbsp;CUPS 1.1.19&nbsp;</span></li>
        <li><a href='#ppd_choice_t'><tt>ppd_choice_t</tt></a> </li>
        <li><a href='#ppd_const_t'><tt>ppd_const_t</tt></a> </li>
+       <li><a href='#ppd_coption_t'><tt>ppd_coption_t</tt></a> <span class='info'>&nbsp;CUPS 1.2&nbsp;</span></li>
+       <li><a href='#ppd_cparam_t'><tt>ppd_cparam_t</tt></a> <span class='info'>&nbsp;CUPS 1.2&nbsp;</span></li>
+       <li><a href='#ppd_cptype_t'><tt>ppd_cptype_t</tt></a> <span class='info'>&nbsp;CUPS 1.2&nbsp;</span></li>
+       <li><a href='#ppd_cpvalue_t'><tt>ppd_cpvalue_t</tt></a> <span class='info'>&nbsp;CUPS 1.2&nbsp;</span></li>
        <li><a href='#ppd_emul_t'><tt>ppd_emul_t</tt></a> </li>
-       <li><a href='#ppd_ext_option_t'><tt>ppd_ext_option_t</tt></a> <span class='info'>&nbsp;CUPS 1.2&nbsp;</span></li>
-       <li><a href='#ppd_ext_param_t'><tt>ppd_ext_param_t</tt></a> <span class='info'>&nbsp;CUPS 1.2&nbsp;</span></li>
-       <li><a href='#ppd_ext_ui_t'><tt>ppd_ext_ui_t</tt></a> <span class='info'>&nbsp;CUPS 1.2&nbsp;</span></li>
-       <li><a href='#ppd_ext_value_t'><tt>ppd_ext_value_t</tt></a> <span class='info'>&nbsp;CUPS 1.2&nbsp;</span></li>
        <li><a href='#ppd_file_t'><tt>ppd_file_t</tt></a> </li>
        <li><a href='#ppd_group_t'><tt>ppd_group_t</tt></a> </li>
        <li><a href='#ppd_option_t'><tt>ppd_option_t</tt></a> </li>
@@ -1104,7 +1209,7 @@ struct ppd_size_str
 <p>PPD Attribute Structure </p>
 <h4>Definition</h4>
 <pre>
-typedef struct <a href='#ppd_attr_str'>ppd_attr_str</a> ppd_attr_t;
+typedef struct <a href='#ppd_attr_s'>ppd_attr_s</a> ppd_attr_t;
 </pre>
 <!-- NEW PAGE -->
 <h3 class='title'><a name='ppd_choice_t'>ppd_choice_t</a></h3>
@@ -1112,7 +1217,7 @@ typedef struct <a href='#ppd_attr_str'>ppd_attr_str</a> ppd_attr_t;
 <p>Option choices</p>
 <h4>Definition</h4>
 <pre>
-typedef struct <a href='#ppd_choice_str'>ppd_choice_str</a> ppd_choice_t;
+typedef struct <a href='#ppd_choice_s'>ppd_choice_s</a> ppd_choice_t;
 </pre>
 <!-- NEW PAGE -->
 <h3 class='title'><a name='ppd_const_t'>ppd_const_t</a></h3>
@@ -1123,52 +1228,52 @@ typedef struct <a href='#ppd_choice_str'>ppd_choice_str</a> ppd_choice_t;
 typedef struct ppd_const_t;
 </pre>
 <!-- NEW PAGE -->
-<h3 class='title'><a name='ppd_emul_t'>ppd_emul_t</a></h3>
+<h3 class='title'><span class='info'>&nbsp;CUPS 1.2&nbsp;</span><a name='ppd_coption_t'>ppd_coption_t</a></h3>
 <h4>Description</h4>
-<p>Emulators</p>
+<p>Custom Option </p>
 <h4>Definition</h4>
 <pre>
-typedef struct <a href='#ppd_emul_str'>ppd_emul_str</a> ppd_emul_t;
+typedef struct <a href='#ppd_coption_s'>ppd_coption_s</a> ppd_coption_t;
 </pre>
 <!-- NEW PAGE -->
-<h3 class='title'><span class='info'>&nbsp;CUPS 1.2&nbsp;</span><a name='ppd_ext_option_t'>ppd_ext_option_t</a></h3>
+<h3 class='title'><span class='info'>&nbsp;CUPS 1.2&nbsp;</span><a name='ppd_cparam_t'>ppd_cparam_t</a></h3>
 <h4>Description</h4>
-<p>Extended Options </p>
+<p>Custom Parameter </p>
 <h4>Definition</h4>
 <pre>
-typedef struct <a href='#ppd_ext_option_str'>ppd_ext_option_str</a> ppd_ext_option_t;
+typedef struct <a href='#ppd_cparam_s'>ppd_cparam_s</a> ppd_cparam_t;
 </pre>
 <!-- NEW PAGE -->
-<h3 class='title'><span class='info'>&nbsp;CUPS 1.2&nbsp;</span><a name='ppd_ext_param_t'>ppd_ext_param_t</a></h3>
+<h3 class='title'><span class='info'>&nbsp;CUPS 1.2&nbsp;</span><a name='ppd_cptype_t'>ppd_cptype_t</a></h3>
 <h4>Description</h4>
-<p>Extended Parameter </p>
+<p>Custom Parameter Type </p>
 <h4>Definition</h4>
 <pre>
-typedef struct <a href='#ppd_ext_param_str'>ppd_ext_param_str</a> ppd_ext_param_t;
+typedef enum <a href='#ppd_cptype_e'>ppd_cptype_e</a> ppd_cptype_t;
 </pre>
 <!-- NEW PAGE -->
-<h3 class='title'><span class='info'>&nbsp;CUPS 1.2&nbsp;</span><a name='ppd_ext_ui_t'>ppd_ext_ui_t</a></h3>
+<h3 class='title'><span class='info'>&nbsp;CUPS 1.2&nbsp;</span><a name='ppd_cpvalue_t'>ppd_cpvalue_t</a></h3>
 <h4>Description</h4>
-<p>Extended UI Types </p>
+<p>Custom Parameter Value </p>
 <h4>Definition</h4>
 <pre>
-typedef enum <a href='#ppd_ext_ui_e'>ppd_ext_ui_e</a> ppd_ext_ui_t;
+typedef union <a href='#ppd_cpvalue_u'>ppd_cpvalue_u</a> ppd_cpvalue_t;
 </pre>
 <!-- NEW PAGE -->
-<h3 class='title'><span class='info'>&nbsp;CUPS 1.2&nbsp;</span><a name='ppd_ext_value_t'>ppd_ext_value_t</a></h3>
+<h3 class='title'><a name='ppd_emul_t'>ppd_emul_t</a></h3>
 <h4>Description</h4>
-<p>Extended Values </p>
+<p>Emulators</p>
 <h4>Definition</h4>
 <pre>
-typedef union <a href='#ppd_ext_value_u'>ppd_ext_value_u</a> ppd_ext_value_t;
+typedef struct <a href='#ppd_emul_s'>ppd_emul_s</a> ppd_emul_t;
 </pre>
 <!-- NEW PAGE -->
 <h3 class='title'><a name='ppd_file_t'>ppd_file_t</a></h3>
 <h4>Description</h4>
-<p>Files</p>
+<p>PPD File</p>
 <h4>Definition</h4>
 <pre>
-typedef struct <a href='#ppd_file_str'>ppd_file_str</a> ppd_file_t;
+typedef struct <a href='#ppd_file_s'>ppd_file_s</a> ppd_file_t;
 </pre>
 <!-- NEW PAGE -->
 <h3 class='title'><a name='ppd_group_t'>ppd_group_t</a></h3>
@@ -1176,7 +1281,7 @@ typedef struct <a href='#ppd_file_str'>ppd_file_str</a> ppd_file_t;
 <p>Groups</p>
 <h4>Definition</h4>
 <pre>
-typedef struct <a href='#ppd_group_str'>ppd_group_str</a> ppd_group_t;
+typedef struct <a href='#ppd_group_s'>ppd_group_s</a> ppd_group_t;
 </pre>
 <!-- NEW PAGE -->
 <h3 class='title'><a name='ppd_option_t'>ppd_option_t</a></h3>
@@ -1184,7 +1289,7 @@ typedef struct <a href='#ppd_group_str'>ppd_group_str</a> ppd_group_t;
 <p>Options</p>
 <h4>Definition</h4>
 <pre>
-typedef struct <a href='#ppd_option_str'>ppd_option_str</a> ppd_option_t;
+typedef struct <a href='#ppd_option_s'>ppd_option_s</a> ppd_option_t;
 </pre>
 <!-- NEW PAGE -->
 <h3 class='title'><a name='ppd_profile_t'>ppd_profile_t</a></h3>
@@ -1192,7 +1297,7 @@ typedef struct <a href='#ppd_option_str'>ppd_option_str</a> ppd_option_t;
 <p>sRGB Color Profiles</p>
 <h4>Definition</h4>
 <pre>
-typedef struct <a href='#ppd_profile_str'>ppd_profile_str</a> ppd_profile_t;
+typedef struct <a href='#ppd_profile_s'>ppd_profile_s</a> ppd_profile_t;
 </pre>
 <!-- NEW PAGE -->
 <h3 class='title'><a name='ppd_section_t'>ppd_section_t</a></h3>
@@ -1208,7 +1313,7 @@ typedef enum <a href='#ppd_section_e'>ppd_section_e</a> ppd_section_t;
 <p>Page Sizes</p>
 <h4>Definition</h4>
 <pre>
-typedef struct <a href='#ppd_size_str'>ppd_size_str</a> ppd_size_t;
+typedef struct <a href='#ppd_size_s'>ppd_size_s</a> ppd_size_t;
 </pre>
 <!-- NEW PAGE -->
 <h3 class='title'><a name='ppd_ui_t'>ppd_ui_t</a></h3>
@@ -1221,30 +1326,38 @@ typedef enum <a href='#ppd_ui_e'>ppd_ui_e</a> ppd_ui_t;
 <!-- NEW PAGE -->
 <h2 class='title'><a name='UNIONS'>Unions</a></h2>
 <ul>
-       <li><a href='#ppd_ext_value_u'><tt>ppd_ext_value_u</tt></a> <span class='info'>&nbsp;CUPS 1.2&nbsp;</span></li>
+       <li><a href='#ppd_cpvalue_u'><tt>ppd_cpvalue_u</tt></a> <span class='info'>&nbsp;CUPS 1.2&nbsp;</span></li>
 </ul>
 <!-- NEW PAGE -->
-<h3 class='title'><span class='info'>&nbsp;CUPS 1.2&nbsp;</span><a name='ppd_ext_value_u'>ppd_ext_value_u</a></h3>
+<h3 class='title'><span class='info'>&nbsp;CUPS 1.2&nbsp;</span><a name='ppd_cpvalue_u'>ppd_cpvalue_u</a></h3>
 <h4>Description</h4>
-<p>Extended Values </p>
+<p>Custom Parameter Value </p>
 <h4>Definition</h4>
 <pre>
-union ppd_ext_value_u
+union ppd_cpvalue_u
 {
-  float gamma;
-  int integer;
-  float real;
-  char * text;
+  float custom_curve;
+  int custom_int;
+  float custom_invcurve;
+  char * custom_passcode;
+  char * custom_password;
+  float custom_points;
+  float custom_real;
+  char * custom_string;
 };
 </pre>
 <h4>Members</h4>
 <div class='table'><table align='center' border='1' width='80%'>
 <thead><tr><th>Name</th><th>Description</th></tr></thead>
 <tbody>
-<tr><td><tt>gamma</tt> </td><td>Gamma value</td></tr>
-<tr><td><tt>integer</tt> </td><td>Integer value</td></tr>
-<tr><td><tt>real</tt> </td><td>Real value</td></tr>
-<tr><td><tt>text</tt> </td><td>Text value</td></tr>
+<tr><td><tt>custom_curve</tt> </td><td>Gamma value</td></tr>
+<tr><td><tt>custom_int</tt> </td><td>Integer value</td></tr>
+<tr><td><tt>custom_invcurve</tt> </td><td>Gamma value</td></tr>
+<tr><td><tt>custom_passcode</tt> </td><td>Passcode value</td></tr>
+<tr><td><tt>custom_password</tt> </td><td>Password value</td></tr>
+<tr><td><tt>custom_points</tt> </td><td>Measurement value</td></tr>
+<tr><td><tt>custom_real</tt> </td><td>Real value</td></tr>
+<tr><td><tt>custom_string</tt> </td><td>String value</td></tr>
 </tbody></table></div>
 </body>
 </html>
index eb9ac267bff71ee2a9fef4872b6fe097927f2f7e..6dc27cb6b6513e1131f9f220e2f9e9d7770e58cb 100644 (file)
@@ -8,7 +8,7 @@
 </head>
 <body>
 <!--
-  "$Id: spec-ppd.html 5023 2006-01-29 14:39:44Z mike $"
+  "$Id: spec-ppd.html 5138 2006-02-21 10:49:06Z mike $"
 
   CUPS PPD extensions specification for the Common UNIX Printing System (CUPS).
 
@@ -457,7 +457,7 @@ attributes define the mapping from selector to main keyword:</p>
 </pre>
 
 
-<h2 class='title'><a name='I18N'>Global PPD Support</a></h2>
+<h2 class='title'><a name='I18N'>Globalized PPD Support</a></h2>
 
 <p>CUPS 1.2 and higher adds support for PPD files containing multiple
 languages by following the following additional rules:</p>
@@ -556,7 +556,7 @@ in the PPD file for a given locale.</blockquote>
 
 <ul>
 
-       <li>Added I18N support attributes</li>
+       <li>Added globalization support attributes</li>
 
        <li>Added custom option values support</li>
 
index 1c32e7ad3df759045e4418bc10f5e67cf2410f86..d6186fb5fe1773194ba58e0f4624d3cb1f1ba067 100644 (file)
@@ -2,7 +2,7 @@
 <HTML>
 <HEAD>
        <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
-       <TITLE>Home - CUPS @CUPS_VERSION@</TITLE>
+       <TITLE>Home - CUPS @CUPS_VERSION@@CUPS_REVISION@</TITLE>
        <LINK REL="STYLESHEET" TYPE="text/css" HREF="/cups.css">
        <LINK REL="SHORTCUT ICON" HREF="/favicon.ico" TYPE="image/x-icon">
 </HEAD>
@@ -11,7 +11,7 @@
 <TR CLASS="HEADER">
 <TD VALIGN="TOP" WIDTH="15" ROWSPAN="2"><IMG SRC="/images/top-left.gif" WIDTH="15" HEIGHT="80" ALT=""></TD>
 <TD VALIGN="TOP" WIDTH="55" ROWSPAN="2"><IMG SRC="/images/top-middle.gif" WIDTH="55" HEIGHT="80" ALT=""></TD>
-<TD WIDTH="100%" HEIGHT="60"><H1>Common UNIX Printing System @CUPS_VERSION@</H1></TD>
+<TD WIDTH="100%" HEIGHT="60"><H1>Common UNIX Printing System @CUPS_VERSION@@CUPS_REVISION@</H1></TD>
 <TD ALIGN="RIGHT" VALIGN="TOP" WIDTH="15" ROWSPAN="2"><IMG
 SRC="/images/top-right.gif" WIDTH="15" HEIGHT="15" ALT=""></TD>
 </TR>
index f749437622c87c31134a3ce2a0fb238bb859be05..02c50a892eb5d688276f2ec5b7af5987325159b4 100644 (file)
@@ -2,7 +2,7 @@
 <HTML>
 <HEAD>
        <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
-       <TITLE>ホーム - CUPS @CUPS_VERSION@</TITLE>
+       <TITLE>ホーム - CUPS @CUPS_VERSION@@CUPS_REVISION@</TITLE>
        <LINK REL="STYLESHEET" TYPE="text/css" HREF="/cups.css">
        <LINK REL="SHORTCUT ICON" HREF="/favicon.ico" TYPE="image/x-icon">
 </HEAD>
@@ -11,7 +11,7 @@
 <TR CLASS="HEADER">
 <TD VALIGN="TOP" WIDTH="15" ROWSPAN="2"><IMG SRC="/images/top-left.gif" WIDTH="15" HEIGHT="80" ALT=""></TD>
 <TD VALIGN="TOP" WIDTH="55" ROWSPAN="2"><IMG SRC="/images/top-middle.gif" WIDTH="55" HEIGHT="80" ALT=""></TD>
-<TD WIDTH="100%" HEIGHT="60"><H1>Common UNIX Printing System @CUPS_VERSION@</H1></TD>
+<TD WIDTH="100%" HEIGHT="60"><H1>Common UNIX Printing System @CUPS_VERSION@@CUPS_REVISION@</H1></TD>
 <TD ALIGN="RIGHT" VALIGN="TOP" WIDTH="15" ROWSPAN="2"><IMG
 SRC="/images/top-right.gif" WIDTH="15" HEIGHT="15" ALT=""></TD>
 </TR>
index 3b44813a65c9f4c8132fc06fa4150e8916cd21bd..a583231aeb1ba33ed9e339a17c85088910c57208 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: mantohtml.c 5099 2006-02-13 02:46:10Z mike $"
+ * "$Id: mantohtml.c 5142 2006-02-21 14:52:34Z mike $"
  *
  *   Man page to HTML conversion program.
  *
@@ -34,6 +34,7 @@
 
 #include <cups/string.h>
 #include <stdlib.h>
+#include <unistd.h>
 
 
 /*
@@ -724,5 +725,5 @@ strmove(char       *d,                      /* I - Destination */
 
 
 /*
- * End of "$Id: mantohtml.c 5099 2006-02-13 02:46:10Z mike $".
+ * End of "$Id: mantohtml.c 5142 2006-02-21 14:52:34Z mike $".
  */
index 7ca8bcbc28691b811f0a5c374ec2a155f3554914..da7ca0794580130453c380e4a807fe38647436c7 100644 (file)
@@ -1,5 +1,5 @@
 #
-# "$Id: cups.spec.in 5136 2006-02-19 18:46:46Z mike $"
+# "$Id: cups.spec.in 5146 2006-02-22 14:03:50Z mike $"
 #
 #   RPM "spec" file for the Common UNIX Printing System (CUPS).
 #
 #         WWW: http://www.cups.org
 #
 
+# Conditional build options (--with name/--without name):
+#
+#   dbus     - Enable/disable DBUS support (default = enable)
+
+%{!?_with_dbus: %{!?_without_dbus: %define _with_dbus --with-dbus}}
+%{?_with_dbus: %define _dbus --enable-dbus}
+%{!?_with_dbus: %define _dbus --disable-dbus}
+
 Summary: Common UNIX Printing System
 Name: cups
 Version: @CUPS_VERSION@
@@ -91,7 +99,7 @@ UNIX
 %setup
 
 %build
-CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" LDFLAGS="$RPM_OPT_FLAGS" ./configure
+CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" LDFLAGS="$RPM_OPT_FLAGS" ./configure %{_dbus}
 
 # If we got this far, all prerequisite libraries must be here.
 make
@@ -144,8 +152,10 @@ rm -rf $RPM_BUILD_ROOT
 /etc/cups/mime.convs
 %dir /etc/cups/ppd
 
+%if %{?_with_dbus:1}%{!?_with_dbus:0}
 # DBUS
 /etc/dbus-1/system.d/*
+%endif
 
 # PAM
 %dir /etc/pam.d
@@ -291,5 +301,5 @@ rm -rf $RPM_BUILD_ROOT
 /usr/share/locale/ja/cups_ja.po
 
 #
-# End of "$Id: cups.spec.in 5136 2006-02-19 18:46:46Z mike $".
+# End of "$Id: cups.spec.in 5146 2006-02-22 14:03:50Z mike $".
 #
index e04a4875c0e5af25c5904069c0b48d56871b1bbf..9423e1b378655ba757b024c6c78839cdbf0f356e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: printers.c 5132 2006-02-19 14:57:11Z mike $"
+ * "$Id: printers.c 5143 2006-02-21 19:13:01Z mike $"
  *
  *   Printer routines for the Common UNIX Printing System (CUPS).
  *
@@ -2621,21 +2621,24 @@ add_printer_filter(
   * the error!
   */
 
-  if (program[0] == '/')
-    strlcpy(filename, program, sizeof(filename));
-  else
-    snprintf(filename, sizeof(filename), "%s/filter/%s", ServerBin, program);
-
-  if (access(filename, X_OK))
+  if (strcmp(program, "-"))
   {
-    snprintf(p->state_message, sizeof(p->state_message),
-             "Filter \"%s\" for printer \"%s\" not available: %s",
-            program, p->name, strerror(errno));
-    cupsdSetPrinterState(p, IPP_PRINTER_STOPPED, 0);
-    cupsdSetPrinterReasons(p, "+cups-missing-filter-error");
-    cupsdAddPrinterHistory(p);
-
-    cupsdLogMessage(CUPSD_LOG_ERROR, "%s", p->state_message);
+    if (program[0] == '/')
+      strlcpy(filename, program, sizeof(filename));
+    else
+      snprintf(filename, sizeof(filename), "%s/filter/%s", ServerBin, program);
+
+    if (access(filename, X_OK))
+    {
+      snprintf(p->state_message, sizeof(p->state_message),
+               "Filter \"%s\" for printer \"%s\" not available: %s",
+              program, p->name, strerror(errno));
+      cupsdSetPrinterState(p, IPP_PRINTER_STOPPED, 0);
+      cupsdSetPrinterReasons(p, "+cups-missing-filter-error");
+      cupsdAddPrinterHistory(p);
+
+      cupsdLogMessage(CUPSD_LOG_ERROR, "%s", p->state_message);
+    }
   }
 
  /*
@@ -3106,5 +3109,5 @@ write_irix_state(cupsd_printer_t *p)      /* I - Printer to update */
 
 
 /*
- * End of "$Id: printers.c 5132 2006-02-19 14:57:11Z mike $".
+ * End of "$Id: printers.c 5143 2006-02-21 19:13:01Z mike $".
  */
index 40736d2c6d2b6d40e7cccf346f6a68100244028b..b9c4c76f1936634207e9f1cba2671910bbecedfd 100644 (file)
@@ -1,5 +1,5 @@
 #
-# "$Id: Makefile 4966 2006-01-23 00:41:22Z mike $"
+# "$Id: Makefile 5143 2006-02-21 19:13:01Z mike $"
 #
 #   Standards makefile for the Common UNIX Printing System (CUPS).
 #
@@ -105,9 +105,10 @@ install:   all
 #
 
 rfctohtml:     rfctohtml.o ../cups/libcups.a
-       $(CC) $(LDFLAGS) -o $@ rfctohtml.o ../cups/libcups.a $(LIBZ)
+       $(CC) $(LDFLAGS) -o $@ rfctohtml.o ../cups/libcups.a \
+               $(COMMONLIBS) $(LIBZ)
 
 
 #
-# End of "$Id: Makefile 4966 2006-01-23 00:41:22Z mike $".
+# End of "$Id: Makefile 5143 2006-02-21 19:13:01Z mike $".
 #
index a13c1e9227ea78bd5a0090c9927a3b9a7a029372..64f6b468841362f8ad3b3ee9081620f0ea7fe228 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: rfctohtml.c 4966 2006-01-23 00:41:22Z mike $"
+ * "$Id: rfctohtml.c 5143 2006-02-21 19:13:01Z mike $"
  *
  *   RFC file to HTML conversion program.
  *
@@ -23,6 +23,9 @@
  *
  * Contents:
  *
+ *   main()       - Convert a man page to HTML.
+ *   put_entity() - Put a single character, using entities as needed.
+ *   put_line()   - Put a whole string for a line.
  */
 
 /*
@@ -56,7 +59,8 @@ main(int  argc,                               /* I - Number of command-line args */
                *lineptr,               /* Pointer into line */
                name[1024],             /* Heading anchor name */
                *nameptr;               /* Pointer into anchor name */
-  int          inheading,              /* Inside a heading? */
+  int          rfc,                    /* RFC # */
+               inheading,              /* Inside a heading? */
                inpre,                  /* Inside preformatted text? */
                intoc,                  /* Inside table-of-contents? */
                toclevel,               /* Current table-of-contents level */
@@ -113,7 +117,7 @@ main(int  argc,                             /* I - Number of command-line args */
               "\t<style type='text/css'><!--\n"
               "\th1, h2, h3 { font-family: sans-serif; }\n"
               "\tp, pre { font-family: monospace; }\n"
-              "\th1.title, h2.title, h3.title { border-bottom: solid "
+              "\th2.title, h3.title, h3.title { border-bottom: solid "
               "2px #000000; }\n"
               "\t--></style>\n");
 
@@ -123,6 +127,7 @@ main(int  argc,                             /* I - Number of command-line args */
   */
 
   linenum = 0;
+  rfc     = 0;
 
   while (cupsFileGets(infile, line, sizeof(line)))
   {
@@ -138,6 +143,8 @@ main(int  argc,                             /* I - Number of command-line args */
 
     if (!line[0])
       break;
+    else if (!strncasecmp(line, "Request for Comments:", 21))
+      rfc = atoi(line + 21);
   }
 
  /*
@@ -154,7 +161,7 @@ main(int  argc,                             /* I - Number of command-line args */
 
   for (lineptr = line; isspace(*lineptr & 255); lineptr ++);
 
-  cupsFilePrintf(outfile, "<title>%s", lineptr);
+  cupsFilePrintf(outfile, "<title>RFC %d: %s", rfc, lineptr);
 
   while (cupsFileGets(infile, line, sizeof(line)))
   {
@@ -340,7 +347,7 @@ main(int  argc,                             /* I - Number of command-line args */
       }
 
       strlcpy(name, line, sizeof(name));
-      for (nameptr = name, level = 0; *nameptr;)
+      for (nameptr = name, level = 1; *nameptr;)
         if (isdigit(*nameptr & 255))
        {
          while (isdigit(*nameptr & 255))
@@ -356,7 +363,8 @@ main(int  argc,                             /* I - Number of command-line args */
        else
          nameptr ++;
 
-      cupsFilePrintf(outfile, "\n<h%d class='title'><a name='s%s'>", level, name);
+      cupsFilePrintf(outfile, "\n<h%d class='title'><a name='s%s'>", level,
+                     name);
       put_line(outfile, line);
 
       intoc     = 0;
@@ -378,7 +386,7 @@ main(int  argc,                             /* I - Number of command-line args */
 
       if (!inheading)
       {
-        cupsFilePuts(outfile, "\n<h1 class='title'>");
+        cupsFilePuts(outfile, "\n<h2 class='title'>");
         inheading = -1;
       }
 
@@ -395,7 +403,7 @@ main(int  argc,                             /* I - Number of command-line args */
   if (inheading)
   {
     if (inheading < 0)
-      cupsFilePuts(outfile, "</h1>\n");
+      cupsFilePuts(outfile, "</h2>\n");
     else
       cupsFilePrintf(outfile, "</a></h%d>\n", inheading);
   }
@@ -493,5 +501,5 @@ put_line(cups_file_t *fp,           /* I - File */
 
 
 /*
- * End of "$Id: rfctohtml.c 4966 2006-01-23 00:41:22Z mike $".
+ * End of "$Id: rfctohtml.c 5143 2006-02-21 19:13:01Z mike $".
  */
index 8ffd7de802458a83598dcb1c6dd7d78ffffc41b2..e0fa574ce977b24c2aa12bea9de524c5762b9177 100644 (file)
@@ -2,7 +2,7 @@
 <HTML>
 <HEAD>
        <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
-       <TITLE>{title} - CUPS @CUPS_VERSION@</TITLE>
+       <TITLE>{title} - CUPS @CUPS_VERSION@@CUPS_REVISION@</TITLE>
        <!-- Prevent caching of CGI content -->
        <META HTTP-EQUIV="Expires" CONTENT="now">
        <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> 
index 50858a921b477d770b589679abf4596042ea3286..fdd0516ef1474516fb2fbb26f04da904c46f4abe 100755 (executable)
@@ -19,6 +19,7 @@ if test $# = 0; then
        svn up
        rev=`svnversion . | sed -e '1,$s/[a-zA-Z]//g'`
        version="1.2svn"
+       revision="-r$rev"
        fileversion="1.2svn-r$rev"
        fileurl="ftp://ftp.easysw.com/pub/cups/test/cups-$fileversion-source.tar.bz2"
        url="."
@@ -26,6 +27,7 @@ else
        echo Creating tag for release...
        rev="1"
        version=$1
+       revision=""
        fileversion=$1
        fileurl="ftp://ftp.easysw.com/pub/cups/$version/cups-$fileversion-source.tar.bz2"
        url="https://svn.easysw.com/public/cups/tags/release-$version"
@@ -42,6 +44,7 @@ echo Updating version information...
 cd /tmp/cups-$version/config-scripts
 
 sed -e '1,$s/^CUPS_VERSION=.*/CUPS_VERSION='$fileversion'/' \
+       -e '1,$s/^CUPS_REVISION=.*/CUPS_REVISION='$revision'/' \
        <cups-common.m4 >cups-common.m4.new
 mv cups-common.m4.new cups-common.m4
 cd ..
index 58aa52160c62060aed3195bc4fa08c3c5e45e84a..98891cb2535c321dafaa30fc5e6b8e12740da13e 100755 (executable)
@@ -63,10 +63,6 @@ sed -e '1,$s/@CUPS_VERSION@/1.2svn-r'$rev'/g' \
 sed -e '1,$s/@CUPS_VERSION@/1.2svn-r'$rev'/g' \
        -e '1,$s/@CUPS_RELEASE@/1.2.'$rev'/g' \
        <packaging/cups-info.plist.in >packaging/cups-info.plist
-sed -e '1,$s/@CUPS_VERSION@/1.2svn-r'$rev'/g' \
-       <doc/index.html.in >doc/index.html
-sed -e '1,$s/@CUPS_VERSION@/1.2svn-r'$rev'/g' \
-       <templates/header.tmpl.in >templates/header.tmpl
 
 # Install CUPS into the Package directory...
 #make INSTALL=$topdir/install-sh BUILDROOT=$pkgdir/Package install
index 047200ef7e992dd2f997c4545d37f09dc3c9603a..74d1449e4af0fdfc79cc1255f8156075be28e46e 100755 (executable)
@@ -9,11 +9,15 @@
 if test ! -f tools/testrpm; then
         echo "Run this script from the top-level CUPS source directory, e.g.:"
         echo ""
-        echo "    tools/testrpm"
+        echo "    tools/testrpm [rpmbuild options]"
         echo ""
         exit 1
 fi
 
+# Strip command-line arguments so we don't create a release tag...
+args="$*"
+shift $#
+
 # Get a snapshot of the current source...
 . tools/makesrcdist
 
@@ -21,7 +25,7 @@ fi
 echo Building rpm...
 rm -f /usr/src/redhat/RPMS/i386/cups*.rpm
 rm -f /usr/src/redhat/SRPMS/cups*.rpm
-rpmbuild -ta cups-$fileversion-source.tar.bz2
+rpmbuild -ta $args cups-$fileversion-source.tar.bz2
 
 #
 # End of "$Id$".