From ecdc06282a65bd04f801c877d2ceb83106d737e1 Mon Sep 17 00:00:00 2001 From: jlovell Date: Wed, 22 Feb 2006 16:59:36 +0000 Subject: [PATCH] Load cups into easysw/current. git-svn-id: svn+ssh://src.apple.com/svn/cups/easysw/current@63 a1ca3aef-8c08-0410-bb20-df032aa958be --- CHANGES.txt | 4 + cgi-bin/Makefile | 19 +- cgi-bin/help-index.c | 394 ++---- cgi-bin/help-index.h | 24 +- cgi-bin/help.c | 117 +- cgi-bin/testhi.c | 34 +- config-scripts/cups-common.m4 | 44 +- config.h.in | 6 +- cups/Dependencies | 2 + cups/Makefile | 14 +- cups/api-array.shtml | 4 +- cups/api-cups.shtml | 12 +- cups/api-filedir.shtml | 2 +- cups/api-filter.shtml | 10 +- cups/api-httpipp.shtml | 10 +- cups/api-ppd.shtml | 10 +- cups/backchannel.c | 18 +- cups/cups.h | 34 +- cups/dest.c | 14 +- cups/file.c | 31 +- cups/getputfile.c | 12 +- cups/globals.h | 5 +- cups/http-addr.c | 27 +- cups/http-support.c | 35 +- cups/http.c | 361 ++++-- cups/http.h | 22 +- cups/ipp-support.c | 6 +- cups/ipp.h | 402 +++--- cups/ppd.h | 6 +- cups/request.c | 441 +++++++ cups/usersys.c | 7 +- cups/util.c | 433 +------ doc/cups.css | 4 +- doc/help/api-array.html | 54 +- doc/help/api-cups.html | 319 ++--- doc/help/api-filedir.html | 35 +- doc/help/api-filter.html | 28 +- doc/help/api-httpipp.html | 2259 +++++++++++---------------------- doc/help/api-ppd.html | 371 ++++-- doc/help/spec-ppd.html | 6 +- doc/index.html.in | 4 +- doc/ja/index.html.in | 4 +- man/mantohtml.c | 5 +- packaging/cups.spec.in | 16 +- scheduler/printers.c | 35 +- standards/Makefile | 7 +- standards/rfctohtml.c | 26 +- templates/header.tmpl.in | 2 +- tools/makesrcdist | 3 + tools/testosx | 4 - tools/testrpm | 8 +- 51 files changed, 2687 insertions(+), 3063 deletions(-) create mode 100644 cups/request.c diff --git a/CHANGES.txt b/CHANGES.txt index fc1ac357e..a9d78226d 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -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 diff --git a/cgi-bin/Makefile b/cgi-bin/Makefile index 4962215bc..7cce230f8 100644 --- a/cgi-bin/Makefile +++ b/cgi-bin/Makefile @@ -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 $". # diff --git a/cgi-bin/help-index.c b/cgi-bin/help-index.c index 0b2e53b09..d3792e635 100644 --- a/cgi-bin/help-index.c +++ b/cgi-bin/help-index.c @@ -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 $". */ diff --git a/cgi-bin/help-index.h b/cgi-bin/help-index.h index 68a898670..d564663a0 100644 --- a/cgi-bin/help-index.h +++ b/cgi-bin/help-index.h @@ -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 @@ -25,6 +25,12 @@ #ifndef _CUPS_HELP_INDEX_H_ # define _CUPS_HELP_INDEX_H_ +/* + * Include necessary headers... + */ + +# include + /* * 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 $". */ diff --git a/cgi-bin/help.c b/cgi-bin/help.c index 5071ca825..d616f28bd 100644 --- a/cgi-bin/help.c +++ b/cgi-bin/help.c @@ -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); } } diff --git a/cgi-bin/testhi.c b/cgi-bin/testhi.c index 99d0bd29f..dad5d70b7 100644 --- a/cgi-bin/testhi.c +++ b/cgi-bin/testhi.c @@ -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 $". */ diff --git a/config-scripts/cups-common.m4 b/config-scripts/cups-common.m4 index 442cd5325..abad61d56 100644 --- a/config-scripts/cups-common.m4 +++ b/config-scripts/cups-common.m4 @@ -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 diff --git a/config.h.in b/config.h.in index b0b5798f7..4b81c2c57 100644 --- a/config.h.in +++ b/config.h.in @@ -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 @@ -419,5 +417,5 @@ #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 $". */ diff --git a/cups/Dependencies b/cups/Dependencies index d77ea16ab..9b68b1299 100644 --- a/cups/Dependencies +++ b/cups/Dependencies @@ -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 diff --git a/cups/Makefile b/cups/Makefile index 63caff9f0..cbd6e36f4 100644 --- a/cups/Makefile +++ b/cups/Makefile @@ -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 $". # diff --git a/cups/api-array.shtml b/cups/api-array.shtml index d6297fb6a..433ce5d28 100644 --- a/cups/api-array.shtml +++ b/cups/api-array.shtml @@ -1,9 +1,9 @@

cupsArrayAdd()

Description

-

Add an element to the array.

+

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.

Syntax

 int
@@ -242,6 +248,50 @@ cupsArrayFirst(
 

Returns

First element or NULL

+

cupsArrayIndex()

+

Description

+

Get the N-th element in the array.

+

Syntax

+
+void *
+cupsArrayIndex(
+    cups_array_t * a,
+    int n);
+
+

Arguments

+
+ + + + +
NameDescription
aArray
nIndex into array, starting at 0
+

Returns

+

N-th element or NULL

+ +

cupsArrayInsert()

+

Description

+

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.

+

Syntax

+
+int
+cupsArrayInsert(
+    cups_array_t * a,
+    void * e);
+
+

Arguments

+
+ + + + +
NameDescription
aArray
eElement
+

Returns

+

0 on failure, 1 on success

+

cupsArrayLast()

Description

Get the last element in the array.

diff --git a/doc/help/api-cups.html b/doc/help/api-cups.html index 9d084f219..4e829066e 100644 --- a/doc/help/api-cups.html +++ b/doc/help/api-cups.html @@ -41,7 +41,15 @@

Introduction

-

The CUPS APIs provide...

+

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.

+ +

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.

General Usage

@@ -115,10 +123,6 @@ CUPS 1.1 or higher.

  • cupsAddDest()
  • cupsAddOption()
  • cupsCancelJob()
  • -
  • cupsDoAuthentication()  CUPS 1.1.20 
  • -
  • cupsDoFileRequest()
  • -
  • cupsEncodeOptions()
  • -
  • cupsEncodeOptions2()  CUPS 1.2 
  • cupsEncryption()
  • cupsFreeDests()
  • cupsFreeJobs()
  • @@ -176,8 +180,8 @@ to the user's lpoptions file.

     int
     cupsAddDest(
    -    const char * name,
    -    const char * instance,
    +    const char * name,
    +    const char * instance,
         int num_dests,
         cups_dest_t ** dests);
     
    @@ -200,8 +204,8 @@ cupsAddDest(
     int
     cupsAddOption(
    -    const char * name,
    -    const char * value,
    +    const char * name,
    +    const char * value,
         int num_options,
         cups_option_t ** options);
     
    @@ -227,7 +231,7 @@ the cause of any failure.

     int
     cupsCancelJob(
    -    const char * name,
    +    const char * name,
         int job);
     

    Arguments

    @@ -240,116 +244,6 @@ cupsCancelJob(

    Returns

    1 on success, 0 on failure

    -

     CUPS 1.1.20 cupsDoAuthentication()

    -

    Description

    -

    Authenticate a request. - -This function should be called in response to a HTTP_UNAUTHORIZED -status, prior to resubmitting your request. - -

    -

    Syntax

    -
    -int
    -cupsDoAuthentication(
    -    http_t * http,
    -    const char * method,
    -    const char * resource);
    -
    -

    Arguments

    -
    - - - - - -
    NameDescription
    httpHTTP connection to server
    methodRequest method (GET, POST, PUT)
    resourceResource path
    -

    Returns

    -

    0 on success, -1 on error

    - -

    cupsDoFileRequest()

    -

    Description

    -

    Do an IPP request. - -This function sends any IPP request to the specified server, retrying -and authenticating as necessary.

    -

    Syntax

    -
    -ipp_t *
    -cupsDoFileRequest(
    -    http_t * http,
    -    ipp_t * request,
    -    const char * resource,
    -    const char * filename);
    -
    -

    Arguments

    -
    - - - - - - -
    NameDescription
    httpHTTP connection to server
    requestIPP request
    resourceHTTP resource for POST
    filenameFile to send or NULL for none
    -

    Returns

    -

    Response data

    - -

    cupsEncodeOptions()

    -

    Description

    -

    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.

    -

    Syntax

    -
    -void
    -cupsEncodeOptions(
    -    ipp_t * ipp,
    -    int num_options,
    -    cups_option_t * options);
    -
    -

    Arguments

    -
    - - - - - -
    NameDescription
    ippRequest to add to
    num_optionsNumber of options
    optionsOptions
    -

    Returns

    -

    Nothing.

    - -

     CUPS 1.2 cupsEncodeOptions2()

    -

    Description

    -

    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. - -

    -

    Syntax

    -
    -void
    -cupsEncodeOptions2(
    -    ipp_t * ipp,
    -    int num_options,
    -    cups_option_t * options,
    -    ipp_tag_t group_tag);
    -
    -

    Arguments

    -
    - - - - - - -
    NameDescription
    ippRequest to add to
    num_optionsNumber of options
    optionsOptions
    group_tagGroup to encode
    -

    Returns

    -

    Nothing.

    -

    cupsEncryption()

    Description

    Get the default encryption settings. @@ -439,7 +333,7 @@ This function is deprecated - use cupsGetDests() instead.

     int
     cupsGetClasses(
    -    char *** classes);
    +    char *** classes);
     

    Arguments

    @@ -462,7 +356,7 @@ to get the user-defined default printer, as this function does not support the lpoptions-defined default printer.

    Syntax

    -const char *
    +const char *
     cupsGetDefault(void);
     

    Arguments

    @@ -484,7 +378,7 @@ support the lpoptions-defined default printer.

    Syntax

    -const char *
    +const char *
     cupsGetDefault2(
         http_t * http);
     
    @@ -507,8 +401,8 @@ list of supported destinations for the current user.

     cups_dest_t *
     cupsGetDest(
    -    const char * name,
    -    const char * instance,
    +    const char * name,
    +    const char * instance,
         int num_dests,
         cups_dest_t * dests);
     
    @@ -526,7 +420,12 @@ cupsGetDest(

    cupsGetDests()

    Description

    -

    Get the list of destinations from the default server.

    +

    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.

    Syntax

     int
    @@ -546,6 +445,11 @@ cupsGetDests(
     

    Description

    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. +

    Syntax

    @@ -576,7 +480,7 @@ This function returns HTTP_OK when the file is successfully retrieved.
     http_status_t
     cupsGetFd(
         http_t * http,
    -    const char * resource,
    +    const char * resource,
         int fd);
     

    Arguments

    @@ -588,7 +492,7 @@ cupsGetFd(
    fdFile descriptor

    Returns

    -

    Status

    +

    HTTP status

     CUPS 1.1.20 cupsGetFile()

    Description

    @@ -602,8 +506,8 @@ This function returns HTTP_OK when the file is successfully retrieved. http_status_t cupsGetFile( http_t * http, - const char * resource, - const char * filename); + const char * resource, + const char * filename);

    Arguments

    @@ -614,7 +518,7 @@ cupsGetFile(
    filenameFilename

    Returns

    -

    Status

    +

    HTTP status

    cupsGetJobs()

    Description

    @@ -624,7 +528,7 @@ cupsGetFile( int cupsGetJobs( cups_job_t ** jobs, - const char * mydest, + const char * mydest, int myjobs, int completed); @@ -633,9 +537,11 @@ cupsGetJobs( NameDescription jobsJob data -mydestOnly show jobs for dest? -myjobsOnly show my jobs? -completedOnly show completed jobs? +mydestNULL = all destinations, * +otherwise show jobs for mydest +myjobs0 = all users, 1 = mine +completed-1 = show all, 0 = active, * +1 = completed jobs

    Returns

    Number of jobs

    @@ -651,7 +557,7 @@ int cupsGetJobs2( http_t * http, cups_job_t ** jobs, - const char * mydest, + const char * mydest, int myjobs, int completed); @@ -661,9 +567,11 @@ cupsGetJobs2( httpHTTP connection jobsJob data -mydestOnly show jobs for dest? -myjobsOnly show my jobs? -completedOnly show completed jobs? +mydestNULL = all destinations, * +otherwise show jobs for mydest +myjobs0 = all users, 1 = mine +completed-1 = show all, 0 = active, * +1 = completed jobs

    Returns

    Number of jobs

    @@ -673,9 +581,9 @@ cupsGetJobs2(

    Get an option value.

    Syntax

    -const char *
    +const char *
     cupsGetOption(
    -    const char * name,
    +    const char * name,
         int num_options,
         cups_option_t * options);
     
    @@ -698,9 +606,9 @@ For classes, cupsGetPPD() returns the PPD file for the first printer in the class.

    Syntax

    -const char *
    +const char *
     cupsGetPPD(
    -    const char * name);
    +    const char * name);
     

    Arguments

    @@ -721,10 +629,10 @@ in the class.

    Syntax

    -const char *
    +const char *
     cupsGetPPD2(
         http_t * http,
    -    const char * name);
    +    const char * name);
     

    Arguments

    @@ -740,12 +648,13 @@ cupsGetPPD2(

    Description

    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.

    Syntax

    -const char *
    +const char *
     cupsGetPassword(
    -    const char * prompt);
    +    const char * prompt);
     

    Arguments

    @@ -767,7 +676,7 @@ This function is deprecated - use cupsGetDests() instead.
     int
     cupsGetPrinters(
    -    char *** printers);
    +    char *** printers);
     

    Arguments

    @@ -797,7 +706,7 @@ cupsLangDefault(void); for the given language.

    Syntax

    -const char *
    +const char *
     cupsLangEncoding(
         cups_lang_t * lang);
     
    @@ -850,7 +759,7 @@ cupsLangFree(
     cups_lang_t *
     cupsLangGet(
    -    const char * language);
    +    const char * language);
     

    Arguments

    @@ -881,7 +790,7 @@ cupsLastError(void);

    Syntax

    -const char *
    +const char *
     cupsLastErrorString(void);
     

    Arguments

    @@ -924,7 +833,7 @@ attributes.

     int
     cupsParseOptions(
    -    const char * arg,
    +    const char * arg,
         int num_options,
         cups_option_t ** options);
     
    @@ -946,9 +855,9 @@ cupsParseOptions(
     int
     cupsPrintFile(
    -    const char * name,
    -    const char * filename,
    -    const char * title,
    +    const char * name,
    +    const char * filename,
    +    const char * title,
         int num_options,
         cups_option_t * options);
     
    @@ -975,9 +884,9 @@ cupsPrintFile( int cupsPrintFile2( http_t * http, - const char * name, - const char * filename, - const char * title, + const char * name, + const char * filename, + const char * title, int num_options, cups_option_t * options); @@ -997,15 +906,16 @@ cupsPrintFile2(

    cupsPrintFiles()

    Description

    -

    Print one or more files to a printer or class on the default server.

    +

    Print one or more files to a printer or class on the +default server.

    Syntax

     int
     cupsPrintFiles(
    -    const char * name,
    +    const char * name,
         int num_files,
    -    const char ** files,
    -    const char * title,
    +    const char ** files,
    +    const char * title,
         int num_options,
         cups_option_t * options);
     
    @@ -1025,7 +935,8 @@ cupsPrintFiles(

     CUPS 1.1.21 cupsPrintFiles2()

    Description

    -

    Print one or more files to a printer or class on the specified server. +

    Print one or more files to a printer or class on the +specified server.

    Syntax

    @@ -1033,10 +944,10 @@ cupsPrintFiles( int cupsPrintFiles2( http_t * http, - const char * name, + const char * name, int num_files, - const char ** files, - const char * title, + const char ** files, + const char * title, int num_options, cups_option_t * options); @@ -1067,7 +978,7 @@ This function returns HTTP_CREATED when the file is stored successfully. http_status_t cupsPutFd( http_t * http, - const char * resource, + const char * resource, int fd);

    Arguments

    @@ -1079,7 +990,7 @@ cupsPutFd(
    fdFile descriptor

    Returns

    -

    Status

    +

    HTTP status

     CUPS 1.1.20 cupsPutFile()

    Description

    @@ -1093,8 +1004,8 @@ This function returns HTTP_CREATED when the file is stored successfully. http_status_t cupsPutFile( http_t * http, - const char * resource, - const char * filename); + const char * resource, + const char * filename);

    Arguments

    @@ -1105,7 +1016,7 @@ cupsPutFile(
    filenameFilename

    Returns

    -

    Status

    +

    HTTP status

    cupsServer()

    Description

    @@ -1115,7 +1026,7 @@ The returned value can be a fully-qualified hostname, a numeric IPv4 or IPv6 address, or a domain socket pathname.

    Syntax

    -const char *
    +const char *
     cupsServer(void);
     

    Arguments

    @@ -1200,7 +1111,7 @@ Pass NULL to restore the default (console) password callback.

     void
     cupsSetPasswordCB(
    -    cups_password_cb_t cb);
    +    cups_password_cb_t cb);
     

    Arguments

    @@ -1222,7 +1133,7 @@ restore the default server name.

     void
     cupsSetServer(
    -    const char * server);
    +    const char * server);
     

    Arguments

    @@ -1242,7 +1153,7 @@ Pass NULL to restore the default user name.

     void
     cupsSetUser(
    -    const char * user);
    +    const char * user);
     

    Arguments

    @@ -1262,7 +1173,7 @@ The temporary filename is stored in the filename buffer.

     int
     cupsTempFd(
    -    char * filename,
    +    char * filename,
         int len);
     

    Arguments

    @@ -1286,9 +1197,9 @@ instead.

    Syntax

    -char *
    +char *
     cupsTempFile(
    -    char * filename,
    +    char * filename,
         int len);
     

    Arguments

    @@ -1312,7 +1223,7 @@ The temporary filename is stored in the filename buffer.
     cups_file_t *
     cupsTempFile2(
    -    char * filename,
    +    char * filename,
         int len);
     

    Arguments

    @@ -1330,7 +1241,7 @@ cupsTempFile2(

    Return the current user's name.

    Syntax

    -const char *
    +const char *
     cupsUser(void);
     

    Arguments

    @@ -1352,7 +1263,7 @@ cupsUser(void);
     struct cups_dest_s
     {
    -  char *name, * instance;
    +  char *name, * instance;
       int is_default;
       int num_options;
       cups_option_t * options;
    @@ -1375,33 +1286,45 @@ struct cups_dest_s
     
     struct cups_job_s
     {
    -  char *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;
     };
     

    Members

    + + + + + +
    NameDescription
    completed_time Time the job was completed
    creation_time Time the job was created
    dest Printer or class name
    format Document format
    id The job ID
    priority Priority (1-100)
    processing_time Time the job was processed
    size Size in kilobytes
    state Job state
    title Title/job name
    user User the submitted the job

    cups_option_s

    Description

    -

    Types and structures...

    +

    Printer Options

    Definition

     struct cups_option_s
     {
    -  char * name;
    -  char * value;
    +  char * name;
    +  char * value;
     };
     

    Members

    @@ -1414,21 +1337,13 @@ struct cups_option_s

    Types

    -

    char

    -

    Description

    -

    Printer Options

    -

    Definition

    -
    -typedef const * (*charcups_password_cb_t)(const char *);
    -
    -

    cups_dest_t

    Description

    Destination

    @@ -1447,12 +1362,20 @@ typedef struct cups_job_s cups_job_t;

    cups_option_t

    Description

    -

    Types and structures...

    +

    Printer Options

    Definition

     typedef struct cups_option_s cups_option_t;
     
    +

    cups_password_cb_t

    +

    Description

    +

    Password callback

    +

    Definition

    +
    +typedef const char * (*cups_password_cb_t)(const char *);
    +
    +

    cups_ptype_t

    Description

    Printer Type/Capability Bits

    diff --git a/doc/help/api-filedir.html b/doc/help/api-filedir.html index 07c8a74a5..51fc07fb1 100644 --- a/doc/help/api-filedir.html +++ b/doc/help/api-filedir.html @@ -97,6 +97,7 @@ library:

  • cupsFileClose()
  • cupsFileCompression()
  • cupsFileEOF()
  • +
  • cupsFileFind()
  • cupsFileFlush()
  • cupsFileGetChar()
  • cupsFileGetConf()
  • @@ -243,6 +244,38 @@ cupsFileEOF(

    Returns

    1 on EOF, 0 otherwise

    +

    cupsFileFind()

    +

    Description

    +

    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.

    +

    Syntax

    +
    +const char *
    +cupsFileFind(
    +    const char * filename,
    +    const char * path,
    +    int executable,
    +    char * buffer,
    +    int bufsize);
    +
    +

    Arguments

    +
    + + + + + + + +
    NameDescription
    filenameFile to find
    pathColon/semicolon-separated path
    executable1 = executable files, 0 = any file/dir
    bufferFilename buffer
    bufsizeSize of filename buffer
    +

    Returns

    +

    Full path to file or NULL

    +

    cupsFileFlush()

    Description

    Flush pending output.

    @@ -303,7 +336,7 @@ cupsFileGetConf( linenumCurrent line number

    Returns

    -

    Line read of NULL on eof/error

    +

    Line read or NULL on eof/error

    cupsFileGets()

    Description

    diff --git a/doc/help/api-filter.html b/doc/help/api-filter.html index 51ccd2132..308d0ce07 100644 --- a/doc/help/api-filter.html +++ b/doc/help/api-filter.html @@ -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 @@ -41,14 +41,16 @@

    Introduction

    -

    The CUPS filter and backend APIs provide...

    +

    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.

    General Usage

    The <cups/backend.h> and <cups/cups.h> header files must be included to use the CUPS_BACKEND_ constants and -cupsBackchannel functions, respectively.

    +cupsBackChannel functions, respectively.

    Programs using these functions must be linked to the CUPS library: libcups.a, libcups.so.2, @@ -71,11 +73,11 @@ library:

    Functions

    -

     CUPS 1.2 cupsBackchannelRead()

    +

     CUPS 1.2 cupsBackChannelRead()

    Description

    Read data from the backchannel. @@ -87,10 +89,10 @@ for data indefinitely.

    Syntax

    -int
    -cupsBackchannelRead(
    +ssize_t
    +cupsBackChannelRead(
         char * buffer,
    -    int bytes,
    +    size_t bytes,
         double timeout);
     

    Arguments

    @@ -104,7 +106,7 @@ cupsBackchannelRead(

    Returns

    Bytes read or -1 on error

    -

     CUPS 1.2 cupsBackchannelWrite()

    +

     CUPS 1.2 cupsBackChannelWrite()

    Description

    Write data to the backchannel. @@ -116,10 +118,10 @@ indefinitely.

    Syntax

    -int
    -cupsBackchannelWrite(
    +ssize_t
    +cupsBackChannelWrite(
         const char * buffer,
    -    int bytes,
    +    size_t bytes,
         double timeout);
     

    Arguments

    diff --git a/doc/help/api-httpipp.html b/doc/help/api-httpipp.html index 1cd14c5c5..2b084f918 100644 --- a/doc/help/api-httpipp.html +++ b/doc/help/api-httpipp.html @@ -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 @@ -41,7 +41,11 @@

    Introduction

    -

    The CUPS HTTP and IPP APIs provide...

    +

    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.

    General Usage

    @@ -69,53 +73,22 @@ require CUPS 1.1 or higher.

  • Functions
  • Structures
  • Types
  • +
  • Unions
  • Enumerations

    -

    cups_ptype_e

    -

    Description

    -

    Not a typedef'd enum so we can OR

    -

    Values

    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameDescription
    CUPS_PRINTER_AUTHENTICATED  CUPS 1.2 Printer requires authentication
    CUPS_PRINTER_BIND Can bind output
    CUPS_PRINTER_BW Can do B&W printing
    CUPS_PRINTER_CLASS Printer class
    CUPS_PRINTER_COLLATE Can collage copies
    CUPS_PRINTER_COLOR Can do color printing
    CUPS_PRINTER_COPIES Can do copies
    CUPS_PRINTER_COVER Can cover output
    CUPS_PRINTER_DEFAULT Default printer on network
    CUPS_PRINTER_DELETE  CUPS 1.2 Delete printer
    CUPS_PRINTER_DUPLEX Can do duplexing
    CUPS_PRINTER_FAX Fax queue
    CUPS_PRINTER_IMPLICIT Implicit class
    CUPS_PRINTER_LARGE Can do D/E/A1/A0
    CUPS_PRINTER_LOCAL Local printer or class
    CUPS_PRINTER_MEDIUM Can do Tabloid/B/C/A3/A2
    CUPS_PRINTER_NOT_SHARED  CUPS 1.2 Printer is not shared
    CUPS_PRINTER_OPTIONS ~(CLASS | REMOTE | IMPLICIT)
    CUPS_PRINTER_PUNCH Can punch output
    CUPS_PRINTER_REJECTING Printer is rejecting jobs
    CUPS_PRINTER_REMOTE Remote printer or class
    CUPS_PRINTER_SMALL Can do Letter/Legal/A4
    CUPS_PRINTER_SORT Can sort output
    CUPS_PRINTER_STAPLE Can staple output
    CUPS_PRINTER_VARIABLE Can do variable sizes
    -

    http_auth_e

    Description

    HTTP authentication types

    @@ -252,52 +225,123 @@ require CUPS 1.1 or higher.

    HTTP_USE_PROXY Must use a proxy to access this URI +

    ipp_res_e

    +

    Description

    +

    Types and structures...

    +

    Values

    +
    + + + + +
    NameDescription
    IPP_RES_PER_CM Pixels per centimeter
    IPP_RES_PER_INCH Pixels per inch
    + +

    ipp_status_e

    +

    Description

    +

    IPP status codes...

    +

    Values

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameDescription
    IPP_ATTRIBUTES client-error-attributes-or-values-not-supported
    IPP_ATTRIBUTES_NOT_SETTABLE client-error-attributes-not-settable
    IPP_BAD_REQUEST client-error-bad-request
    IPP_CHARSET client-error-charset-not-supported
    IPP_COMPRESSION_ERROR client-error-compression-error
    IPP_COMPRESSION_NOT_SUPPORTED client-error-compression-not-supported
    IPP_CONFLICT client-error-conflicting-attributes
    IPP_DEVICE_ERROR server-error-device-error
    IPP_DOCUMENT_ACCESS_ERROR client-error-document-access-error
    IPP_DOCUMENT_FORMAT client-error-document-format-not-supported
    IPP_DOCUMENT_FORMAT_ERROR client-error-document-format-error
    IPP_ERROR_JOB_CANCELLED server-error-job-canceled
    IPP_FORBIDDEN client-error-forbidden
    IPP_GONE client-error-gone
    IPP_IGNORED_ALL_NOTIFICATIONS client-error-ignored-all-notifications
    IPP_IGNORED_ALL_SUBSCRIPTIONS client-error-ignored-all-subscriptions
    IPP_INTERNAL_ERROR server-error-internal-error
    IPP_MULTIPLE_JOBS_NOT_SUPPORTED server-error-multiple-document-jobs-not-supported
    IPP_NOT_ACCEPTING server-error-not-accepting-jobs
    IPP_NOT_AUTHENTICATED client-error-not-authenticated
    IPP_NOT_AUTHORIZED client-error-not-authorized
    IPP_NOT_FOUND client-error-not-found
    IPP_NOT_POSSIBLE client-error-not-possible
    IPP_OK successful-ok
    IPP_OK_BUT_CANCEL_SUBSCRIPTION successful-ok-but-cancel-subscription
    IPP_OK_CONFLICT successful-ok-conflicting-attributes
    IPP_OK_EVENTS_COMPLETE successful-ok-events-complete
    IPP_OK_IGNORED_NOTIFICATIONS successful-ok-ignored-notifications
    IPP_OK_IGNORED_SUBSCRIPTIONS successful-ok-ignored-subscriptions
    IPP_OK_SUBST successful-ok-ignored-or-substituted-attributes
    IPP_OK_TOO_MANY_EVENTS successful-ok-too-many-events
    IPP_OPERATION_NOT_SUPPORTED server-error-operation-not-supported
    IPP_PRINTER_BUSY server-error-busy
    IPP_PRINTER_IS_DEACTIVATED server-error-printer-is-deactivated
    IPP_PRINT_SUPPORT_FILE_NOT_FOUND client-error-print-support-file-not-found
    IPP_REDIRECTION_OTHER_SITE
    IPP_REQUEST_ENTITY client-error-request-entity-too-large
    IPP_REQUEST_VALUE client-error-request-value-too-long
    IPP_SERVICE_UNAVAILABLE server-error-service-unavailable
    IPP_TEMPORARY_ERROR server-error-temporary-error
    IPP_TIMEOUT client-error-timeout
    IPP_TOO_MANY_SUBSCRIPTIONS client-error-too-many-subscriptions
    IPP_URI_SCHEME client-error-uri-scheme-not-supported
    IPP_VERSION_NOT_SUPPORTED server-error-version-not-supported
    + +

    ipp_tag_e

    +

    Description

    +

    Format tags for attributes...

    +

    Values

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameDescription
    IPP_TAG_ADMINDEFINE Admin-defined value
    IPP_TAG_BEGIN_COLLECTION Beginning of collection value
    IPP_TAG_BOOLEAN Boolean value
    IPP_TAG_CHARSET Character set value
    IPP_TAG_COPY Bitflag for copied attribute values
    IPP_TAG_DATE Date/time value
    IPP_TAG_DEFAULT Default value
    IPP_TAG_DELETEATTR Delete-attribute value
    IPP_TAG_END End-of-attributes
    IPP_TAG_END_COLLECTION End of collection value
    IPP_TAG_ENUM Enumeration value
    IPP_TAG_EVENT_NOTIFICATION Event group
    IPP_TAG_INTEGER Integer value
    IPP_TAG_JOB Job group
    IPP_TAG_KEYWORD Keyword value
    IPP_TAG_LANGUAGE Language value
    IPP_TAG_MASK Mask for copied attribute values
    IPP_TAG_MEMBERNAME Collection member name value
    IPP_TAG_MIMETYPE MIME media type value
    IPP_TAG_NAME Name value
    IPP_TAG_NAMELANG Name-with-language value
    IPP_TAG_NOTSETTABLE Not-settable value
    IPP_TAG_NOVALUE No-value value
    IPP_TAG_OPERATION Operation group
    IPP_TAG_PRINTER Printer group
    IPP_TAG_RANGE Range value
    IPP_TAG_RESOLUTION Resolution value
    IPP_TAG_STRING Octet string value
    IPP_TAG_SUBSCRIPTION Subscription group
    IPP_TAG_TEXT Text value
    IPP_TAG_TEXTLANG Text-with-language value
    IPP_TAG_UNKNOWN Unknown value
    IPP_TAG_UNSUPPORTED_GROUP Unsupported attributes group
    IPP_TAG_UNSUPPORTED_VALUE Unsupported value
    IPP_TAG_URI URI value
    IPP_TAG_URISCHEME URI scheme value
    IPP_TAG_ZERO Zero tag - used for separators
    +

    Functions

    - -

    cupsAddDest()

    -

    Description

    -

    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.

    -

    Syntax

    -
    -int
    -cupsAddDest(
    -    const char * name,
    -    const char * instance,
    -    int num_dests,
    -    cups_dest_t ** dests);
    -
    -

    Arguments

    -
    - - - - - - -
    NameDescription
    nameName of destination
    instanceInstance of destination or NULL for none/primary
    num_destsNumber of destinations
    destsDestinations
    -

    Returns

    -

    New number of destinations

    - -

    cupsAddOption()

    -

    Description

    -

    Add an option to an option array.

    -

    Syntax

    -
    -int
    -cupsAddOption(
    -    const char * name,
    -    const char * value,
    -    int num_options,
    -    cups_option_t ** options);
    -
    -

    Arguments

    -
    - - - - - - -
    NameDescription
    nameName of option
    valueValue of option
    num_optionsNumber of options
    optionsPointer to options
    -

    Returns

    -

    Number of options

    - -

    cupsCancelJob()

    -

    Description

    -

    Cancel a print job on the default server. - -Use the cupsLastError() and cupsLastErrorString() functions to get -the cause of any failure.

    -

    Syntax

    -
    -int
    -cupsCancelJob(
    -    const char * name,
    -    int job);
    -
    -

    Arguments

    -
    - - - - -
    NameDescription
    nameName of printer or class
    jobJob ID
    -

    Returns

    -

    1 on success, 0 on failure

    - -

     CUPS 1.1.20 cupsDoAuthentication()

    -

    Description

    -

    Authenticate a request. - -This function should be called in response to a HTTP_UNAUTHORIZED -status, prior to resubmitting your request. - -

    -

    Syntax

    -
    -int
    -cupsDoAuthentication(
    -    http_t * http,
    -    const char * method,
    -    const char * resource);
    -
    -

    Arguments

    -
    - - - - - -
    NameDescription
    httpHTTP connection to server
    methodRequest method (GET, POST, PUT)
    resourceResource path
    -

    Returns

    -

    0 on success, -1 on error

    - -

    cupsDoFileRequest()

    -

    Description

    -

    Do an IPP request. - -This function sends any IPP request to the specified server, retrying -and authenticating as necessary.

    -

    Syntax

    -
    -ipp_t *
    -cupsDoFileRequest(
    -    http_t * http,
    -    ipp_t * request,
    -    const char * resource,
    -    const char * filename);
    -
    -

    Arguments

    -
    - - - - - - -
    NameDescription
    httpHTTP connection to server
    requestIPP request
    resourceHTTP resource for POST
    filenameFile to send or NULL for none
    -

    Returns

    -

    Response data

    - -

    cupsEncodeOptions()

    -

    Description

    -

    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.

    -

    Syntax

    -
    -void
    -cupsEncodeOptions(
    -    ipp_t * ipp,
    -    int num_options,
    -    cups_option_t * options);
    -
    -

    Arguments

    -
    - - - - - -
    NameDescription
    ippRequest to add to
    num_optionsNumber of options
    optionsOptions
    -

    Returns

    -

    Nothing.

    - -

     CUPS 1.2 cupsEncodeOptions2()

    -

    Description

    -

    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. - -

    -

    Syntax

    -
    -void
    -cupsEncodeOptions2(
    -    ipp_t * ipp,
    -    int num_options,
    -    cups_option_t * options,
    -    ipp_tag_t group_tag);
    -
    -

    Arguments

    -
    - - - - - - -
    NameDescription
    ippRequest to add to
    num_optionsNumber of options
    optionsOptions
    group_tagGroup to encode
    -

    Returns

    -

    Nothing.

    - -

    cupsEncryption()

    -

    Description

    -

    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.

    -

    Syntax

    -
    -http_encryption_t
    -cupsEncryption(void);
    -
    -

    Arguments

    -

    None.

    -

    Returns

    -

    Encryption settings

    - -

    cupsFreeDests()

    -

    Description

    -

    Free the memory used by the list of destinations.

    -

    Syntax

    -
    -void
    -cupsFreeDests(
    -    int num_dests,
    -    cups_dest_t * dests);
    -
    -

    Arguments

    -
    - - - - -
    NameDescription
    num_destsNumber of destinations
    destsDestinations
    -

    Returns

    -

    Nothing.

    - -

    cupsFreeJobs()

    -

    Description

    -

    Free memory used by job data.

    -

    Syntax

    -
    -void
    -cupsFreeJobs(
    -    int num_jobs,
    -    cups_job_t * jobs);
    -
    -

    Arguments

    -
    - - - - -
    NameDescription
    num_jobsNumber of jobs
    jobsJobs
    -

    Returns

    -

    Nothing.

    - -

    cupsFreeOptions()

    -

    Description

    -

    Free all memory used by options.

    -

    Syntax

    -
    -void
    -cupsFreeOptions(
    -    int num_options,
    -    cups_option_t * options);
    -
    -

    Arguments

    -
    - - - - -
    NameDescription
    num_optionsNumber of options
    optionsPointer to options
    -

    Returns

    -

    Nothing.

    - -

     DEPRECATED cupsGetClasses()

    -

    Description

    -

    Get a list of printer classes from the default server. - -This function is deprecated - use cupsGetDests() instead. - -

    -

    Syntax

    -
    -int
    -cupsGetClasses(
    -    char *** classes);
    -
    -

    Arguments

    -
    - - - -
    NameDescription
    classesClasses
    -

    Returns

    -

    Number of classes

    - -

    cupsGetDefault()

    -

    Description

    -

    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.

    -

    Syntax

    -
    -const char *
    -cupsGetDefault(void);
    -
    -

    Arguments

    -

    None.

    -

    Returns

    -

    Default printer or NULL

    - -

     CUPS 1.1.21 cupsGetDefault2()

    -

    Description

    -

    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. - -

    -

    Syntax

    -
    -const char *
    -cupsGetDefault2(
    -    http_t * http);
    -
    -

    Arguments

    -
    - - - -
    NameDescription
    httpHTTP connection
    -

    Returns

    -

    Default printer or NULL

    - -

    cupsGetDest()

    -

    Description

    -

    Get the named destination from the list. - -Use the cupsGetDests() or cupsGetDests2() functions to get a -list of supported destinations for the current user.

    -

    Syntax

    -
    -cups_dest_t *
    -cupsGetDest(
    -    const char * name,
    -    const char * instance,
    -    int num_dests,
    -    cups_dest_t * dests);
    -
    -

    Arguments

    -
    - - - - - - -
    NameDescription
    nameName of destination
    instanceInstance of destination
    num_destsNumber of destinations
    destsDestinations
    -

    Returns

    -

    Destination pointer or NULL

    - -

    cupsGetDests()

    -

    Description

    -

    Get the list of destinations from the default server.

    -

    Syntax

    -
    -int
    -cupsGetDests(
    -    cups_dest_t ** dests);
    -
    -

    Arguments

    -
    - - - -
    NameDescription
    destsDestinations
    -

    Returns

    -

    Number of destinations

    - -

     CUPS 1.1.21 cupsGetDests2()

    -

    Description

    -

    Get the list of destinations from the specified server. - -

    -

    Syntax

    -
    -int
    -cupsGetDests2(
    -    http_t * http,
    -    cups_dest_t ** dests);
    -
    -

    Arguments

    -
    - - - - -
    NameDescription
    httpHTTP connection
    destsDestinations
    -

    Returns

    -

    Number of destinations

    - -

     CUPS 1.1.20 cupsGetFd()

    -

    Description

    -

    Get a file from the server. - -This function returns HTTP_OK when the file is successfully retrieved. - -

    -

    Syntax

    -
    -http_status_t
    -cupsGetFd(
    -    http_t * http,
    -    const char * resource,
    -    int fd);
    -
    -

    Arguments

    -
    - - - - - -
    NameDescription
    httpHTTP connection to server
    resourceResource name
    fdFile descriptor
    -

    Returns

    -

    Status

    - -

     CUPS 1.1.20 cupsGetFile()

    -

    Description

    -

    Get a file from the server. - -This function returns HTTP_OK when the file is successfully retrieved. - -

    -

    Syntax

    -
    -http_status_t
    -cupsGetFile(
    -    http_t * http,
    -    const char * resource,
    -    const char * filename);
    -
    -

    Arguments

    -
    - - - - - -
    NameDescription
    httpHTTP connection to server
    resourceResource name
    filenameFilename
    -

    Returns

    -

    Status

    - -

    cupsGetJobs()

    -

    Description

    -

    Get the jobs from the default server.

    -

    Syntax

    -
    -int
    -cupsGetJobs(
    -    cups_job_t ** jobs,
    -    const char * mydest,
    -    int myjobs,
    -    int completed);
    -
    -

    Arguments

    -
    - - - - - - -
    NameDescription
    jobsJob data
    mydestOnly show jobs for dest?
    myjobsOnly show my jobs?
    completedOnly show completed jobs?
    -

    Returns

    -

    Number of jobs

    - -

     CUPS 1.1.21 cupsGetJobs2()

    -

    Description

    -

    Get the jobs from the specified server. - -

    -

    Syntax

    -
    -int
    -cupsGetJobs2(
    -    http_t * http,
    -    cups_job_t ** jobs,
    -    const char * mydest,
    -    int myjobs,
    -    int completed);
    -
    -

    Arguments

    -
    - - - - - - - -
    NameDescription
    httpHTTP connection
    jobsJob data
    mydestOnly show jobs for dest?
    myjobsOnly show my jobs?
    completedOnly show completed jobs?
    -

    Returns

    -

    Number of jobs

    - -

    cupsGetOption()

    -

    Description

    -

    Get an option value.

    -

    Syntax

    -
    -const char *
    -cupsGetOption(
    -    const char * name,
    -    int num_options,
    -    cups_option_t * options);
    -
    -

    Arguments

    -
    - - - - - -
    NameDescription
    nameName of option
    num_optionsNumber of options
    optionsOptions
    -

    Returns

    -

    Option value or NULL

    - -

    cupsGetPPD()

    -

    Description

    -

    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.

    -

    Syntax

    -
    -const char *
    -cupsGetPPD(
    -    const char * name);
    -
    -

    Arguments

    -
    - - - -
    NameDescription
    namePrinter name
    -

    Returns

    -

    Filename for PPD file

    - -

     CUPS 1.1.21 cupsGetPPD2()

    -

    Description

    -

    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. - -

    -

    Syntax

    -
    -const char *
    -cupsGetPPD2(
    -    http_t * http,
    -    const char * name);
    -
    -

    Arguments

    -
    - - - - -
    NameDescription
    httpHTTP connection
    namePrinter name
    -

    Returns

    -

    Filename for PPD file

    - -

    cupsGetPassword()

    -

    Description

    -

    Get a password from the user. - -Returns NULL if the user does not provide a password.

    -

    Syntax

    -
    -const char *
    -cupsGetPassword(
    -    const char * prompt);
    -
    -

    Arguments

    -
    - - - -
    NameDescription
    promptPrompt string
    -

    Returns

    -

    Password

    - -

     DEPRECATED cupsGetPrinters()

    -

    Description

    -

    Get a list of printers from the default server. - -This function is deprecated - use cupsGetDests() instead. - -

    -

    Syntax

    -
    -int
    -cupsGetPrinters(
    -    char *** printers);
    -
    -

    Arguments

    -
    - - - -
    NameDescription
    printersPrinters
    -

    Returns

    -

    Number of printers

    - -

    cupsLastError()

    -

    Description

    -

    Return the last IPP status code.

    -

    Syntax

    -
    -ipp_status_t
    -cupsLastError(void);
    -
    -

    Arguments

    -

    None.

    -

    Returns

    -

    IPP status code from last request

    - -

     CUPS 1.2 cupsLastErrorString()

    -

    Description

    -

    Return the last IPP status-message. - -

    -

    Syntax

    -
    -const char *
    -cupsLastErrorString(void);
    -
    -

    Arguments

    -

    None.

    -

    Returns

    -

    status-message text from last request

    - -

    cupsMarkOptions()

    -

    Description

    -

    Mark command-line options in a PPD file.

    -

    Syntax

    -
    -int
    -cupsMarkOptions(
    -    ppd_file_t * ppd,
    -    int num_options,
    -    cups_option_t * options);
    -
    -

    Arguments

    -
    - - - - - -
    NameDescription
    ppdPPD file
    num_optionsNumber of options
    optionsOptions
    -

    Returns

    -

    1 if conflicting

    - -

    cupsParseOptions()

    -

    Description

    -

    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 -("name={a=... b=... c=...}") are stored with the curley brackets -intact - use cupsParseOptions() on the value to extract the collection -attributes.

    -

    Syntax

    -
    -int
    -cupsParseOptions(
    -    const char * arg,
    -    int num_options,
    -    cups_option_t ** options);
    -
    -

    Arguments

    -
    - - - - - -
    NameDescription
    argArgument to parse
    num_optionsNumber of options
    optionsOptions found
    -

    Returns

    -

    Number of options found

    - -

    cupsPrintFile()

    -

    Description

    -

    Print a file to a printer or class on the default server.

    -

    Syntax

    -
    -int
    -cupsPrintFile(
    -    const char * name,
    -    const char * filename,
    -    const char * title,
    -    int num_options,
    -    cups_option_t * options);
    -
    -

    Arguments

    -
    - - - - - - - -
    NameDescription
    namePrinter or class name
    filenameFile to print
    titleTitle of job
    num_optionsNumber of options
    optionsOptions
    -

    Returns

    -

    Job ID

    - -

     CUPS 1.1.21 cupsPrintFile2()

    -

    Description

    -

    Print a file to a printer or class on the specified server. - -

    -

    Syntax

    -
    -int
    -cupsPrintFile2(
    -    http_t * http,
    -    const char * name,
    -    const char * filename,
    -    const char * title,
    -    int num_options,
    -    cups_option_t * options);
    -
    -

    Arguments

    -
    - - - - - - - - -
    NameDescription
    httpHTTP connection
    namePrinter or class name
    filenameFile to print
    titleTitle of job
    num_optionsNumber of options
    optionsOptions
    -

    Returns

    -

    Job ID

    - -

    cupsPrintFiles()

    -

    Description

    -

    Print one or more files to a printer or class on the default server.

    -

    Syntax

    -
    -int
    -cupsPrintFiles(
    -    const char * name,
    -    int num_files,
    -    const char ** files,
    -    const char * title,
    -    int num_options,
    -    cups_option_t * options);
    -
    -

    Arguments

    -
    - - - - - - - - -
    NameDescription
    namePrinter or class name
    num_filesNumber of files
    filesFile(s) to print
    titleTitle of job
    num_optionsNumber of options
    optionsOptions
    -

    Returns

    -

    Job ID

    +
  • ippAddIntegers()
  • +
  • ippAddOctetString()  CUPS 1.2 
  • +
  • ippAddRange()
  • +
  • ippAddRanges()
  • +
  • ippAddResolution()
  • +
  • ippAddResolutions()
  • +
  • ippAddSeparator()
  • +
  • ippAddString()
  • +
  • ippAddStrings()
  • +
  • ippDateToTime()
  • +
  • ippDelete()
  • +
  • ippDeleteAttribute()  CUPS 1.1.19 
  • +
  • ippErrorString()
  • +
  • ippErrorValue()  CUPS 1.2 
  • +
  • ippFindAttribute()
  • +
  • ippFindNextAttribute()
  • +
  • ippLength()
  • +
  • ippNew()
  • +
  • ippNewRequest()  CUPS 1.2 
  • +
  • ippOpString()  CUPS 1.2 
  • +
  • ippOpValue()  CUPS 1.2 
  • +
  • ippPort()
  • +
  • ippRead()
  • +
  • ippReadFile()  CUPS 1.1.19 
  • +
  • ippReadIO()  CUPS 1.2 
  • +
  • ippSetPort()
  • +
  • ippTimeToDate()
  • +
  • ippWrite()
  • +
  • ippWriteFile()  CUPS 1.1.19 
  • +
  • ippWriteIO()  CUPS 1.2 
  • + -

     CUPS 1.1.21 cupsPrintFiles2()

    +

     CUPS 1.1.20 cupsDoAuthentication()

    Description

    -

    Print one or more files to a printer or class on the specified server. +

    Authenticate a request. + +This function should be called in response to a HTTP_UNAUTHORIZED +status, prior to resubmitting your request.

    Syntax

     int
    -cupsPrintFiles2(
    +cupsDoAuthentication(
         http_t * http,
    -    const char * name,
    -    int num_files,
    -    const char ** files,
    -    const char * title,
    -    int num_options,
    -    cups_option_t * options);
    +    const char * method,
    +    const char * resource);
     

    Arguments

    - - - - - - - + + +
    NameDescription
    httpHTTP connection
    namePrinter or class name
    num_filesNumber of files
    filesFile(s) to print
    titleTitle of job
    num_optionsNumber of options
    optionsOptions
    httpHTTP connection to server
    methodRequest method (GET, POST, PUT)
    resourceResource path

    Returns

    -

    Job ID

    +

    0 on success, -1 on error

    -

     CUPS 1.1.20 cupsPutFd()

    +

    cupsDoFileRequest()

    Description

    -

    Put a file on the server. - -This function returns HTTP_CREATED when the file is stored successfully. +

    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.

    Syntax

    -http_status_t
    -cupsPutFd(
    +ipp_t *
    +cupsDoFileRequest(
         http_t * http,
    -    const char * resource,
    -    int fd);
    +    ipp_t * request,
    +    const char * resource,
    +    const char * filename);
     

    Arguments

    - - + + +
    NameDescription
    httpHTTP connection to server
    resourceResource name
    fdFile descriptor
    requestIPP request
    resourceHTTP resource for POST
    filenameFile to send or NULL for none

    Returns

    -

    Status

    +

    Response data

    -

     CUPS 1.1.20 cupsPutFile()

    +

    cupsDoRequest()

    Description

    -

    Put a file on the server. - -This function returns HTTP_CREATED when the file is stored successfully. +

    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.

    Syntax

    -http_status_t
    -cupsPutFile(
    +ipp_t *
    +cupsDoRequest(
         http_t * http,
    -    const char * resource,
    -    const char * filename);
    +    ipp_t * request,
    +    const char * resource);
     

    Arguments

    - - + +
    NameDescription
    httpHTTP connection to server
    resourceResource name
    filenameFilename
    requestIPP request
    resourceHTTP resource for POST

    Returns

    -

    Status

    - -

    cupsServer()

    -

    Description

    -

    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.

    -

    Syntax

    -
    -const char *
    -cupsServer(void);
    -
    -

    Arguments

    -

    None.

    -

    Returns

    -

    Server name

    +

    Response data

    -

    cupsSetDests()

    +

    cupsEncodeOptions()

    Description

    -

    Save the list of destinations for the default server. +

    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.

    +This function adds operation, job, and then subscription attributes, +in that order. Use the cupsEncodeOptions2() function to add attributes +for a single group.

    Syntax

     void
    -cupsSetDests(
    -    int num_dests,
    -    cups_dest_t * dests);
    +cupsEncodeOptions(
    +    ipp_t * ipp,
    +    int num_options,
    +    cups_option_t * options);
     

    Arguments

    - - + + +
    NameDescription
    num_destsNumber of destinations
    destsDestinations
    ippRequest to add to
    num_optionsNumber of options
    optionsOptions

    Returns

    Nothing.

    -

     CUPS 1.1.21 cupsSetDests2()

    +

     CUPS 1.2 cupsEncodeOptions2()

    Description

    -

    Save the list of destinations for the specified server. +

    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.

    Syntax

    -int
    -cupsSetDests2(
    -    http_t * http,
    -    int num_dests,
    -    cups_dest_t * dests);
    -
    -

    Arguments

    -
    - - - - - -
    NameDescription
    httpHTTP connection
    num_destsNumber of destinations
    destsDestinations
    -

    Returns

    -

    0 on success, -1 on error

    - -

    cupsSetEncryption()

    -

    Description

    -

    Set the encryption preference.

    -

    Syntax

    -
    -void
    -cupsSetEncryption(
    -    http_encryption_t e);
    -
    -

    Arguments

    -
    - - - -
    NameDescription
    eNew encryption preference
    -

    Returns

    -

    Nothing.

    - -

    cupsSetPasswordCB()

    -

    Description

    -

    Set the password callback for CUPS. - -Pass NULL to restore the default (console) password callback.

    -

    Syntax

    -
    -void
    -cupsSetPasswordCB(
    -    cups_password_cb_t cb);
    -
    -

    Arguments

    -
    - - - -
    NameDescription
    cbCallback function
    -

    Returns

    -

    Nothing.

    - -

    cupsSetServer()

    -

    Description

    -

    Set the default server name. - -The "server" 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.

    -

    Syntax

    -
    -void
    -cupsSetServer(
    -    const char * server);
    -
    -

    Arguments

    -
    - - - -
    NameDescription
    serverServer name
    -

    Returns

    -

    Nothing.

    - -

    cupsSetUser()

    -

    Description

    -

    Set the default user name. - -Pass NULL to restore the default user name.

    -

    Syntax

    -
     void
    -cupsSetUser(
    -    const char * user);
    +cupsEncodeOptions2(
    +    ipp_t * ipp,
    +    int num_options,
    +    cups_option_t * options,
    +    ipp_tag_t group_tag);
     

    Arguments

    - + + + +
    NameDescription
    userUser name
    ippRequest to add to
    num_optionsNumber of options
    optionsOptions
    group_tagGroup to encode

    Returns

    Nothing.

    -

    cupsUser()

    -

    Description

    -

    Return the current user's name.

    -

    Syntax

    -
    -const char *
    -cupsUser(void);
    -
    -

    Arguments

    -

    None.

    -

    Returns

    -

    User name

    -

     CUPS 1.2 httpAddrAny()

    Description

    Check for the "any" address. @@ -1446,7 +620,7 @@ httpAddrEqual( addr2Second address

    Returns

    -

    1 if equal, 0 if !=

    +

    1 if equal, 0 if not

     CUPS 1.2 httpAddrLength()

    Description

    @@ -1495,10 +669,10 @@ httpAddrLocalhost(

    Syntax

    -char *
    +char *
     httpAddrLookup(
         const http_addr_t * addr,
    -    char * name,
    +    char * name,
         int namelen);
     

    Arguments

    @@ -1514,15 +688,15 @@ httpAddrLookup(

     CUPS 1.2 httpAddrString()

    Description

    -

    Convert an IP address to a dotted string. +

    Convert an address to a numeric string.

    Syntax

    -char *
    +char *
     httpAddrString(
         const http_addr_t * addr,
    -    char * s,
    +    char * s,
         int slen);
     

    Arguments

    @@ -1534,34 +708,37 @@ httpAddrString( slenLength of string

    Returns

    -

    IP string

    +

    Numeric address string

     CUPS 1.2 httpAssembleURI()

    Description

    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.

    Syntax

     http_uri_status_t
     httpAssembleURI(
    -    char * uri,
    +    http_uri_coding_t encoding,
    +    char * uri,
         int urilen,
    -    const char * scheme,
    -    const char * username,
    -    const char * host,
    +    const char * scheme,
    +    const char * username,
    +    const char * host,
         int port,
    -    const char * resource);
    +    const char * resource);
     

    Arguments

    + @@ -1579,28 +756,31 @@ 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.

    Syntax

     http_uri_status_t
     httpAssembleURIf(
    -    char * uri,
    +    http_uri_coding_t encoding,
    +    char * uri,
         int urilen,
    -    const char * scheme,
    -    const char * username,
    -    const char * host,
    +    const char * scheme,
    +    const char * username,
    +    const char * host,
         int port,
    -    const char * resourcef,
    +    const char * resourcef,
         ...);
     

    Arguments

    NameDescription
    encodingEncoding flags
    uriURI buffer
    urilenSize of URI buffer
    schemeScheme name
    + @@ -1613,6 +793,26 @@ httpAssembleURIf(

    Returns

    URI status

    +

    httpBlocking()

    +

    Description

    +

    Set blocking/non-blocking behavior on a connection.

    +

    Syntax

    +
    +void
    +httpBlocking(
    +    http_t * http,
    +    int b);
    +
    +

    Arguments

    +
    NameDescription
    encodingEncoding flags
    uriURI buffer
    urilenSize of URI buffer
    schemeScheme name
    + + + + +
    NameDescription
    httpHTTP connection
    b1 = blocking, 0 = non-blocking
    +

    Returns

    +

    Nothing.

    +

    httpCheck()

    Description

    Check to see if there is a pending response from the server.

    @@ -1646,7 +846,25 @@ httpClearCookie(
    - + +
    NameDescription
    httpConnection
    httpHTTP connection
    +

    Returns

    +

    Nothing.

    + +

    httpClearFields()

    +

    Description

    +

    Clear HTTP request fields.

    +

    Syntax

    +
    +void
    +httpClearFields(
    +    http_t * http);
    +
    +

    Arguments

    +
    + + +
    NameDescription
    httpHTTP connection

    Returns

    Nothing.

    @@ -1664,7 +882,7 @@ httpClose(
    - +
    NameDescription
    httpConnection to close
    httpHTTP connection

    Returns

    Nothing.

    @@ -1676,7 +894,7 @@ httpClose(
     http_t *
     httpConnect(
    -    const char * host,
    +    const char * host,
         int port);
     

    Arguments

    @@ -1696,7 +914,7 @@ httpConnect(
     http_t *
     httpConnectEncrypt(
    -    const char * host,
    +    const char * host,
         int port,
         http_encryption_t encryption);
     
    @@ -1711,15 +929,20 @@ httpConnectEncrypt(

    Returns

    New HTTP connection

    -

    httpDecode64()

    +

     DEPRECATED httpDecode64()

    Description

    -

    Base64-decode a string.

    +

    Base64-decode a string. + +This function is deprecated. Use the httpDecode64_2() function instead +which provides buffer length arguments. + +

    Syntax

    -char *
    +char *
     httpDecode64(
    -    char * out,
    -    const char * in);
    +    char * out,
    +    const char * in);
     

    Arguments

    @@ -1738,11 +961,11 @@ httpDecode64(

    Syntax

    -char *
    +char *
     httpDecode64_2(
    -    char * out,
    +    char * out,
         int * outlen,
    -    const char * in);
    +    const char * in);
     

    Arguments

    @@ -1763,27 +986,32 @@ httpDecode64_2( int httpDelete( http_t * http, - const char * uri); + const char * uri);

    Arguments

    - +
    NameDescription
    httpHTTP data
    httpHTTP connection
    uriURI to delete

    Returns

    Status of call (0 = success)

    -

    httpEncode64()

    +

     DEPRECATED httpEncode64()

    Description

    -

    Base64-encode a string.

    +

    Base64-encode a string. + +This function is deprecated. Use the httpEncode64_2() function instead +which provides buffer length arguments. + +

    Syntax

    -char *
    +char *
     httpEncode64(
    -    char * out,
    -    const char * in);
    +    char * out,
    +    const char * in);
     

    Arguments

    @@ -1802,11 +1030,11 @@ httpEncode64(

    Syntax

    -char *
    +char *
     httpEncode64_2(
    -    char * out,
    +    char * out,
         int outlen,
    -    const char * in,
    +    const char * in,
         int inlen);
     

    Arguments

    @@ -1835,12 +1063,30 @@ httpEncryption(
    - +
    NameDescription
    httpHTTP data
    httpHTTP connection
    eNew encryption preference

    Returns

    -1 on error, 0 on success

    +

    httpError()

    +

    Description

    +

    Get the last error on a connection.

    +

    Syntax

    +
    +int
    +httpError(
    +    http_t * http);
    +
    +

    Arguments

    +
    + + + +
    NameDescription
    httpHTTP connection
    +

    Returns

    +

    Error code (errno) value

    +

    httpFlush()

    Description

    Flush data from a HTTP connection.

    @@ -1854,7 +1100,7 @@ httpFlush(
    - +
    NameDescription
    httpHTTP data
    httpHTTP connection

    Returns

    Nothing.

    @@ -1874,30 +1120,68 @@ httpFlushWrite(
    - + +
    NameDescription
    httpHTTP data
    httpHTTP connection
    +

    Returns

    +

    Bytes written or -1 on error

    + +

    httpGet()

    +

    Description

    +

    Send a GET request to the server.

    +

    Syntax

    +
    +int
    +httpGet(
    +    http_t * http,
    +    const char * uri);
    +
    +

    Arguments

    +
    + + + + +
    NameDescription
    httpHTTP connection
    uriURI to get
    +

    Returns

    +

    Status of call (0 = success)

    + +

     CUPS 1.2 httpGetBlocking()

    +

    Description

    +

    Get the blocking/non-block state of a connection. + +

    +

    Syntax

    +
    +int
    +httpGetBlocking(
    +    http_t * http);
    +
    +

    Arguments

    +
    + + +
    NameDescription
    httpHTTP connection

    Returns

    -

    Bytes written or -1 on error

    +

    1 if blocking, 0 if non-blocking

    -

    httpGet()

    +

    httpGetCookie()

    Description

    -

    Send a GET request to the server.

    +

    Get any cookie data from the response.

    Syntax

    -int
    -httpGet(
    -    http_t * http,
    -    const char * uri);
    +const char *
    +httpGetCookie(
    +    http_t * http);
     

    Arguments

    - - +
    NameDescription
    httpHTTP data
    uriURI to get
    httpHTTP connecion

    Returns

    -

    Status of call (0 = success)

    +

    Cookie data or NULL

     DEPRECATED httpGetDateString()

    Description

    @@ -1906,7 +1190,7 @@ httpGet(

    Syntax

    -const char *
    +const char *
     httpGetDateString(
         time_t t);
     
    @@ -1926,10 +1210,10 @@ httpGetDateString(

    Syntax

    -const char *
    +const char *
     httpGetDateString2(
         time_t t,
    -    char * s,
    +    char * s,
         int slen);
     

    Arguments

    @@ -1950,7 +1234,7 @@ httpGetDateString2(
     time_t
     httpGetDateTime(
    -    const char * s);
    +    const char * s);
     

    Arguments

    @@ -1961,6 +1245,46 @@ httpGetDateTime(

    Returns

    UNIX time

    +

     CUPS 1.2 httpGetFd()

    +

    Description

    +

    Get the file descriptor associated with a connection. + +

    +

    Syntax

    +
    +int
    +httpGetFd(
    +    http_t * http);
    +
    +

    Arguments

    +
    + + + +
    NameDescription
    httpHTTP connection
    +

    Returns

    +

    File descriptor or -1 if none

    + +

    httpGetField()

    +

    Description

    +

    Get a field value from a request/response.

    +

    Syntax

    +
    +const char *
    +httpGetField(
    +    http_t * http,
    +    http_field_t field);
    +
    +

    Arguments

    +
    + + + + +
    NameDescription
    httpHTTP connection
    fieldField to get
    +

    Returns

    +

    Field value

    +

     DEPRECATED httpGetHostByName()

    Description

    Lookup a hostname or IPv4 address, and return @@ -1971,7 +1295,7 @@ address records for the specified name.

     struct hostent *
     httpGetHostByName(
    -    const char * name);
    +    const char * name);
     

    Arguments

    @@ -1992,9 +1316,9 @@ get the local hostname with domain.

    Syntax

    -const char *
    +const char *
     httpGetHostname(
    -    char * s,
    +    char * s,
         int slen);
     

    Arguments

    @@ -2007,7 +1331,7 @@ httpGetHostname(

    Returns

    FQDN for this system

    -

     CUPS 1.2 httpGetLength()

    +

     DEPRECATED httpGetLength()

    Description

    Get the amount of data remaining from the content-length or transfer-encoding fields. @@ -2026,18 +1350,20 @@ httpGetLength(

    - +
    NameDescription
    httpHTTP data
    httpHTTP connection

    Returns

    Content length

    -

    httpGetLength2()

    +

     CUPS 1.2 httpGetLength2()

    Description

    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.

    +content larger than 2^31 - 1. + +

    Syntax

     off_t
    @@ -2048,11 +1374,31 @@ httpGetLength2(
     
    - +
    NameDescription
    httpHTTP data
    httpHTTP connection

    Returns

    Content length

    +

     CUPS 1.2 httpGetStatus()

    +

    Description

    +

    Get the status of the last HTTP request. + +

    +

    Syntax

    +
    +http_status_t
    +httpGetStatus(
    +    http_t * http);
    +
    +

    Arguments

    +
    + + + +
    NameDescription
    httpHTTP connection
    +

    Returns

    +

    HTTP status

    +

     DEPRECATED httpGetSubField()

    Description

    Get a sub-field value. @@ -2060,18 +1406,18 @@ httpGetLength2(

    Syntax

    -char *
    +char *
     httpGetSubField(
         http_t * http,
         http_field_t field,
    -    const char * name,
    -    char * value);
    +    const char * name,
    +    char * value);
     

    Arguments

    - + @@ -2086,19 +1432,19 @@ httpGetSubField(

    Syntax

    -char *
    +char *
     httpGetSubField2(
         http_t * http,
         http_field_t field,
    -    const char * name,
    -    char * value,
    +    const char * name,
    +    char * value,
         int valuelen);
     

    Arguments

    NameDescription
    httpHTTP data
    httpHTTP connection
    fieldField index
    nameName of sub-field
    valueValue string
    - + @@ -2112,9 +1458,9 @@ httpGetSubField2(

    Get a line of text from a HTTP connection.

    Syntax

    -char *
    +char *
     httpGets(
    -    char * line,
    +    char * line,
         int length,
         http_t * http);
     
    @@ -2124,7 +1470,7 @@ httpGets( - +
    NameDescription
    httpHTTP data
    httpHTTP connection
    fieldField index
    nameName of sub-field
    valueValue string
    lineLine to read into
    lengthMax length of buffer
    httpHTTP data
    httpHTTP connection

    Returns

    Line or NULL

    @@ -2137,13 +1483,13 @@ httpGets( int httpHead( http_t * http, - const char * uri); + const char * uri);

    Arguments

    - +
    NameDescription
    httpHTTP data
    httpHTTP connection
    uriURI for head

    Returns

    @@ -2168,12 +1514,12 @@ httpInitialize(void);

    Compute the MD5 sum of the username:group:password.

    Syntax

    -char *
    +char *
     httpMD5(
    -    const char * username,
    -    const char * realm,
    -    const char * passwd,
    -    char md5[33]);
    +    const char * username,
    +    const char * realm,
    +    const char * passwd,
    +    char md5[33]);
     

    Arguments

    @@ -2194,12 +1540,12 @@ with the server-supplied nonce value, method, and request-uri.

    Syntax

    -char *
    +char *
     httpMD5Final(
    -    const char * nonce,
    -    const char * method,
    -    const char * resource,
    -    char md5[33]);
    +    const char * nonce,
    +    const char * method,
    +    const char * resource,
    +    char md5[33]);
     

    Arguments

    @@ -2218,10 +1564,10 @@ httpMD5Final(

    Convert an MD5 sum to a character string.

    Syntax

    -char *
    +char *
     httpMD5String(
    -    const unsigned char * sum,
    -    char md5[33]);
    +    const unsigned char * sum,
    +    char md5[33]);
     

    Arguments

    @@ -2241,13 +1587,13 @@ httpMD5String( int httpOptions( http_t * http, - const char * uri); + const char * uri);

    Arguments

    - +
    NameDescription
    httpHTTP data
    httpHTTP connection
    uriURI for options

    Returns

    @@ -2261,76 +1607,83 @@ httpOptions( int httpPost( http_t * http, - const char * uri); + const char * uri);

    Arguments

    - +
    NameDescription
    httpHTTP data
    httpHTTP connection
    uriURI for post

    Returns

    Status of call (0 = success)

    -

    httpPrintf()

    +

    httpPut()

    Description

    -

    Print a formatted string to a HTTP connection.

    +

    Send a PUT request to the server.

    Syntax

     int
    -httpPrintf(
    +httpPut(
         http_t * http,
    -    const char * format,
    -    ...);
    +    const char * uri);
     

    Arguments

    - - - + +
    NameDescription
    httpHTTP data
    formatprintf-style format string
    ...Additional args as needed
    httpHTTP connection
    uriURI to put

    Returns

    -

    Number of bytes written

    +

    Status of call (0 = success)

    -

    httpPut()

    +

     DEPRECATED httpRead()

    Description

    -

    Send a PUT request to the server.

    +

    Read data from a HTTP connection. + +This function is deprecated. Use the httpRead2() function which can +read more than 2GB of data. + +

    Syntax

     int
    -httpPut(
    +httpRead(
         http_t * http,
    -    const char * uri);
    +    char * buffer,
    +    int length);
     

    Arguments

    - - + + +
    NameDescription
    httpHTTP data
    uriURI to put
    httpHTTP connection
    bufferBuffer for data
    lengthMaximum number of bytes

    Returns

    -

    Status of call (0 = success)

    +

    Number of bytes read

    -

    httpRead()

    +

     CUPS 1.2 httpRead2()

    Description

    -

    Read data from a HTTP connection.

    +

    Read data from a HTTP connection. + +

    Syntax

    -int
    -httpRead(
    +ssize_t
    +httpRead2(
         http_t * http,
    -    char * buffer,
    -    int length);
    +    char * buffer,
    +    size_t length);
     

    Arguments

    - +
    NameDescription
    httpHTTP data
    httpHTTP connection
    bufferBuffer for data
    lengthMaximum number of bytes
    @@ -2339,7 +1692,7 @@ httpRead(

    httpReconnect()

    Description

    -

    Reconnect to a HTTP server...

    +

    Reconnect to a HTTP server.

    Syntax

     int
    @@ -2350,25 +1703,29 @@ httpReconnect(
     
    - +
    NameDescription
    httpHTTP data
    httpHTTP connection

    Returns

    0 on success, non-zero on failure

    -

    httpSeparate()

    +

     DEPRECATED httpSeparate()

    Description

    Separate a Universal Resource Identifier into its -components.

    +components. + +This function is deprecated; use the httpSeparateURI() function instead. + +

    Syntax

     void
     httpSeparate(
    -    const char * uri,
    -    char * scheme,
    -    char * username,
    -    char * host,
    +    const char * uri,
    +    char * scheme,
    +    char * username,
    +    char * host,
         int * port,
    -    char * resource);
    +    char * resource);
     

    Arguments

    @@ -2389,20 +1746,23 @@ httpSeparate(

    Separate a Universal Resource Identifier into its components. +This function is deprecated; use the httpSeparateURI() function instead. + +

    Syntax

     void
     httpSeparate2(
    -    const char * uri,
    -    char * scheme,
    +    const char * uri,
    +    char * scheme,
         int schemelen,
    -    char * username,
    +    char * username,
         int usernamelen,
    -    char * host,
    +    char * host,
         int hostlen,
         int * port,
    -    char * resource,
    +    char * resource,
         int resourcelen);
     

    Arguments

    @@ -2433,21 +1793,23 @@ components.
     http_uri_status_t
     httpSeparateURI(
    -    const char * uri,
    -    char * scheme,
    +    http_uri_coding_t decoding,
    +    const char * uri,
    +    char * scheme,
         int schemelen,
    -    char * username,
    +    char * username,
         int usernamelen,
    -    char * host,
    +    char * host,
         int hostlen,
         int * port,
    -    char * resource,
    +    char * resource,
         int resourcelen);
     

    Arguments

    + @@ -2472,7 +1834,7 @@ httpSeparateURI( void httpSetCookie( http_t * http, - const char * cookie); + const char * cookie);

    Arguments

    NameDescription
    decodingDecoding flags
    uriUniversal Resource Identifier
    schemeScheme (http, https, etc.)
    schemelenSize of scheme buffer
    @@ -2493,13 +1855,13 @@ void httpSetField( http_t * http, http_field_t field, - const char * value); + const char * value);

    Arguments

    - +
    NameDescription
    httpHTTP data
    httpHTTP connection
    fieldField index
    valueValue
    @@ -2522,7 +1884,7 @@ httpSetLength(
    - +
    NameDescription
    httpHTTP data
    httpHTTP connection
    lengthLength (0 for chunked)

    Returns

    @@ -2533,7 +1895,7 @@ httpSetLength(

    Return a short string describing a HTTP status code.

    Syntax

    -const char *
    +const char *
     httpStatus(
         http_status_t status);
     
    @@ -2554,13 +1916,13 @@ httpStatus( int httpTrace( http_t * http, - const char * uri); + const char * uri);

    Arguments

    - +
    NameDescription
    httpHTTP data
    httpHTTP connection
    uriURI for trace

    Returns

    @@ -2579,7 +1941,7 @@ httpUpdate(
    - +
    NameDescription
    httpHTTP data
    httpHTTP connection

    Returns

    HTTP status

    @@ -2600,28 +1962,57 @@ httpWait(
    - +
    NameDescription
    httpHTTP data
    httpHTTP connection
    msecMilliseconds to wait

    Returns

    1 if data is available, 0 otherwise

    -

    httpWrite()

    +

     DEPRECATED httpWrite()

    Description

    -

    Write data to a HTTP connection.

    +

    Write data to a HTTP connection. + +This function is deprecated. Use the httpWrite2() function which can +write more than 2GB of data. + +

    Syntax

     int
     httpWrite(
         http_t * http,
    -    const char * buffer,
    +    const char * buffer,
         int length);
     

    Arguments

    - + + + +
    NameDescription
    httpHTTP data
    httpHTTP connection
    bufferBuffer for data
    lengthNumber of bytes to write
    +

    Returns

    +

    Number of bytes written

    + +

     CUPS 1.2 httpWrite2()

    +

    Description

    +

    Write data to a HTTP connection. + +

    +

    Syntax

    +
    +ssize_t
    +httpWrite2(
    +    http_t * http,
    +    const char * buffer,
    +    size_t length);
    +
    +

    Arguments

    +
    + + +
    NameDescription
    httpHTTP connection
    bufferBuffer for data
    lengthNumber of bytes to write
    @@ -2630,21 +2021,21 @@ httpWrite(

    ippAddBoolean()

    Description

    -

    Add a boolean attribute to an IPP request.

    +

    Add a boolean attribute to an IPP message.

    Syntax

     ipp_attribute_t *
     ippAddBoolean(
         ipp_t * ipp,
         ipp_tag_t group,
    -    const char * name,
    -    char value);
    +    const char * name,
    +    char value);
     

    Arguments

    - + @@ -2661,15 +2052,15 @@ ippAddBoolean( ippAddBooleans( ipp_t * ipp, ipp_tag_t group, - const char * name, + const char * name, int num_values, - const char * values); + const char * values);

    Arguments

    NameDescription
    ippIPP request
    ippIPP message
    groupIPP group
    nameName of attribute
    valueValue of attribute
    - + @@ -2689,14 +2080,14 @@ ippAddBooleans( ippAddCollection( ipp_t * ipp, ipp_tag_t group, - const char * name, + const char * name, ipp_t * value);

    Arguments

    NameDescription
    ippIPP request
    ippIPP message
    groupIPP group
    nameName of attribute
    num_valuesNumber of values
    - + @@ -2715,7 +2106,7 @@ ippAddCollection( ippAddCollections( ipp_t * ipp, ipp_tag_t group, - const char * name, + const char * name, int num_values, const ipp_t ** values); @@ -2723,7 +2114,7 @@ ippAddCollections(
    NameDescription
    ippIPP request
    ippIPP message
    groupIPP group
    nameName of attribute
    valueValue
    - + @@ -2734,21 +2125,21 @@ ippAddCollections(

    ippAddDate()

    Description

    -

    Add a date attribute to an IPP request.

    +

    Add a date attribute to an IPP message.

    Syntax

     ipp_attribute_t *
     ippAddDate(
         ipp_t * ipp,
         ipp_tag_t group,
    -    const char * name,
    +    const char * name,
         const ipp_uchar_t * value);
     

    Arguments

    NameDescription
    ippIPP request
    ippIPP message
    groupIPP group
    nameName of attribute
    num_valuesNumber of values
    - + @@ -2758,7 +2149,7 @@ ippAddDate(

    ippAddInteger()

    Description

    -

    Add a integer attribute to an IPP request.

    +

    Add a integer attribute to an IPP message.

    Syntax

     ipp_attribute_t *
    @@ -2766,14 +2157,14 @@ ippAddInteger(
         ipp_t * ipp,
         ipp_tag_t group,
         ipp_tag_t type,
    -    const char * name,
    +    const char * name,
         int value);
     

    Arguments

    NameDescription
    ippIPP request
    ippIPP message
    groupIPP group
    nameName of attribute
    valueValue
    - + @@ -2792,7 +2183,7 @@ ippAddIntegers( ipp_t * ipp, ipp_tag_t group, ipp_tag_t type, - const char * name, + const char * name, int num_values, const int * values); @@ -2800,7 +2191,7 @@ ippAddIntegers(
    NameDescription
    ippIPP request
    ippIPP message
    groupIPP group
    typeType of attribute
    nameName of attribute
    - + @@ -2812,7 +2203,7 @@ ippAddIntegers(

     CUPS 1.2 ippAddOctetString()

    Description

    -

    Add an octetString value to an IPP request. +

    Add an octetString value to an IPP message.

    Syntax

    @@ -2821,7 +2212,7 @@ ippAddIntegers( ippAddOctetString( ipp_t * ipp, ipp_tag_t group, - const char * name, + const char * name, const void * data, int datalen); @@ -2829,7 +2220,7 @@ ippAddOctetString(
    NameDescription
    ippIPP request
    ippIPP message
    groupIPP group
    typeType of attribute
    nameName of attribute
    - + @@ -2840,14 +2231,14 @@ ippAddOctetString(

    ippAddRange()

    Description

    -

    Add a range of values to an IPP request.

    +

    Add a range of values to an IPP message.

    Syntax

     ipp_attribute_t *
     ippAddRange(
         ipp_t * ipp,
         ipp_tag_t group,
    -    const char * name,
    +    const char * name,
         int lower,
         int upper);
     
    @@ -2855,7 +2246,7 @@ ippAddRange(
    NameDescription
    ippIPP request
    ippIPP message
    groupIPP group
    nameName of attribute
    dataoctetString data
    - + @@ -2866,14 +2257,14 @@ ippAddRange(

    ippAddRanges()

    Description

    -

    Add ranges of values to an IPP request.

    +

    Add ranges of values to an IPP message.

    Syntax

     ipp_attribute_t *
     ippAddRanges(
         ipp_t * ipp,
         ipp_tag_t group,
    -    const char * name,
    +    const char * name,
         int num_values,
         const int * lower,
         const int * upper);
    @@ -2882,7 +2273,7 @@ ippAddRanges(
     
    NameDescription
    ippIPP request
    ippIPP message
    groupIPP group
    nameName of attribute
    lowerLower value
    - + @@ -2894,14 +2285,14 @@ ippAddRanges(

    ippAddResolution()

    Description

    -

    Add a resolution value to an IPP request.

    +

    Add a resolution value to an IPP message.

    Syntax

     ipp_attribute_t *
     ippAddResolution(
         ipp_t * ipp,
         ipp_tag_t group,
    -    const char * name,
    +    const char * name,
         ipp_res_t units,
         int xres,
         int yres);
    @@ -2910,7 +2301,7 @@ ippAddResolution(
     
    NameDescription
    ippIPP request
    ippIPP message
    groupIPP group
    nameName of attribute
    num_valuesNumber of values
    - + @@ -2922,14 +2313,14 @@ ippAddResolution(

    ippAddResolutions()

    Description

    -

    Add resolution values to an IPP request.

    +

    Add resolution values to an IPP message.

    Syntax

     ipp_attribute_t *
     ippAddResolutions(
         ipp_t * ipp,
         ipp_tag_t group,
    -    const char * name,
    +    const char * name,
         int num_values,
         ipp_res_t units,
         const int * xres,
    @@ -2939,7 +2330,7 @@ ippAddResolutions(
     
    NameDescription
    ippIPP request
    ippIPP message
    groupIPP group
    nameName of attribute
    unitsUnits for resolution
    - + @@ -2952,7 +2343,7 @@ ippAddResolutions(

    ippAddSeparator()

    Description

    -

    Add a group separator to an IPP request.

    +

    Add a group separator to an IPP message.

    Syntax

     ipp_attribute_t *
    @@ -2963,14 +2354,14 @@ ippAddSeparator(
     
    NameDescription
    ippIPP request
    ippIPP message
    groupIPP group
    nameName of attribute
    num_valuesNumber of values
    - +
    NameDescription
    ippIPP request
    ippIPP message

    Returns

    New attribute

    ippAddString()

    Description

    -

    Add a language-encoded string to an IPP request.

    +

    Add a language-encoded string to an IPP message.

    Syntax

     ipp_attribute_t *
    @@ -2978,15 +2369,15 @@ ippAddString(
         ipp_t * ipp,
         ipp_tag_t group,
         ipp_tag_t type,
    -    const char * name,
    -    const char * charset,
    -    const char * value);
    +    const char * name,
    +    const char * charset,
    +    const char * value);
     

    Arguments

    - + @@ -2998,7 +2389,7 @@ ippAddString(

    ippAddStrings()

    Description

    -

    Add language-encoded strings to an IPP request.

    +

    Add language-encoded strings to an IPP message.

    Syntax

     ipp_attribute_t *
    @@ -3006,16 +2397,16 @@ ippAddStrings(
         ipp_t * ipp,
         ipp_tag_t group,
         ipp_tag_t type,
    -    const char * name,
    +    const char * name,
         int num_values,
    -    const char * charset,
    -    const char *const * values);
    +    const char * charset,
    +    const char *const * values);
     

    Arguments

    NameDescription
    ippIPP request
    ippIPP message
    groupIPP group
    typeType of attribute
    nameName of attribute
    - + @@ -3047,7 +2438,7 @@ ippDateToTime(

    ippDelete()

    Description

    -

    Delete an IPP request.

    +

    Delete an IPP message.

    Syntax

     void
    @@ -3058,14 +2449,14 @@ ippDelete(
     
    NameDescription
    ippIPP request
    ippIPP message
    groupIPP group
    typeType of attribute
    nameName of attribute
    - +
    NameDescription
    ippIPP request
    ippIPP message

    Returns

    Nothing.

     CUPS 1.1.19 ippDeleteAttribute()

    Description

    -

    Delete a single attribute in an IPP request. +

    Delete a single attribute in an IPP message.

    Syntax

    @@ -3079,7 +2470,7 @@ ippDeleteAttribute(
    - +
    NameDescription
    ippIPP request
    ippIPP message
    attrAttribute to delete

    Returns

    @@ -3090,7 +2481,7 @@ ippDeleteAttribute(

    Return a name for the given status code.

    Syntax

    -const char *
    +const char *
     ippErrorString(
         ipp_status_t error);
     
    @@ -3112,7 +2503,7 @@ ippErrorString(
     ipp_status_t
     ippErrorValue(
    -    const char * name);
    +    const char * name);
     

    Arguments

    @@ -3131,14 +2522,14 @@ ippErrorValue( ipp_attribute_t * ippFindAttribute( ipp_t * ipp, - const char * name, + const char * name, ipp_tag_t type);

    Arguments

    - +
    NameDescription
    ippIPP request
    ippIPP message
    nameName of attribute
    typeType of attribute
    @@ -3153,14 +2544,14 @@ ippFindAttribute( ipp_attribute_t * ippFindNextAttribute( ipp_t * ipp, - const char * name, + const char * name, ipp_tag_t type);

    Arguments

    - +
    NameDescription
    ippIPP request
    ippIPP message
    nameName of attribute
    typeType of attribute
    @@ -3169,7 +2560,7 @@ ippFindNextAttribute(

    ippLength()

    Description

    -

    Compute the length of an IPP request.

    +

    Compute the length of an IPP message.

    Syntax

     size_t
    @@ -3180,14 +2571,14 @@ ippLength(
     
    - +
    NameDescription
    ippIPP request
    ippIPP message

    Returns

    -

    Size of IPP request

    +

    Size of IPP message

    ippNew()

    Description

    -

    Allocate a new IPP request.

    +

    Allocate a new IPP message.

    Syntax

     ipp_t *
    @@ -3196,7 +2587,31 @@ ippNew(void);
     

    Arguments

    None.

    Returns

    -

    New IPP request

    +

    New IPP message

    + +

     CUPS 1.2 ippNewRequest()

    +

    Description

    +

    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. + +

    +

    Syntax

    +
    +ipp_t *
    +ippNewRequest(
    +    ipp_op_t op);
    +
    +

    Arguments

    +
    + + + +
    NameDescription
    opOperation code
    +

    Returns

    +

    IPP request message

     CUPS 1.2 ippOpString()

    Description

    @@ -3205,7 +2620,7 @@ ippNew(void);

    Syntax

    -const char *
    +const char *
     ippOpString(
         ipp_op_t op);
     
    @@ -3227,7 +2642,7 @@ ippOpString(
     ipp_op_t
     ippOpValue(
    -    const char * name);
    +    const char * name);
     

    Arguments

    @@ -3253,7 +2668,7 @@ ippPort(void);

    ippRead()

    Description

    -

    Read data for an IPP request from a HTTP connection.

    +

    Read data for an IPP message from a HTTP connection.

    Syntax

     ipp_state_t
    @@ -3273,7 +2688,7 @@ ippRead(
     
     

     CUPS 1.1.19 ippReadFile()

    Description

    -

    Read data for an IPP request from a file. +

    Read data for an IPP message from a file.

    Syntax

    @@ -3293,9 +2708,9 @@ ippReadFile(

    Returns

    Current state

    -

     CUPS 1.1.19 ippReadIO()

    +

     CUPS 1.2 ippReadIO()

    Description

    -

    Read data for an IPP request. +

    Read data for an IPP message.

    Syntax

    @@ -3359,7 +2774,7 @@ ippTimeToDate(

    ippWrite()

    Description

    -

    Write data for an IPP request to a HTTP connection.

    +

    Write data for an IPP message to a HTTP connection.

    Syntax

     ipp_state_t
    @@ -3379,7 +2794,7 @@ ippWrite(
     
     

     CUPS 1.1.19 ippWriteFile()

    Description

    -

    Write data for an IPP request to a file. +

    Write data for an IPP message to a file.

    Syntax

    @@ -3399,9 +2814,9 @@ ippWriteFile(

    Returns

    Current state

    -

     CUPS 1.1.19 ippWriteIO()

    +

     CUPS 1.2 ippWriteIO()

    Description

    -

    Write data for an IPP request. +

    Write data for an IPP message.

    Syntax

    @@ -3421,7 +2836,7 @@ ippWriteIO(
    - +
    dstDestination
    cbWrite callback function
    blockingUse blocking IO?
    parentParent IPP request
    parentParent IPP message
    ippIPP data

    Returns

    @@ -3429,82 +2844,11 @@ ippWriteIO(

    Structures

    -

    cups_dest_s

    -

    Description

    -

    Destination

    -

    Definition

    -
    -struct cups_dest_s
    -{
    -  char *name, * instance;
    -  int is_default;
    -  int num_options;
    -  cups_option_t * options;
    -};
    -
    -

    Members

    -
    - - - - - - -
    NameDescription
    instance Local instance name or NULL
    is_default Is this printer the default?
    num_options Number of options
    options Options
    - -

    cups_job_s

    -

    Description

    -

    Job

    -

    Definition

    -
    -struct cups_job_s
    -{
    -  char *dest, *title, *user, * format;
    -  int id;
    -  int size, priority;
    -  time_t completed_time, creation_time, processing_time;
    -  ipp_jstate_t state;
    -};
    -
    -

    Members

    -
    - - - - - - - -
    NameDescription
    format Document format
    id The job ID
    priority Priority (1-100)
    processing_time Time the job was processed
    state Job state
    - -

    cups_option_s

    -

    Description

    -

    Types and structures...

    -

    Definition

    -
    -struct cups_option_s
    -{
    -  char * name;
    -  char * value;
    -};
    -
    -

    Members

    -
    - - - - -
    NameDescription
    name Name of option
    value Value of option
    -

     CUPS 1.2 http_addrlist_s

    Description

    Socket address list, which is @@ -3527,79 +2871,6 @@ struct http_addrlist_s next Pointer to next address in list -

    http_s

    -

    Description

    -

    HTTP connection structure.

    -

    Definition

    -
    -struct http_s
    -{
    -  time_t activity;
    -  http_addrlist_t * addrlist;
    -  int auth_type;
    -  int blocking;
    -  char buffer[HTTP_MAX_BUFFER];
    -  char * cookie;
    -  char * data;
    -  http_encoding_t data_encoding;
    -  off_t data_remaining;
    -  int digest_tries;
    -  http_encryption_t encryption;
    -  int error;
    -  http_status_t expect;
    -  int fd;
    -  char hostname[HTTP_MAX_HOST], fields[HTTP_FIELD_MAX][HTTP_MAX_VALUE];
    -  http_addr_t * hostaddr;
    -  fd_set * input_set;
    -  http_keepalive_t keep_alive;
    -  _cups_md5_state_t md5_state;
    -  char nonce[HTTP_MAX_VALUE];
    -  int nonce_count;
    -  http_state_t state;
    -  http_status_t status;
    -  void * tls;
    -  int used;
    -  char authstring[HTTP_MAX_VALUE], userpass[HTTP_MAX_VALUE];
    -  http_version_t version;
    -  char wbuffer[HTTP_MAX_BUFFER];
    -  int wused;
    -};
    -
    -

    Members

    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameDescription
    activity Time since last read/write
    addrlist  CUPS 1.2 List of valid addresses
    auth_type Authentication in use
    blocking To block or not to block
    buffer[HTTP_MAX_BUFFER] Buffer for incoming data
    cookie  CUPS 1.1.19 Cookie value(s)
    data Pointer to data buffer
    data_encoding Chunked or not
    data_remaining  CUPS 1.2 Number of bytes left
    digest_tries  CUPS 1.1.20 Number of tries for digest auth
    encryption Encryption requirements
    error Last error on read
    expect  CUPS 1.1.19 Expect: header
    fd File descriptor for this socket
    fields[HTTP_FIELD_MAX][HTTP_MAX_VALUE] Field values
    hostaddr  CUPS 1.2 Current host address and port
    input_set  CUPS 1.1.19 select() set for httpWait()
    keep_alive Keep-alive supported?
    md5_state MD5 state
    nonce[HTTP_MAX_VALUE] Nonce value
    nonce_count Nonce count
    state State of client
    status Status of last request
    tls TLS state information
    used Number of bytes used in buffer
    userpass[HTTP_MAX_VALUE]  CUPS 1.1.20 Username:password string
    version Protocol version
    wbuffer[HTTP_MAX_BUFFER] Buffer for outgoing data
    wused  CUPS 1.2 Write buffer bytes used
    -

    ipp_attribute_s

    Description

    Attribute

    @@ -3607,7 +2878,7 @@ struct http_s
     struct ipp_attribute_s
     {
    -  char * name;
    +  char * name;
       struct ipp_attribute_s * next;
       int num_values;
       ipp_tag_t group_tag, value_tag;
    @@ -3625,15 +2896,17 @@ struct ipp_attribute_s
     values[1] Values
     
     
    -

    ipp_str

    +

    ipp_s

    Description

    IPP Request/Response/Notification

    Definition

    -struct ipp_str
    +struct ipp_s
     {
    -  ipp_attribute_t *attrs, *last, * current;
    +  ipp_attribute_t * attrs;
    +  ipp_attribute_t * current;
       ipp_tag_t curtag;
    +  ipp_attribute_t * last;
       ipp_attribute_t * prev;
       ipp_request_t request;
       ipp_state_t state;
    @@ -3643,8 +2916,10 @@ struct ipp_str
     
    + + @@ -3652,63 +2927,19 @@ struct ipp_str

    Types

    -

    char

    -

    Description

    -

    Printer Options

    -

    Definition

    -
    -typedef const * (*charcups_password_cb_t)(const char *);
    -
    - -

    cups_dest_t

    -

    Description

    -

    Destination

    -

    Definition

    -
    -typedef struct cups_dest_s cups_dest_t;
    -
    - -

    cups_job_t

    -

    Description

    -

    Job

    -

    Definition

    -
    -typedef struct cups_job_s cups_job_t;
    -
    - -

    cups_option_t

    -

    Description

    -

    Types and structures...

    -

    Definition

    -
    -typedef struct cups_option_s cups_option_t;
    -
    - -

    cups_ptype_t

    -

    Description

    -

    Printer Type/Capability Bits

    -

    Definition

    -
    -typedef unsigned cups_ptype_t;
    -
    -

     CUPS 1.2 http_addrlist_t

    Description

    Socket address list, which is @@ -3749,7 +2980,7 @@ typedef enum http_encryption_e http_encryption_

    HTTP connection structure.

    Definition

    -typedef struct http_s http_t;
    +typedef struct _http_s http_t;
     

    ipp_attribute_t

    @@ -3760,12 +2991,12 @@ typedef struct http_s http_t; typedef struct ipp_attribute_s ipp_attribute_t; -

    ipp_iocb_t

    +

     CUPS 1.2 ipp_iocb_t

    Description

    -

    IPP IO Callback Function

    +

    IPP IO Callback Function

    Definition

    -typedef int (*ipp_iocb_t)(void *, ipp_uchar_t *, int);
    +typedef ssize_t (*ipp_iocb_t)(void *, ipp_uchar_t *, size_t);
     

    ipp_request_t

    @@ -3773,7 +3004,7 @@ typedef int (*ipp_iocb_t)(void *, ipp_uchar_t *, int)

    Request Header

    Definition

    -typedef union ipp_request_t;
    +typedef union ipp_request_u ipp_request_t;
     

    ipp_t

    @@ -3781,7 +3012,15 @@ typedef union ipp_request_t;

    Attribute Value

    Definition

    -typedef struct ipp_str ipp_t;
    +typedef struct ipp_s ipp_t;
    +
    + +

    ipp_uchar_t

    +

    Description

    +

    IPP status codes...

    +

    Definition

    +
    +typedef typedef unsigned char ipp_uchar_t;
     

    ipp_value_t

    @@ -3789,7 +3028,51 @@ typedef struct ipp_str ipp_t;

    New in CUPS 1.1.19

    Definition

    -typedef union ipp_value_t;
    +typedef union ipp_value_u ipp_value_t;
    +
    + +

    Unions

    + + +

    ipp_request_u

    +

    Description

    +

    Request Header

    +

    Definition

    +
    +union ipp_request_u
    +{
    +};
    +
    +

    Members

    +
    NameDescription
    attrs Attributes
    current Current attribute (for read/write)
    curtag Current attribute group tag
    last Last attribute in list
    prev Previous attribute (for read)
    request Request header
    state State of request
    + + +
    NameDescription
    + +

    ipp_value_u

    +

    Description

    +

    New in CUPS 1.1.19

    +

    Definition

    +
    +union ipp_value_u
    +{
    +  char boolean;
    +  ipp_t * collection;
    +  ipp_uchar_t date[11];
    +  int integer;
    +};
     
    +

    Members

    +
    + + + + + + +
    NameDescription
    boolean Boolean value
    collection Collection value
    date[11] Date/time value
    integer Integer/enumerated value
    diff --git a/doc/help/api-ppd.html b/doc/help/api-ppd.html index 341908af0..61ad7d67b 100644 --- a/doc/help/api-ppd.html +++ b/doc/help/api-ppd.html @@ -74,13 +74,30 @@ library:

    Enumerations

    +

     CUPS 1.2 ppd_cptype_e

    +

    Description

    +

    Custom Parameter Type

    +

    Values

    +
    + + + + + + + + + + +
    NameDescription
    PPD_CUSTOM_CURVE Curve value for f(x) = x^value
    PPD_CUSTOM_INT Integer number value
    PPD_CUSTOM_INVCURVE Curve value for f(x) = x^(1/value)
    PPD_CUSTOM_PASSCODE String of (hidden) numbers
    PPD_CUSTOM_PASSWORD String of (hidden) characters
    PPD_CUSTOM_POINTS Measurement value in points
    PPD_CUSTOM_REAL Real number value
    PPD_CUSTOM_STRING String of characters
    +

    ppd_cs_e

    Description

    Colorspaces

    @@ -96,23 +113,6 @@ library:

    PPD_CS_RGBK RGBK (K = gray) colorspace -

     CUPS 1.2 ppd_ext_ui_e

    -

    Description

    -

    Extended UI Types

    -

    Values

    -
    - - - - - - - - - - -
    NameDescription
    PPD_UI_CUPS_CURVE Specify start, end, and gamma numbers
    PPD_UI_CUPS_GAMMA Specify a gamma number
    PPD_UI_CUPS_INTEGER Specify an integer number
    PPD_UI_CUPS_INTEGER_ARRAY Specify an array of integer numbers
    PPD_UI_CUPS_REAL Specify a real number
    PPD_UI_CUPS_REAL_ARRAY Specify an array of real numbers
    PPD_UI_CUPS_TEXT Specify a string
    PPD_UI_CUPS_XY_ARRAY Specify an array of X/Y real numbers
    -

    ppd_section_e

    Description

    Order dependency sections

    @@ -136,6 +136,7 @@ library:

    NameDescription PPD_ALLOC_ERROR Memory allocation error +PPD_BAD_CUSTOM_PARAM Bad custom parameter PPD_BAD_OPEN_GROUP Bad OpenGroup PPD_BAD_OPEN_UI Bad OpenUI/JCLOpenUI PPD_BAD_ORDER_DEPENDENCY Bad OrderDependency @@ -173,8 +174,10 @@ library:

    • ppdClose()
    • ppdCollect()
    • +
    • ppdCollect2()  CUPS 1.2 
    • ppdConflicts()
    • ppdEmit()
    • +
    • ppdEmitAfterOrder()  CUPS 1.2 
    • ppdEmitFd()
    • ppdEmitJCL()
    • ppdEmitJCLEnd()  CUPS 1.2 
    • @@ -184,10 +187,12 @@ library:

    • ppdFindMarkedChoice()
    • ppdFindNextAttr()  CUPS 1.1.19 
    • ppdFindOption()
    • +
    • ppdFirstOption()  CUPS 1.2 
    • ppdIsMarked()
    • ppdLastError()  CUPS 1.1.19 
    • ppdMarkDefaults()
    • ppdMarkOption()
    • +
    • ppdNextOption()  CUPS 1.2 
    • ppdOpen()
    • ppdOpen2()  CUPS 1.2 
    • ppdOpenFd()
    • @@ -239,6 +244,33 @@ ppdCollect(

      Returns

      Number of options marked

      +

       CUPS 1.2 ppdCollect2()

      +

      Description

      +

      Collect all marked options that reside in the +specified section and minimum order. + +

      +

      Syntax

      +
      +int
      +ppdCollect2(
      +    ppd_file_t * ppd,
      +    ppd_section_t section,
      +    float min_order,
      +    ppd_choice_t *** choices);
      +
      +

      Arguments

      +
      + + + + + + +
      NameDescription
      ppdPPD file data
      sectionSection to collect
      min_orderMinimum OrderDependency value
      choicesPointers to choices
      +

      Returns

      +

      Number of options marked

      +

      ppdConflicts()

      Description

      Check to see if there are any conflicts.

      @@ -279,6 +311,39 @@ ppdEmit(

      Returns

      0 on success, -1 on failure

      +

       CUPS 1.2 ppdEmitAfterOrder()

      +

      Description

      +

      Emit a subset of the code for marked options to a file. + +When "limit" is non-zero, this function only emits options whose +OrderDependency value is greater than or equal to "min_order". + +When "limit" is zero, this function is identical to ppdEmit(). + +

      +

      Syntax

      +
      +int
      +ppdEmitAfterOrder(
      +    ppd_file_t * ppd,
      +    FILE * fp,
      +    ppd_section_t section,
      +    int limit,
      +    float min_order);
      +
      +

      Arguments

      +
      + + + + + + + +
      NameDescription
      ppdPPD file record
      fpFile to write to
      sectionSection to write
      limitNon-zero to use min_order, 0 to include all
      min_orderLowest order dependency to include
      +

      Returns

      +

      0 on success, -1 on failure

      +

      ppdEmitFd()

      Description

      Emit code for marked options to a file.

      @@ -477,6 +542,28 @@ ppdFindOption(

      Returns

      Pointer to option or NULL

      +

       CUPS 1.2 ppdFirstOption()

      +

      Description

      +

      Return the first option in the PPD file. + +Options are returned from all groups in sorted order. + +

      +

      Syntax

      +
      +ppd_option_t *
      +ppdFirstOption(
      +    ppd_file_t * ppd);
      +
      +

      Arguments

      +
      + + + +
      NameDescription
      ppdPPD file
      +

      Returns

      +

      First option or NULL

      +

      ppdIsMarked()

      Description

      Check to see if an option is marked...

      @@ -564,6 +651,28 @@ ppdMarkOption(

      Returns

      Number of conflicts

      +

       CUPS 1.2 ppdNextOption()

      +

      Description

      +

      Return the next option in the PPD file. + +Options are returned from all groups in sorted order. + +

      +

      Syntax

      +
      +ppd_option_t *
      +ppdNextOption(
      +    ppd_file_t * ppd);
      +
      +

      Arguments

      +
      + + + +
      NameDescription
      ppdPPD file
      +

      Returns

      +

      Next option or NULL

      +

      ppdOpen()

      Description

      Read a PPD file into memory.

      @@ -720,24 +829,24 @@ ppdSetConformance(

      Structures

      -

       CUPS 1.1.19 ppd_attr_str

      +

       CUPS 1.1.19 ppd_attr_s

      Description

      PPD Attribute Structure

      Definition

      -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
       value Value string
       
       
      -

      ppd_choice_str

      +

      ppd_choice_s

      Description

      Option choices

      Definition

      -struct ppd_choice_str
      +struct ppd_choice_s
       {
         char choice[PPD_MAX_NAME];
         char * code;
      @@ -780,87 +889,81 @@ struct ppd_choice_str
       text[PPD_MAX_TEXT] Human-readable option name
       
       
      -

      ppd_emul_str

      +

       CUPS 1.2 ppd_coption_s

      Description

      -

      Emulators

      +

      Custom Option

      Definition

      -struct ppd_emul_str
      +struct ppd_coption_s
       {
      -  char name[PPD_MAX_NAME];
      -  char * start;
      -  char * stop;
      +  char keyword[PPD_MAX_NAME];
      +  int marked;
      +  ppd_option_t * option;
      +  cups_array_t * params;
       };
       

      Members

      - - - + + + +
      NameDescription
      name[PPD_MAX_NAME] Emulator name
      start Code to switch to this emulation
      stop Code to stop this emulation
      keyword[PPD_MAX_NAME] Name of option that is being extended...
      marked Extended option is marked
      option Option that is being extended...
      params Parameters
      -

       CUPS 1.2 ppd_ext_option_str

      +

       CUPS 1.2 ppd_cparam_s

      Description

      -

      Extended Options

      +

      Custom Parameter

      Definition

      -struct ppd_ext_option_str
      +struct ppd_cparam_s
       {
      -  char * code;
      -  char keyword[PPD_MAX_NAME];
      -  int marked;
      -  int num_params;
      -  ppd_option_t * option;
      -  ppd_ext_param_t ** params;
      +  ppd_cpvalue_t minimum, maximum, current;
      +  char name[PPD_MAX_NAME];
      +  int order;
      +  char text[PPD_MAX_TEXT];
      +  ppd_cptype_t type;
       };
       

      Members

      - - - - - - + + + + +
      NameDescription
      code Generic PS code for extended options
      keyword[PPD_MAX_NAME] Name of option that is being extended...
      marked Extended option is marked
      num_params Number of parameters
      option Option that is being extended...
      params Parameters
      current Current value
      name[PPD_MAX_NAME] Parameter name
      order Order (0 to N)
      text[PPD_MAX_TEXT] Human-readable text
      type Parameter type
      -

       CUPS 1.2 ppd_ext_param_str

      +

      ppd_emul_s

      Description

      -

      Extended Parameter

      +

      Emulators

      Definition

      -struct ppd_ext_param_str
      +struct ppd_emul_s
       {
      -  ppd_ext_value_t * defval;
      -  char keyword[PPD_MAX_NAME];
      -  ppd_ext_value_t * maxval;
      -  ppd_ext_value_t * minval;
      -  char text[PPD_MAX_TEXT];
      -  ppd_ext_value_t * value;
      +  char name[PPD_MAX_NAME];
      +  char * start;
      +  char * stop;
       };
       

      Members

      - - - - - - + + +
      NameDescription
      defval Default values
      keyword[PPD_MAX_NAME] Parameter name
      maxval Maximum numeric values
      minval Minimum numeric values
      text[PPD_MAX_TEXT] Human-readable text
      value Current values
      name[PPD_MAX_NAME] Emulator name
      start Code to switch to this emulation
      stop Code to stop this emulation
      -

      ppd_file_str

      +

      ppd_file_s

      Description

      -

      Files

      +

      PPD File

      Definition

      -struct ppd_file_str
      +struct ppd_file_s
       {
         int accurate_screens;
         ppd_attr_t ** attrs;
      @@ -868,12 +971,12 @@ struct ppd_file_str
         ppd_cs_t colorspace;
         ppd_const_t * consts;
         int contone_only;
      +  cups_array_t * coptions;
         int cur_attr;
         float custom_margins[4];
         float custom_max[2];
         float custom_min[2];
         ppd_emul_t * emulations;
      -  ppd_ext_option_t ** 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;
         ppd_size_t * sizes;
      +  cups_array_t * sorted_attrs;
         int throughput;
         char * ttrasterizer;
         int variable_sizes;
      @@ -916,17 +1020,17 @@ struct ppd_file_str
       NameDescription
       
       accurate_screens 1 = supports accurate screens, 0 = not
      -attrs  CUPS 1.1.19 Attributes 
      +attrs  CUPS 1.1.19 Attributes  @private@
       color_device 1 = color device, 0 = grayscale
       colorspace Default colorspace
       consts UI/Non-UI constraints
       contone_only 1 = continuous tone only, 0 = not
      -cur_attr  CUPS 1.1.19 Current attribute 
      +coptions  CUPS 1.2 Custom options array  @private@
      +cur_attr  CUPS 1.1.19 Current attribute  @private@
       custom_margins[4] Margins around page
       custom_max[2] Maximum variable page size
       custom_min[2] Minimum variable page size
       emulations Emulations and the code to invoke them
      -extended  CUPS 1.2 Extended options 
       filters Filter strings...
       flip_duplex  CUPS 1.1 1 = Flip page for back sides 
       fonts Pre-loaded fonts
      @@ -943,15 +1047,15 @@ struct ppd_file_str
       model_number Device-specific model number
       modelname Model name (general)
       nickname Nickname (specific)
      -num_attrs  CUPS 1.1.19 Number of attributes 
      +num_attrs  CUPS 1.1.19 Number of attributes  @private@
       num_consts Number of UI/Non-UI constraints
       num_emulations Number of emulations supported
      -num_extended  CUPS 1.2 Number of extended options 
       num_filters Number of filters
       num_fonts Number of pre-loaded fonts
       num_groups Number of UI groups
       num_profiles Number of sRGB color profiles
       num_sizes Number of page sizes
      +options  CUPS 1.2 Option lookup array  @private@
       patches Patch commands to be sent to printer
       pcfilename  CUPS 1.1.19 PCFileName string 
       product Product name (from PS RIP/interpreter)
      @@ -959,24 +1063,25 @@ struct ppd_file_str
       protocols  CUPS 1.1.19 Protocols (BCP, TBCP) string 
       shortnickname Short version of nickname
       sizes Page sizes
      +sorted_attrs  CUPS 1.2 Attribute lookup array  @private@
       throughput Pages per minute
       ttrasterizer Truetype rasterizer
       variable_sizes 1 = supports variable sizes, 0 = doesn't
       
       
      -

      ppd_group_str

      +

      ppd_group_s

      Description

      Groups

      Definition

      -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;
         ppd_option_t * options;
      -  struct ppd_group_str * subgroups;
      +  struct ppd_group_s * subgroups;
       };
       

      Members

      @@ -991,12 +1096,12 @@ struct ppd_group_str subgroups Sub-groups (max depth = 1) -

      ppd_option_str

      +

      ppd_option_s

      Description

      Options

      Definition

      -struct ppd_option_str
      +struct ppd_option_s
       {
         ppd_choice_t * choices;
         char conflicted;
      @@ -1024,12 +1129,12 @@ struct ppd_option_str
       ui Type of UI option
       
       
      -

      ppd_profile_str

      +

      ppd_profile_s

      Description

      sRGB Color Profiles

      Definition

      -struct ppd_profile_str
      +struct ppd_profile_s
       {
         float density;
         float gamma;
      @@ -1049,12 +1154,12 @@ struct ppd_profile_str
       resolution[PPD_MAX_NAME] Resolution or "-"
       
       
      -

      ppd_size_str

      +

      ppd_size_s

      Description

      Page Sizes

      Definition

      -struct ppd_size_str
      +struct ppd_size_s
       {
         float bottom;
         float left;
      @@ -1085,11 +1190,11 @@ struct ppd_size_str
       	
    • ppd_attr_t  CUPS 1.1.19 
    • ppd_choice_t
    • ppd_const_t
    • +
    • ppd_coption_t  CUPS 1.2 
    • +
    • ppd_cparam_t  CUPS 1.2 
    • +
    • ppd_cptype_t  CUPS 1.2 
    • +
    • ppd_cpvalue_t  CUPS 1.2 
    • ppd_emul_t
    • -
    • ppd_ext_option_t  CUPS 1.2 
    • -
    • ppd_ext_param_t  CUPS 1.2 
    • -
    • ppd_ext_ui_t  CUPS 1.2 
    • -
    • ppd_ext_value_t  CUPS 1.2 
    • ppd_file_t
    • ppd_group_t
    • ppd_option_t
    • @@ -1104,7 +1209,7 @@ struct ppd_size_str

      PPD Attribute Structure

      Definition

      -typedef struct ppd_attr_str ppd_attr_t;
      +typedef struct ppd_attr_s ppd_attr_t;
       

      ppd_choice_t

      @@ -1112,7 +1217,7 @@ typedef struct ppd_attr_str ppd_attr_t;

      Option choices

      Definition

      -typedef struct ppd_choice_str ppd_choice_t;
      +typedef struct ppd_choice_s ppd_choice_t;
       

      ppd_const_t

      @@ -1123,52 +1228,52 @@ typedef struct ppd_choice_str ppd_choice_t; typedef struct ppd_const_t;
      -

      ppd_emul_t

      +

       CUPS 1.2 ppd_coption_t

      Description

      -

      Emulators

      +

      Custom Option

      Definition

      -typedef struct ppd_emul_str ppd_emul_t;
      +typedef struct ppd_coption_s ppd_coption_t;
       
      -

       CUPS 1.2 ppd_ext_option_t

      +

       CUPS 1.2 ppd_cparam_t

      Description

      -

      Extended Options

      +

      Custom Parameter

      Definition

      -typedef struct ppd_ext_option_str ppd_ext_option_t;
      +typedef struct ppd_cparam_s ppd_cparam_t;
       
      -

       CUPS 1.2 ppd_ext_param_t

      +

       CUPS 1.2 ppd_cptype_t

      Description

      -

      Extended Parameter

      +

      Custom Parameter Type

      Definition

      -typedef struct ppd_ext_param_str ppd_ext_param_t;
      +typedef enum ppd_cptype_e ppd_cptype_t;
       
      -

       CUPS 1.2 ppd_ext_ui_t

      +

       CUPS 1.2 ppd_cpvalue_t

      Description

      -

      Extended UI Types

      +

      Custom Parameter Value

      Definition

      -typedef enum ppd_ext_ui_e ppd_ext_ui_t;
      +typedef union ppd_cpvalue_u ppd_cpvalue_t;
       
      -

       CUPS 1.2 ppd_ext_value_t

      +

      ppd_emul_t

      Description

      -

      Extended Values

      +

      Emulators

      Definition

      -typedef union ppd_ext_value_u ppd_ext_value_t;
      +typedef struct ppd_emul_s ppd_emul_t;
       

      ppd_file_t

      Description

      -

      Files

      +

      PPD File

      Definition

      -typedef struct ppd_file_str ppd_file_t;
      +typedef struct ppd_file_s ppd_file_t;
       

      ppd_group_t

      @@ -1176,7 +1281,7 @@ typedef struct ppd_file_str ppd_file_t;

      Groups

      Definition

      -typedef struct ppd_group_str ppd_group_t;
      +typedef struct ppd_group_s ppd_group_t;
       

      ppd_option_t

      @@ -1184,7 +1289,7 @@ typedef struct ppd_group_str ppd_group_t;

      Options

      Definition

      -typedef struct ppd_option_str ppd_option_t;
      +typedef struct ppd_option_s ppd_option_t;
       

      ppd_profile_t

      @@ -1192,7 +1297,7 @@ typedef struct ppd_option_str ppd_option_t;

      sRGB Color Profiles

      Definition

      -typedef struct ppd_profile_str ppd_profile_t;
      +typedef struct ppd_profile_s ppd_profile_t;
       

      ppd_section_t

      @@ -1208,7 +1313,7 @@ typedef enum ppd_section_e ppd_section_t;

      Page Sizes

      Definition

      -typedef struct ppd_size_str ppd_size_t;
      +typedef struct ppd_size_s ppd_size_t;
       

      ppd_ui_t

      @@ -1221,30 +1326,38 @@ typedef enum ppd_ui_e ppd_ui_t;

      Unions

      -

       CUPS 1.2 ppd_ext_value_u

      +

       CUPS 1.2 ppd_cpvalue_u

      Description

      -

      Extended Values

      +

      Custom Parameter Value

      Definition

      -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;
       };
       

      Members

      - - - - + + + + + + + +
      NameDescription
      gamma Gamma value
      integer Integer value
      real Real value
      text Text value
      custom_curve Gamma value
      custom_int Integer value
      custom_invcurve Gamma value
      custom_passcode Passcode value
      custom_password Password value
      custom_points Measurement value
      custom_real Real value
      custom_string String value
      diff --git a/doc/help/spec-ppd.html b/doc/help/spec-ppd.html index eb9ac267b..6dc27cb6b 100644 --- a/doc/help/spec-ppd.html +++ b/doc/help/spec-ppd.html @@ -8,7 +8,7 @@ \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, "%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 $". */ diff --git a/templates/header.tmpl.in b/templates/header.tmpl.in index 8ffd7de80..e0fa574ce 100644 --- a/templates/header.tmpl.in +++ b/templates/header.tmpl.in @@ -2,7 +2,7 @@ <HTML> <HEAD> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8"> - <TITLE>{title} - CUPS @CUPS_VERSION@ + {title} - CUPS @CUPS_VERSION@@CUPS_REVISION@ diff --git a/tools/makesrcdist b/tools/makesrcdist index 50858a921..fdd0516ef 100755 --- a/tools/makesrcdist +++ b/tools/makesrcdist @@ -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.new mv cups-common.m4.new cups-common.m4 cd .. diff --git a/tools/testosx b/tools/testosx index 58aa52160..98891cb25 100755 --- a/tools/testosx +++ b/tools/testosx @@ -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 -sed -e '1,$s/@CUPS_VERSION@/1.2svn-r'$rev'/g' \ - doc/index.html -sed -e '1,$s/@CUPS_VERSION@/1.2svn-r'$rev'/g' \ - templates/header.tmpl # Install CUPS into the Package directory... #make INSTALL=$topdir/install-sh BUILDROOT=$pkgdir/Package install diff --git a/tools/testrpm b/tools/testrpm index 047200ef7..74d1449e4 100755 --- a/tools/testrpm +++ b/tools/testrpm @@ -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$". -- 2.39.2