diff options
author | Martin Schröder <martin@oneiros.de> | 2007-01-31 21:21:03 +0000 |
---|---|---|
committer | Martin Schröder <martin@oneiros.de> | 2007-01-31 21:21:03 +0000 |
commit | 0a561962a632af39cb4d18a69f6ac0f7509e3453 (patch) | |
tree | 5a46cd7cdc20cabf3a4539a3340b1146857143ea | |
parent | fbd7c58833aeabafd2bd9f2d85fe1e3e13ac2302 (diff) |
pdftex 1.40.2
git-svn-id: svn://tug.org/texlive/trunk@3839 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r-- | Build/source/libs/xpdf/xpdf/config.h | 5 | ||||
-rw-r--r-- | Build/source/texk/web2c/pdftexdir/NEWS | 6 | ||||
-rw-r--r-- | Build/source/texk/web2c/pdftexdir/README | 4 | ||||
-rw-r--r-- | Build/source/texk/web2c/pdftexdir/avl.c | 1142 | ||||
-rw-r--r-- | Build/source/texk/web2c/pdftexdir/avl.h | 147 | ||||
-rw-r--r-- | Build/source/texk/web2c/pdftexdir/mapfile.c | 4 | ||||
-rw-r--r-- | Build/source/texk/web2c/pdftexdir/pdftex.web | 4 |
7 files changed, 709 insertions, 603 deletions
diff --git a/Build/source/libs/xpdf/xpdf/config.h b/Build/source/libs/xpdf/xpdf/config.h index 4c8f75673d5..0bd5541c2b0 100644 --- a/Build/source/libs/xpdf/xpdf/config.h +++ b/Build/source/libs/xpdf/xpdf/config.h @@ -24,8 +24,9 @@ #define xpdfUpdateVersionStr "0" // supported PDF version -#define supportedPDFVersionStr "1.5" -#define supportedPDFVersionNum 1.5 +// xpdf says only 1.5, but 1.7 is the same for pdfTeX's purpose +#define supportedPDFVersionStr "1.7" +#define supportedPDFVersionNum 1.7 // copyright notice #define xpdfCopyright "Copyright 1996-2005 Glyph & Cog, LLC" diff --git a/Build/source/texk/web2c/pdftexdir/NEWS b/Build/source/texk/web2c/pdftexdir/NEWS index c3f919ca9b9..38419061284 100644 --- a/Build/source/texk/web2c/pdftexdir/NEWS +++ b/Build/source/texk/web2c/pdftexdir/NEWS @@ -1,4 +1,10 @@ ------------------------------------------------- +pdfTeX 3.141592-1.40.2 was released on 2007-01-31 +------------------------------------------------- +- bugfix: maplines starting with = would not work as advertised +- bugfix: xpdf would complain that PDF 1.7 is too new + +------------------------------------------------- pdfTeX 3.141592-1.40.1 was released on 2007-01-08 ------------------------------------------------- - bugfix: the shell escape function was a bit broken diff --git a/Build/source/texk/web2c/pdftexdir/README b/Build/source/texk/web2c/pdftexdir/README index d71f361e0bd..6261b8ba0e9 100644 --- a/Build/source/texk/web2c/pdftexdir/README +++ b/Build/source/texk/web2c/pdftexdir/README @@ -1,10 +1,10 @@ pdfTeX ====== -README for version 3.14159-1.40.1 +README for version 3.14159-1.40.2 ================================= -This directory contains the version 1.40.1 of pdfTeX, an extended version +This directory contains the version 1.40.2 of pdfTeX, an extended version of eTeX that can create PDF directly from TeX source files and enhance the result of TeX typesetting with the help of PDF. When PDF output is not selected, pdfTeX produces normal DVI output, otherwise it produces PDF diff --git a/Build/source/texk/web2c/pdftexdir/avl.c b/Build/source/texk/web2c/pdftexdir/avl.c index 8d53954a7bc..a25239e8d93 100644 --- a/Build/source/texk/web2c/pdftexdir/avl.c +++ b/Build/source/texk/web2c/pdftexdir/avl.c @@ -1,7 +1,7 @@ -/* Produced by texiweb from libavl.w on 2003/01/06 at 18:07. */ +/* Produced by texiweb from libavl.w. */ /* libavl - library for manipulation of binary trees. - Copyright (C) 1998-2002 Free Software Foundation, Inc. + Copyright (C) 1998-2002, 2004 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as @@ -33,406 +33,455 @@ with comparison function |compare| using parameter |param| and memory allocator |allocator|. Returns |NULL| if memory allocation failed. */ -struct avl_table *avl_create(avl_comparison_func * compare, void *param, - struct libavl_allocator *allocator) +struct avl_table * +avl_create (avl_comparison_func *compare, void *param, + struct libavl_allocator *allocator) { - struct avl_table *tree; + struct avl_table *tree; - assert(compare != NULL); + assert (compare != NULL); - if (allocator == NULL) - allocator = &avl_allocator_default; + if (allocator == NULL) + allocator = &avl_allocator_default; - tree = allocator->libavl_malloc(allocator, sizeof *tree); - if (tree == NULL) - return NULL; + tree = allocator->libavl_malloc (allocator, sizeof *tree); + if (tree == NULL) + return NULL; - tree->avl_root = NULL; - tree->avl_compare = compare; - tree->avl_param = param; - tree->avl_alloc = allocator; - tree->avl_count = 0; - tree->avl_generation = 0; + tree->avl_root = NULL; + tree->avl_compare = compare; + tree->avl_param = param; + tree->avl_alloc = allocator; + tree->avl_count = 0; + tree->avl_generation = 0; - return tree; + return tree; } /* Search |tree| for an item matching |item|, and return it if found. Otherwise return |NULL|. */ -void *avl_find(const struct avl_table *tree, const void *item) +void * +avl_find (const struct avl_table *tree, const void *item) { - const struct avl_node *p; - - assert(tree != NULL && item != NULL); - for (p = tree->avl_root; p != NULL;) { - int cmp = tree->avl_compare(item, p->avl_data, tree->avl_param); - - if (cmp < 0) - p = p->avl_link[0]; - else if (cmp > 0) - p = p->avl_link[1]; - else /* |cmp == 0| */ - return p->avl_data; + const struct avl_node *p; + + assert (tree != NULL && item != NULL); + for (p = tree->avl_root; p != NULL; ) + { + int cmp = tree->avl_compare (item, p->avl_data, tree->avl_param); + + if (cmp < 0) + p = p->avl_link[0]; + else if (cmp > 0) + p = p->avl_link[1]; + else /* |cmp == 0| */ + return p->avl_data; } - return NULL; + return NULL; } /* Inserts |item| into |tree| and returns a pointer to |item|'s address. If a duplicate item is found in the tree, returns a pointer to the duplicate without inserting |item|. Returns |NULL| in case of memory allocation failure. */ -void **avl_probe(struct avl_table *tree, void *item) +void ** +avl_probe (struct avl_table *tree, void *item) { - struct avl_node *y, *z; /* Top node to update balance factor, and parent. */ - struct avl_node *p, *q; /* Iterator, and parent. */ - struct avl_node *n; /* Newly inserted node. */ - struct avl_node *w; /* New root of rebalanced subtree. */ - int dir; /* Direction to descend. */ - - unsigned char da[AVL_MAX_HEIGHT]; /* Cached comparison results. */ - int k = 0; /* Number of cached results. */ - - assert(tree != NULL && item != NULL); - - z = (struct avl_node *) &tree->avl_root; - y = tree->avl_root; - dir = 0; - for (q = z, p = y; p != NULL; q = p, p = p->avl_link[dir]) { - int cmp = tree->avl_compare(item, p->avl_data, tree->avl_param); - if (cmp == 0) - return &p->avl_data; - - if (p->avl_balance != 0) - z = q, y = p, k = 0; - da[k++] = dir = cmp > 0; + struct avl_node *y, *z; /* Top node to update balance factor, and parent. */ + struct avl_node *p, *q; /* Iterator, and parent. */ + struct avl_node *n; /* Newly inserted node. */ + struct avl_node *w; /* New root of rebalanced subtree. */ + int dir; /* Direction to descend. */ + + unsigned char da[AVL_MAX_HEIGHT]; /* Cached comparison results. */ + int k = 0; /* Number of cached results. */ + + assert (tree != NULL && item != NULL); + + z = (struct avl_node *) &tree->avl_root; + y = tree->avl_root; + dir = 0; + for (q = z, p = y; p != NULL; q = p, p = p->avl_link[dir]) + { + int cmp = tree->avl_compare (item, p->avl_data, tree->avl_param); + if (cmp == 0) + return &p->avl_data; + + if (p->avl_balance != 0) + z = q, y = p, k = 0; + da[k++] = dir = cmp > 0; } - n = q->avl_link[dir] = - tree->avl_alloc->libavl_malloc(tree->avl_alloc, sizeof *n); - if (n == NULL) - return NULL; + n = q->avl_link[dir] = + tree->avl_alloc->libavl_malloc (tree->avl_alloc, sizeof *n); + if (n == NULL) + return NULL; + + tree->avl_count++; + n->avl_data = item; + n->avl_link[0] = n->avl_link[1] = NULL; + n->avl_balance = 0; + if (y == NULL) + return &n->avl_data; - tree->avl_count++; - n->avl_data = item; - n->avl_link[0] = n->avl_link[1] = NULL; - n->avl_balance = 0; - if (y == NULL) - return &n->avl_data; - - for (p = y, k = 0; p != n; p = p->avl_link[da[k]], k++) - if (da[k] == 0) - p->avl_balance--; - else - p->avl_balance++; - - if (y->avl_balance == -2) { - struct avl_node *x = y->avl_link[0]; - if (x->avl_balance == -1) { - w = x; - y->avl_link[0] = x->avl_link[1]; - x->avl_link[1] = y; + for (p = y, k = 0; p != n; p = p->avl_link[da[k]], k++) + if (da[k] == 0) + p->avl_balance--; + else + p->avl_balance++; + + if (y->avl_balance == -2) + { + struct avl_node *x = y->avl_link[0]; + if (x->avl_balance == -1) + { + w = x; + y->avl_link[0] = x->avl_link[1]; + x->avl_link[1] = y; + x->avl_balance = y->avl_balance = 0; + } + else + { + assert (x->avl_balance == +1); + w = x->avl_link[1]; + x->avl_link[1] = w->avl_link[0]; + w->avl_link[0] = x; + y->avl_link[0] = w->avl_link[1]; + w->avl_link[1] = y; + if (w->avl_balance == -1) + x->avl_balance = 0, y->avl_balance = +1; + else if (w->avl_balance == 0) x->avl_balance = y->avl_balance = 0; - } else { - assert(x->avl_balance == +1); - w = x->avl_link[1]; - x->avl_link[1] = w->avl_link[0]; - w->avl_link[0] = x; - y->avl_link[0] = w->avl_link[1]; - w->avl_link[1] = y; - if (w->avl_balance == -1) - x->avl_balance = 0, y->avl_balance = +1; - else if (w->avl_balance == 0) - x->avl_balance = y->avl_balance = 0; - else /* |w->avl_balance == +1| */ - x->avl_balance = -1, y->avl_balance = 0; - w->avl_balance = 0; + else /* |w->avl_balance == +1| */ + x->avl_balance = -1, y->avl_balance = 0; + w->avl_balance = 0; } - } else if (y->avl_balance == +2) { - struct avl_node *x = y->avl_link[1]; - if (x->avl_balance == +1) { - w = x; - y->avl_link[1] = x->avl_link[0]; - x->avl_link[0] = y; + } + else if (y->avl_balance == +2) + { + struct avl_node *x = y->avl_link[1]; + if (x->avl_balance == +1) + { + w = x; + y->avl_link[1] = x->avl_link[0]; + x->avl_link[0] = y; + x->avl_balance = y->avl_balance = 0; + } + else + { + assert (x->avl_balance == -1); + w = x->avl_link[0]; + x->avl_link[0] = w->avl_link[1]; + w->avl_link[1] = x; + y->avl_link[1] = w->avl_link[0]; + w->avl_link[0] = y; + if (w->avl_balance == +1) + x->avl_balance = 0, y->avl_balance = -1; + else if (w->avl_balance == 0) x->avl_balance = y->avl_balance = 0; - } else { - assert(x->avl_balance == -1); - w = x->avl_link[0]; - x->avl_link[0] = w->avl_link[1]; - w->avl_link[1] = x; - y->avl_link[1] = w->avl_link[0]; - w->avl_link[0] = y; - if (w->avl_balance == +1) - x->avl_balance = 0, y->avl_balance = -1; - else if (w->avl_balance == 0) - x->avl_balance = y->avl_balance = 0; - else /* |w->avl_balance == -1| */ - x->avl_balance = +1, y->avl_balance = 0; - w->avl_balance = 0; + else /* |w->avl_balance == -1| */ + x->avl_balance = +1, y->avl_balance = 0; + w->avl_balance = 0; } - } else - return &n->avl_data; - z->avl_link[y != z->avl_link[0]] = w; - - tree->avl_generation++; + } + else return &n->avl_data; + z->avl_link[y != z->avl_link[0]] = w; + + tree->avl_generation++; + return &n->avl_data; } /* Inserts |item| into |table|. Returns |NULL| if |item| was successfully inserted or if a memory allocation error occurred. Otherwise, returns the duplicate item. */ -void *avl_insert(struct avl_table *table, void *item) +void * +avl_insert (struct avl_table *table, void *item) { - void **p = avl_probe(table, item); - return p == NULL || *p == item ? NULL : *p; + void **p = avl_probe (table, item); + return p == NULL || *p == item ? NULL : *p; } /* Inserts |item| into |table|, replacing any duplicate item. Returns |NULL| if |item| was inserted without replacing a duplicate, or if a memory allocation error occurred. Otherwise, returns the item that was replaced. */ -void *avl_replace(struct avl_table *table, void *item) +void * +avl_replace (struct avl_table *table, void *item) { - void **p = avl_probe(table, item); - if (p == NULL || *p == item) - return NULL; - else { - void *r = *p; - *p = item; - return r; + void **p = avl_probe (table, item); + if (p == NULL || *p == item) + return NULL; + else + { + void *r = *p; + *p = item; + return r; } } /* Deletes from |tree| and returns an item matching |item|. Returns a null pointer if no matching item found. */ -void *avl_delete(struct avl_table *tree, const void *item) +void * +avl_delete (struct avl_table *tree, const void *item) { - /* Stack of nodes. */ - struct avl_node *pa[AVL_MAX_HEIGHT]; /* Nodes. */ - unsigned char da[AVL_MAX_HEIGHT]; /* |avl_link[]| indexes. */ - int k; /* Stack pointer. */ + /* Stack of nodes. */ + struct avl_node *pa[AVL_MAX_HEIGHT]; /* Nodes. */ + unsigned char da[AVL_MAX_HEIGHT]; /* |avl_link[]| indexes. */ + int k; /* Stack pointer. */ - struct avl_node *p; /* Traverses tree to find node to delete. */ - int cmp; /* Result of comparison between |item| and |p|. */ + struct avl_node *p; /* Traverses tree to find node to delete. */ + int cmp; /* Result of comparison between |item| and |p|. */ - assert(tree != NULL && item != NULL); + assert (tree != NULL && item != NULL); - k = 0; - p = (struct avl_node *) &tree->avl_root; - for (cmp = -1; cmp != 0; - cmp = tree->avl_compare(item, p->avl_data, tree->avl_param)) { - int dir = cmp > 0; + k = 0; + p = (struct avl_node *) &tree->avl_root; + for (cmp = -1; cmp != 0; + cmp = tree->avl_compare (item, p->avl_data, tree->avl_param)) + { + int dir = cmp > 0; - pa[k] = p; - da[k++] = dir; + pa[k] = p; + da[k++] = dir; - p = p->avl_link[dir]; - if (p == NULL) - return NULL; + p = p->avl_link[dir]; + if (p == NULL) + return NULL; } - item = p->avl_data; - - if (p->avl_link[1] == NULL) - pa[k - 1]->avl_link[da[k - 1]] = p->avl_link[0]; - else { - struct avl_node *r = p->avl_link[1]; - if (r->avl_link[0] == NULL) { - r->avl_link[0] = p->avl_link[0]; - r->avl_balance = p->avl_balance; - pa[k - 1]->avl_link[da[k - 1]] = r; - da[k] = 1; - pa[k++] = r; - } else { - struct avl_node *s; - int j = k++; - - for (;;) { - da[k] = 0; - pa[k++] = r; - s = r->avl_link[0]; - if (s->avl_link[0] == NULL) - break; - - r = s; + item = p->avl_data; + + if (p->avl_link[1] == NULL) + pa[k - 1]->avl_link[da[k - 1]] = p->avl_link[0]; + else + { + struct avl_node *r = p->avl_link[1]; + if (r->avl_link[0] == NULL) + { + r->avl_link[0] = p->avl_link[0]; + r->avl_balance = p->avl_balance; + pa[k - 1]->avl_link[da[k - 1]] = r; + da[k] = 1; + pa[k++] = r; + } + else + { + struct avl_node *s; + int j = k++; + + for (;;) + { + da[k] = 0; + pa[k++] = r; + s = r->avl_link[0]; + if (s->avl_link[0] == NULL) + break; + + r = s; } - s->avl_link[0] = p->avl_link[0]; - r->avl_link[0] = s->avl_link[1]; - s->avl_link[1] = p->avl_link[1]; - s->avl_balance = p->avl_balance; + s->avl_link[0] = p->avl_link[0]; + r->avl_link[0] = s->avl_link[1]; + s->avl_link[1] = p->avl_link[1]; + s->avl_balance = p->avl_balance; - pa[j - 1]->avl_link[da[j - 1]] = s; - da[j] = 1; - pa[j] = s; + pa[j - 1]->avl_link[da[j - 1]] = s; + da[j] = 1; + pa[j] = s; } } - tree->avl_alloc->libavl_free(tree->avl_alloc, p); - - assert(k > 0); - while (--k > 0) { - struct avl_node *y = pa[k]; - - if (da[k] == 0) { - y->avl_balance++; - if (y->avl_balance == +1) - break; - else if (y->avl_balance == +2) { - struct avl_node *x = y->avl_link[1]; - if (x->avl_balance == -1) { - struct avl_node *w; - assert(x->avl_balance == -1); - w = x->avl_link[0]; - x->avl_link[0] = w->avl_link[1]; - w->avl_link[1] = x; - y->avl_link[1] = w->avl_link[0]; - w->avl_link[0] = y; - if (w->avl_balance == +1) - x->avl_balance = 0, y->avl_balance = -1; - else if (w->avl_balance == 0) - x->avl_balance = y->avl_balance = 0; - else /* |w->avl_balance == -1| */ - x->avl_balance = +1, y->avl_balance = 0; - w->avl_balance = 0; - pa[k - 1]->avl_link[da[k - 1]] = w; - } else { - y->avl_link[1] = x->avl_link[0]; - x->avl_link[0] = y; - pa[k - 1]->avl_link[da[k - 1]] = x; - if (x->avl_balance == 0) { - x->avl_balance = -1; - y->avl_balance = +1; - break; - } else - x->avl_balance = y->avl_balance = 0; + tree->avl_alloc->libavl_free (tree->avl_alloc, p); + + assert (k > 0); + while (--k > 0) + { + struct avl_node *y = pa[k]; + + if (da[k] == 0) + { + y->avl_balance++; + if (y->avl_balance == +1) + break; + else if (y->avl_balance == +2) + { + struct avl_node *x = y->avl_link[1]; + if (x->avl_balance == -1) + { + struct avl_node *w; + assert (x->avl_balance == -1); + w = x->avl_link[0]; + x->avl_link[0] = w->avl_link[1]; + w->avl_link[1] = x; + y->avl_link[1] = w->avl_link[0]; + w->avl_link[0] = y; + if (w->avl_balance == +1) + x->avl_balance = 0, y->avl_balance = -1; + else if (w->avl_balance == 0) + x->avl_balance = y->avl_balance = 0; + else /* |w->avl_balance == -1| */ + x->avl_balance = +1, y->avl_balance = 0; + w->avl_balance = 0; + pa[k - 1]->avl_link[da[k - 1]] = w; + } + else + { + y->avl_link[1] = x->avl_link[0]; + x->avl_link[0] = y; + pa[k - 1]->avl_link[da[k - 1]] = x; + if (x->avl_balance == 0) + { + x->avl_balance = -1; + y->avl_balance = +1; + break; + } + else + x->avl_balance = y->avl_balance = 0; } } - } else { - y->avl_balance--; - if (y->avl_balance == -1) - break; - else if (y->avl_balance == -2) { - struct avl_node *x = y->avl_link[0]; - if (x->avl_balance == +1) { - struct avl_node *w; - assert(x->avl_balance == +1); - w = x->avl_link[1]; - x->avl_link[1] = w->avl_link[0]; - w->avl_link[0] = x; - y->avl_link[0] = w->avl_link[1]; - w->avl_link[1] = y; - if (w->avl_balance == -1) - x->avl_balance = 0, y->avl_balance = +1; - else if (w->avl_balance == 0) - x->avl_balance = y->avl_balance = 0; - else /* |w->avl_balance == +1| */ - x->avl_balance = -1, y->avl_balance = 0; - w->avl_balance = 0; - pa[k - 1]->avl_link[da[k - 1]] = w; - } else { - y->avl_link[0] = x->avl_link[1]; - x->avl_link[1] = y; - pa[k - 1]->avl_link[da[k - 1]] = x; - if (x->avl_balance == 0) { - x->avl_balance = +1; - y->avl_balance = -1; - break; - } else - x->avl_balance = y->avl_balance = 0; + } + else + { + y->avl_balance--; + if (y->avl_balance == -1) + break; + else if (y->avl_balance == -2) + { + struct avl_node *x = y->avl_link[0]; + if (x->avl_balance == +1) + { + struct avl_node *w; + assert (x->avl_balance == +1); + w = x->avl_link[1]; + x->avl_link[1] = w->avl_link[0]; + w->avl_link[0] = x; + y->avl_link[0] = w->avl_link[1]; + w->avl_link[1] = y; + if (w->avl_balance == -1) + x->avl_balance = 0, y->avl_balance = +1; + else if (w->avl_balance == 0) + x->avl_balance = y->avl_balance = 0; + else /* |w->avl_balance == +1| */ + x->avl_balance = -1, y->avl_balance = 0; + w->avl_balance = 0; + pa[k - 1]->avl_link[da[k - 1]] = w; + } + else + { + y->avl_link[0] = x->avl_link[1]; + x->avl_link[1] = y; + pa[k - 1]->avl_link[da[k - 1]] = x; + if (x->avl_balance == 0) + { + x->avl_balance = +1; + y->avl_balance = -1; + break; + } + else + x->avl_balance = y->avl_balance = 0; } } } } - tree->avl_count--; - tree->avl_generation++; - return (void *) item; + tree->avl_count--; + tree->avl_generation++; + return (void *) item; } /* Refreshes the stack of parent pointers in |trav| and updates its generation number. */ -static void trav_refresh(struct avl_traverser *trav) +static void +trav_refresh (struct avl_traverser *trav) { - assert(trav != NULL); + assert (trav != NULL); - trav->avl_generation = trav->avl_table->avl_generation; + trav->avl_generation = trav->avl_table->avl_generation; - if (trav->avl_node != NULL) { - avl_comparison_func *cmp = trav->avl_table->avl_compare; - void *param = trav->avl_table->avl_param; - struct avl_node *node = trav->avl_node; - struct avl_node *i; + if (trav->avl_node != NULL) + { + avl_comparison_func *cmp = trav->avl_table->avl_compare; + void *param = trav->avl_table->avl_param; + struct avl_node *node = trav->avl_node; + struct avl_node *i; - trav->avl_height = 0; - for (i = trav->avl_table->avl_root; i != node;) { - assert(trav->avl_height < AVL_MAX_HEIGHT); - assert(i != NULL); + trav->avl_height = 0; + for (i = trav->avl_table->avl_root; i != node; ) + { + assert (trav->avl_height < AVL_MAX_HEIGHT); + assert (i != NULL); - trav->avl_stack[trav->avl_height++] = i; - i = i->avl_link[cmp(node->avl_data, i->avl_data, param) > 0]; + trav->avl_stack[trav->avl_height++] = i; + i = i->avl_link[cmp (node->avl_data, i->avl_data, param) > 0]; } } } /* Initializes |trav| for use with |tree| and selects the null node. */ -void avl_t_init(struct avl_traverser *trav, struct avl_table *tree) +void +avl_t_init (struct avl_traverser *trav, struct avl_table *tree) { - trav->avl_table = tree; - trav->avl_node = NULL; - trav->avl_height = 0; - trav->avl_generation = tree->avl_generation; + trav->avl_table = tree; + trav->avl_node = NULL; + trav->avl_height = 0; + trav->avl_generation = tree->avl_generation; } /* Initializes |trav| for |tree| and selects and returns a pointer to its least-valued item. Returns |NULL| if |tree| contains no nodes. */ -void *avl_t_first(struct avl_traverser *trav, struct avl_table *tree) +void * +avl_t_first (struct avl_traverser *trav, struct avl_table *tree) { - struct avl_node *x; + struct avl_node *x; - assert(tree != NULL && trav != NULL); + assert (tree != NULL && trav != NULL); - trav->avl_table = tree; - trav->avl_height = 0; - trav->avl_generation = tree->avl_generation; + trav->avl_table = tree; + trav->avl_height = 0; + trav->avl_generation = tree->avl_generation; - x = tree->avl_root; - if (x != NULL) - while (x->avl_link[0] != NULL) { - assert(trav->avl_height < AVL_MAX_HEIGHT); - trav->avl_stack[trav->avl_height++] = x; - x = x->avl_link[0]; - } - trav->avl_node = x; + x = tree->avl_root; + if (x != NULL) + while (x->avl_link[0] != NULL) + { + assert (trav->avl_height < AVL_MAX_HEIGHT); + trav->avl_stack[trav->avl_height++] = x; + x = x->avl_link[0]; + } + trav->avl_node = x; - return x != NULL ? x->avl_data : NULL; + return x != NULL ? x->avl_data : NULL; } /* Initializes |trav| for |tree| and selects and returns a pointer to its greatest-valued item. Returns |NULL| if |tree| contains no nodes. */ -void *avl_t_last(struct avl_traverser *trav, struct avl_table *tree) +void * +avl_t_last (struct avl_traverser *trav, struct avl_table *tree) { - struct avl_node *x; + struct avl_node *x; - assert(tree != NULL && trav != NULL); + assert (tree != NULL && trav != NULL); - trav->avl_table = tree; - trav->avl_height = 0; - trav->avl_generation = tree->avl_generation; + trav->avl_table = tree; + trav->avl_height = 0; + trav->avl_generation = tree->avl_generation; - x = tree->avl_root; - if (x != NULL) - while (x->avl_link[1] != NULL) { - assert(trav->avl_height < AVL_MAX_HEIGHT); - trav->avl_stack[trav->avl_height++] = x; - x = x->avl_link[1]; - } - trav->avl_node = x; + x = tree->avl_root; + if (x != NULL) + while (x->avl_link[1] != NULL) + { + assert (trav->avl_height < AVL_MAX_HEIGHT); + trav->avl_stack[trav->avl_height++] = x; + x = x->avl_link[1]; + } + trav->avl_node = x; - return x != NULL ? x->avl_data : NULL; + return x != NULL ? x->avl_data : NULL; } /* Searches for |item| in |tree|. @@ -440,34 +489,36 @@ void *avl_t_last(struct avl_traverser *trav, struct avl_table *tree) as well. If there is no matching item, initializes |trav| to the null item and returns |NULL|. */ -void *avl_t_find(struct avl_traverser *trav, struct avl_table *tree, void *item) +void * +avl_t_find (struct avl_traverser *trav, struct avl_table *tree, void *item) { - struct avl_node *p, *q; - - assert(trav != NULL && tree != NULL && item != NULL); - trav->avl_table = tree; - trav->avl_height = 0; - trav->avl_generation = tree->avl_generation; - for (p = tree->avl_root; p != NULL; p = q) { - int cmp = tree->avl_compare(item, p->avl_data, tree->avl_param); - - if (cmp < 0) - q = p->avl_link[0]; - else if (cmp > 0) - q = p->avl_link[1]; - else { /* |cmp == 0| */ - - trav->avl_node = p; - return p->avl_data; + struct avl_node *p, *q; + + assert (trav != NULL && tree != NULL && item != NULL); + trav->avl_table = tree; + trav->avl_height = 0; + trav->avl_generation = tree->avl_generation; + for (p = tree->avl_root; p != NULL; p = q) + { + int cmp = tree->avl_compare (item, p->avl_data, tree->avl_param); + + if (cmp < 0) + q = p->avl_link[0]; + else if (cmp > 0) + q = p->avl_link[1]; + else /* |cmp == 0| */ + { + trav->avl_node = p; + return p->avl_data; } - assert(trav->avl_height < AVL_MAX_HEIGHT); - trav->avl_stack[trav->avl_height++] = p; + assert (trav->avl_height < AVL_MAX_HEIGHT); + trav->avl_stack[trav->avl_height++] = p; } - trav->avl_height = 0; - trav->avl_node = NULL; - return NULL; + trav->avl_height = 0; + trav->avl_node = NULL; + return NULL; } /* Attempts to insert |item| into |tree|. @@ -477,163 +528,193 @@ void *avl_t_find(struct avl_traverser *trav, struct avl_table *tree, void *item) its location. No replacement of the item occurs. If a memory allocation failure occurs, |NULL| is returned and |trav| is initialized to the null item. */ -void *avl_t_insert(struct avl_traverser *trav, struct avl_table *tree, - void *item) +void * +avl_t_insert (struct avl_traverser *trav, struct avl_table *tree, void *item) { - void **p; - - assert(trav != NULL && tree != NULL && item != NULL); - - p = avl_probe(tree, item); - if (p != NULL) { - trav->avl_table = tree; - trav->avl_node = ((struct avl_node *) - ((char *) p - offsetof(struct avl_node, avl_data))); - trav->avl_generation = tree->avl_generation - 1; - return *p; - } else { - avl_t_init(trav, tree); - return NULL; + void **p; + + assert (trav != NULL && tree != NULL && item != NULL); + + p = avl_probe (tree, item); + if (p != NULL) + { + trav->avl_table = tree; + trav->avl_node = + ((struct avl_node *) + ((char *) p - offsetof (struct avl_node, avl_data))); + trav->avl_generation = tree->avl_generation - 1; + return *p; + } + else + { + avl_t_init (trav, tree); + return NULL; } } /* Initializes |trav| to have the same current node as |src|. */ -void *avl_t_copy(struct avl_traverser *trav, const struct avl_traverser *src) +void * +avl_t_copy (struct avl_traverser *trav, const struct avl_traverser *src) { - assert(trav != NULL && src != NULL); - - if (trav != src) { - trav->avl_table = src->avl_table; - trav->avl_node = src->avl_node; - trav->avl_generation = src->avl_generation; - if (trav->avl_generation == trav->avl_table->avl_generation) { - trav->avl_height = src->avl_height; - memcpy(trav->avl_stack, (const void *) src->avl_stack, - sizeof *trav->avl_stack * trav->avl_height); + assert (trav != NULL && src != NULL); + + if (trav != src) + { + trav->avl_table = src->avl_table; + trav->avl_node = src->avl_node; + trav->avl_generation = src->avl_generation; + if (trav->avl_generation == trav->avl_table->avl_generation) + { + trav->avl_height = src->avl_height; + memcpy (trav->avl_stack, (const void *) src->avl_stack, + sizeof *trav->avl_stack * trav->avl_height); } } - return trav->avl_node != NULL ? trav->avl_node->avl_data : NULL; + return trav->avl_node != NULL ? trav->avl_node->avl_data : NULL; } /* Returns the next data item in inorder within the tree being traversed with |trav|, or if there are no more data items returns |NULL|. */ -void *avl_t_next(struct avl_traverser *trav) +void * +avl_t_next (struct avl_traverser *trav) { - struct avl_node *x; + struct avl_node *x; - assert(trav != NULL); + assert (trav != NULL); - if (trav->avl_generation != trav->avl_table->avl_generation) - trav_refresh(trav); + if (trav->avl_generation != trav->avl_table->avl_generation) + trav_refresh (trav); - x = trav->avl_node; - if (x == NULL) { - return avl_t_first(trav, trav->avl_table); - } else if (x->avl_link[1] != NULL) { - assert(trav->avl_height < AVL_MAX_HEIGHT); - trav->avl_stack[trav->avl_height++] = x; - x = x->avl_link[1]; - - while (x->avl_link[0] != NULL) { - assert(trav->avl_height < AVL_MAX_HEIGHT); - trav->avl_stack[trav->avl_height++] = x; - x = x->avl_link[0]; + x = trav->avl_node; + if (x == NULL) + { + return avl_t_first (trav, trav->avl_table); + } + else if (x->avl_link[1] != NULL) + { + assert (trav->avl_height < AVL_MAX_HEIGHT); + trav->avl_stack[trav->avl_height++] = x; + x = x->avl_link[1]; + + while (x->avl_link[0] != NULL) + { + assert (trav->avl_height < AVL_MAX_HEIGHT); + trav->avl_stack[trav->avl_height++] = x; + x = x->avl_link[0]; } - } else { - struct avl_node *y; - - do { - if (trav->avl_height == 0) { - trav->avl_node = NULL; - return NULL; + } + else + { + struct avl_node *y; + + do + { + if (trav->avl_height == 0) + { + trav->avl_node = NULL; + return NULL; } - y = x; - x = trav->avl_stack[--trav->avl_height]; + y = x; + x = trav->avl_stack[--trav->avl_height]; } - while (y == x->avl_link[1]); + while (y == x->avl_link[1]); } - trav->avl_node = x; + trav->avl_node = x; - return x->avl_data; + return x->avl_data; } /* Returns the previous data item in inorder within the tree being traversed with |trav|, or if there are no more data items returns |NULL|. */ -void *avl_t_prev(struct avl_traverser *trav) +void * +avl_t_prev (struct avl_traverser *trav) { - struct avl_node *x; - - assert(trav != NULL); + struct avl_node *x; - if (trav->avl_generation != trav->avl_table->avl_generation) - trav_refresh(trav); + assert (trav != NULL); - x = trav->avl_node; - if (x == NULL) { - return avl_t_last(trav, trav->avl_table); - } else if (x->avl_link[0] != NULL) { - assert(trav->avl_height < AVL_MAX_HEIGHT); - trav->avl_stack[trav->avl_height++] = x; - x = x->avl_link[0]; + if (trav->avl_generation != trav->avl_table->avl_generation) + trav_refresh (trav); - while (x->avl_link[1] != NULL) { - assert(trav->avl_height < AVL_MAX_HEIGHT); - trav->avl_stack[trav->avl_height++] = x; - x = x->avl_link[1]; + x = trav->avl_node; + if (x == NULL) + { + return avl_t_last (trav, trav->avl_table); + } + else if (x->avl_link[0] != NULL) + { + assert (trav->avl_height < AVL_MAX_HEIGHT); + trav->avl_stack[trav->avl_height++] = x; + x = x->avl_link[0]; + + while (x->avl_link[1] != NULL) + { + assert (trav->avl_height < AVL_MAX_HEIGHT); + trav->avl_stack[trav->avl_height++] = x; + x = x->avl_link[1]; } - } else { - struct avl_node *y; - - do { - if (trav->avl_height == 0) { - trav->avl_node = NULL; - return NULL; + } + else + { + struct avl_node *y; + + do + { + if (trav->avl_height == 0) + { + trav->avl_node = NULL; + return NULL; } - y = x; - x = trav->avl_stack[--trav->avl_height]; + y = x; + x = trav->avl_stack[--trav->avl_height]; } - while (y == x->avl_link[0]); + while (y == x->avl_link[0]); } - trav->avl_node = x; + trav->avl_node = x; - return x->avl_data; + return x->avl_data; } /* Returns |trav|'s current item. */ -void *avl_t_cur(struct avl_traverser *trav) +void * +avl_t_cur (struct avl_traverser *trav) { - assert(trav != NULL); + assert (trav != NULL); - return trav->avl_node != NULL ? trav->avl_node->avl_data : NULL; + return trav->avl_node != NULL ? trav->avl_node->avl_data : NULL; } /* Replaces the current item in |trav| by |new| and returns the item replaced. |trav| must not have the null item selected. The new item must not upset the ordering of the tree. */ -void *avl_t_replace(struct avl_traverser *trav, void *new) +void * +avl_t_replace (struct avl_traverser *trav, void *new) { - void *old; + void *old; - assert(trav != NULL && trav->avl_node != NULL && new != NULL); - old = trav->avl_node->avl_data; - trav->avl_node->avl_data = new; - return old; + assert (trav != NULL && trav->avl_node != NULL && new != NULL); + old = trav->avl_node->avl_data; + trav->avl_node->avl_data = new; + return old; } +/* Destroys |new| with |avl_destroy (new, destroy)|, + first setting right links of nodes in |stack| within |new| + to null pointers to avoid touching uninitialized data. */ static void -copy_error_recovery(struct avl_node **stack, int height, - struct avl_table *new, avl_item_func * destroy) +copy_error_recovery (struct avl_node **stack, int height, + struct avl_table *new, avl_item_func *destroy) { - assert(stack != NULL && height >= 0 && new != NULL); + assert (stack != NULL && height >= 0 && new != NULL); - for (; height > 2; height -= 2) - stack[height - 1]->avl_link[1] = NULL; - avl_destroy(new, destroy); + for (; height > 2; height -= 2) + stack[height - 1]->avl_link[1] = NULL; + avl_destroy (new, destroy); } /* Copies |org| to a newly created tree, which is returned. @@ -645,147 +726,168 @@ copy_error_recovery(struct avl_node **stack, int height, and returns |NULL|. If |allocator != NULL|, it is used for allocation in the new tree. Otherwise, the same allocator used for |org| is used. */ -struct avl_table *avl_copy(const struct avl_table *org, avl_copy_func * copy, - avl_item_func * destroy, - struct libavl_allocator *allocator) +struct avl_table * +avl_copy (const struct avl_table *org, avl_copy_func *copy, + avl_item_func *destroy, struct libavl_allocator *allocator) { - struct avl_node *stack[2 * (AVL_MAX_HEIGHT + 1)]; - int height = 0; + struct avl_node *stack[2 * (AVL_MAX_HEIGHT + 1)]; + int height = 0; - struct avl_table *new; - const struct avl_node *x; - struct avl_node *y; + struct avl_table *new; + const struct avl_node *x; + struct avl_node *y; - assert(org != NULL); - new = avl_create(org->avl_compare, org->avl_param, - allocator != NULL ? allocator : org->avl_alloc); - if (new == NULL) - return NULL; - new->avl_count = org->avl_count; - if (new->avl_count == 0) - return new; - - x = (const struct avl_node *) &org->avl_root; - y = (struct avl_node *) &new->avl_root; - for (;;) { - while (x->avl_link[0] != NULL) { - assert(height < 2 * (AVL_MAX_HEIGHT + 1)); - - y->avl_link[0] = - new->avl_alloc->libavl_malloc(new->avl_alloc, - sizeof *y->avl_link[0]); - if (y->avl_link[0] == NULL) { - if (y != (struct avl_node *) &new->avl_root) { - y->avl_data = NULL; - y->avl_link[1] = NULL; + assert (org != NULL); + new = avl_create (org->avl_compare, org->avl_param, + allocator != NULL ? allocator : org->avl_alloc); + if (new == NULL) + return NULL; + new->avl_count = org->avl_count; + if (new->avl_count == 0) + return new; + + x = (const struct avl_node *) &org->avl_root; + y = (struct avl_node *) &new->avl_root; + for (;;) + { + while (x->avl_link[0] != NULL) + { + assert (height < 2 * (AVL_MAX_HEIGHT + 1)); + + y->avl_link[0] = + new->avl_alloc->libavl_malloc (new->avl_alloc, + sizeof *y->avl_link[0]); + if (y->avl_link[0] == NULL) + { + if (y != (struct avl_node *) &new->avl_root) + { + y->avl_data = NULL; + y->avl_link[1] = NULL; } - copy_error_recovery(stack, height, new, destroy); - return NULL; + copy_error_recovery (stack, height, new, destroy); + return NULL; } - stack[height++] = (struct avl_node *) x; - stack[height++] = y; - x = x->avl_link[0]; - y = y->avl_link[0]; + stack[height++] = (struct avl_node *) x; + stack[height++] = y; + x = x->avl_link[0]; + y = y->avl_link[0]; } - y->avl_link[0] = NULL; - - for (;;) { - y->avl_balance = x->avl_balance; - if (copy == NULL) - y->avl_data = x->avl_data; - else { - y->avl_data = copy(x->avl_data, org->avl_param); - if (y->avl_data == NULL) { - y->avl_link[1] = NULL; - copy_error_recovery(stack, height, new, destroy); - return NULL; + y->avl_link[0] = NULL; + + for (;;) + { + y->avl_balance = x->avl_balance; + if (copy == NULL) + y->avl_data = x->avl_data; + else + { + y->avl_data = copy (x->avl_data, org->avl_param); + if (y->avl_data == NULL) + { + y->avl_link[1] = NULL; + copy_error_recovery (stack, height, new, destroy); + return NULL; } } - if (x->avl_link[1] != NULL) { - y->avl_link[1] = - new->avl_alloc->libavl_malloc(new->avl_alloc, - sizeof *y->avl_link[1]); - if (y->avl_link[1] == NULL) { - copy_error_recovery(stack, height, new, destroy); - return NULL; + if (x->avl_link[1] != NULL) + { + y->avl_link[1] = + new->avl_alloc->libavl_malloc (new->avl_alloc, + sizeof *y->avl_link[1]); + if (y->avl_link[1] == NULL) + { + copy_error_recovery (stack, height, new, destroy); + return NULL; } - x = x->avl_link[1]; - y = y->avl_link[1]; - break; - } else - y->avl_link[1] = NULL; + x = x->avl_link[1]; + y = y->avl_link[1]; + break; + } + else + y->avl_link[1] = NULL; - if (height <= 2) - return new; + if (height <= 2) + return new; - y = stack[--height]; - x = stack[--height]; + y = stack[--height]; + x = stack[--height]; } } } /* Frees storage allocated for |tree|. If |destroy != NULL|, applies it to each data item in inorder. */ -void avl_destroy(struct avl_table *tree, avl_item_func * destroy) +void +avl_destroy (struct avl_table *tree, avl_item_func *destroy) { - struct avl_node *p, *q; - - assert(tree != NULL); - - for (p = tree->avl_root; p != NULL; p = q) - if (p->avl_link[0] == NULL) { - q = p->avl_link[1]; - if (destroy != NULL && p->avl_data != NULL) - destroy(p->avl_data, tree->avl_param); - tree->avl_alloc->libavl_free(tree->avl_alloc, p); - } else { - q = p->avl_link[0]; - p->avl_link[0] = q->avl_link[1]; - q->avl_link[1] = p; - } - - tree->avl_alloc->libavl_free(tree->avl_alloc, tree); + struct avl_node *p, *q; + + assert (tree != NULL); + + for (p = tree->avl_root; p != NULL; p = q) + if (p->avl_link[0] == NULL) + { + q = p->avl_link[1]; + if (destroy != NULL && p->avl_data != NULL) + destroy (p->avl_data, tree->avl_param); + tree->avl_alloc->libavl_free (tree->avl_alloc, p); + } + else + { + q = p->avl_link[0]; + p->avl_link[0] = q->avl_link[1]; + q->avl_link[1] = p; + } + + tree->avl_alloc->libavl_free (tree->avl_alloc, tree); } /* Allocates |size| bytes of space using |malloc()|. Returns a null pointer if allocation fails. */ -void *avl_malloc(struct libavl_allocator *allocator, size_t size) +void * +avl_malloc (struct libavl_allocator *allocator, size_t size) { - assert(allocator != NULL && size > 0); - return malloc(size); + assert (allocator != NULL && size > 0); + return malloc (size); } /* Frees |block|. */ -void avl_free(struct libavl_allocator *allocator, void *block) +void +avl_free (struct libavl_allocator *allocator, void *block) { - assert(allocator != NULL && block != NULL); - free(block); + assert (allocator != NULL && block != NULL); + free (block); } /* Default memory allocator that uses |malloc()| and |free()|. */ -struct libavl_allocator avl_allocator_default = { +struct libavl_allocator avl_allocator_default = + { avl_malloc, avl_free -}; + }; #undef NDEBUG #include <assert.h> /* Asserts that |avl_insert()| succeeds at inserting |item| into |table|. */ void - (avl_assert_insert) (struct avl_table * table, void *item) { - void **p = avl_probe(table, item); - assert(p != NULL && *p == item); +(avl_assert_insert) (struct avl_table *table, void *item) +{ + void **p = avl_probe (table, item); + assert (p != NULL && *p == item); } /* Asserts that |avl_delete()| really removes |item| from |table|, and returns the removed item. */ -void *(avl_assert_delete) (struct avl_table * table, void *item) { - void *p = avl_delete(table, item); - assert(p != NULL); - return p; +void * +(avl_assert_delete) (struct avl_table *table, void *item) +{ + void *p = avl_delete (table, item); + assert (p != NULL); + return p; } + diff --git a/Build/source/texk/web2c/pdftexdir/avl.h b/Build/source/texk/web2c/pdftexdir/avl.h index c993ee01f26..b9f9e3c01a9 100644 --- a/Build/source/texk/web2c/pdftexdir/avl.h +++ b/Build/source/texk/web2c/pdftexdir/avl.h @@ -1,7 +1,7 @@ -/* Produced by texiweb from libavl.w on 2003/01/06 at 18:07. */ +/* Produced by texiweb from libavl.w. */ /* libavl - library for manipulation of binary trees. - Copyright (C) 1998-2002 Free Software Foundation, Inc. + Copyright (C) 1998-2002, 2004 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as @@ -24,95 +24,92 @@ */ #ifndef AVL_H -# define AVL_H 1 - -# include <stddef.h> -# if defined(__cplusplus) -extern "C" { -# endif +#define AVL_H 1 +#include <stddef.h> /* Function types. */ - typedef int avl_comparison_func(const void *avl_a, const void *avl_b, - void *avl_param); - typedef void avl_item_func(void *avl_item, void *avl_param); - typedef void *avl_copy_func(void *avl_item, void *avl_param); +typedef int avl_comparison_func (const void *avl_a, const void *avl_b, + void *avl_param); +typedef void avl_item_func (void *avl_item, void *avl_param); +typedef void *avl_copy_func (void *avl_item, void *avl_param); -# ifndef LIBAVL_ALLOCATOR -# define LIBAVL_ALLOCATOR +#ifndef LIBAVL_ALLOCATOR +#define LIBAVL_ALLOCATOR /* Memory allocator. */ - struct libavl_allocator { - void *(*libavl_malloc) (struct libavl_allocator *, size_t libavl_size); - void (*libavl_free) (struct libavl_allocator *, void *libavl_block); - }; -# endif +struct libavl_allocator + { + void *(*libavl_malloc) (struct libavl_allocator *, size_t libavl_size); + void (*libavl_free) (struct libavl_allocator *, void *libavl_block); + }; +#endif /* Default memory allocator. */ - extern struct libavl_allocator avl_allocator_default; - void *avl_malloc(struct libavl_allocator *, size_t); - void avl_free(struct libavl_allocator *, void *); +extern struct libavl_allocator avl_allocator_default; +void *avl_malloc (struct libavl_allocator *, size_t); +void avl_free (struct libavl_allocator *, void *); /* Maximum AVL height. */ -# ifndef AVL_MAX_HEIGHT -# define AVL_MAX_HEIGHT 32 -# endif +#ifndef AVL_MAX_HEIGHT +#define AVL_MAX_HEIGHT 32 +#endif /* Tree data structure. */ - struct avl_table { - struct avl_node *avl_root; /* Tree's root. */ - avl_comparison_func *avl_compare; /* Comparison function. */ - void *avl_param; /* Extra argument to |avl_compare|. */ - struct libavl_allocator *avl_alloc; /* Memory allocator. */ - size_t avl_count; /* Number of items in tree. */ - unsigned long avl_generation; /* Generation number. */ - }; +struct avl_table + { + struct avl_node *avl_root; /* Tree's root. */ + avl_comparison_func *avl_compare; /* Comparison function. */ + void *avl_param; /* Extra argument to |avl_compare|. */ + struct libavl_allocator *avl_alloc; /* Memory allocator. */ + size_t avl_count; /* Number of items in tree. */ + unsigned long avl_generation; /* Generation number. */ + }; /* An AVL tree node. */ - struct avl_node { - struct avl_node *avl_link[2]; /* Subtrees. */ - void *avl_data; /* Pointer to data. */ - signed char avl_balance; /* Balance factor. */ - }; +struct avl_node + { + struct avl_node *avl_link[2]; /* Subtrees. */ + void *avl_data; /* Pointer to data. */ + signed char avl_balance; /* Balance factor. */ + }; /* AVL traverser structure. */ - struct avl_traverser { - struct avl_table *avl_table; /* Tree being traversed. */ - struct avl_node *avl_node; /* Current node in tree. */ - struct avl_node *avl_stack[AVL_MAX_HEIGHT]; - /* All the nodes above |avl_node|. */ - size_t avl_height; /* Number of nodes in |avl_parent|. */ - unsigned long avl_generation; /* Generation number. */ - }; +struct avl_traverser + { + struct avl_table *avl_table; /* Tree being traversed. */ + struct avl_node *avl_node; /* Current node in tree. */ + struct avl_node *avl_stack[AVL_MAX_HEIGHT]; + /* All the nodes above |avl_node|. */ + size_t avl_height; /* Number of nodes in |avl_parent|. */ + unsigned long avl_generation; /* Generation number. */ + }; /* Table functions. */ - struct avl_table *avl_create(avl_comparison_func *, void *, - struct libavl_allocator *); - struct avl_table *avl_copy(const struct avl_table *, avl_copy_func *, - avl_item_func *, struct libavl_allocator *); - void avl_destroy(struct avl_table *, avl_item_func *); - void **avl_probe(struct avl_table *, void *); - void *avl_insert(struct avl_table *, void *); - void *avl_replace(struct avl_table *, void *); - void *avl_delete(struct avl_table *, const void *); - void *avl_find(const struct avl_table *, const void *); - void avl_assert_insert(struct avl_table *, void *); - void *avl_assert_delete(struct avl_table *, void *); - -# define avl_count(table) ((size_t) (table)->avl_count) +struct avl_table *avl_create (avl_comparison_func *, void *, + struct libavl_allocator *); +struct avl_table *avl_copy (const struct avl_table *, avl_copy_func *, + avl_item_func *, struct libavl_allocator *); +void avl_destroy (struct avl_table *, avl_item_func *); +void **avl_probe (struct avl_table *, void *); +void *avl_insert (struct avl_table *, void *); +void *avl_replace (struct avl_table *, void *); +void *avl_delete (struct avl_table *, const void *); +void *avl_find (const struct avl_table *, const void *); +void avl_assert_insert (struct avl_table *, void *); +void *avl_assert_delete (struct avl_table *, void *); + +#define avl_count(table) ((size_t) (table)->avl_count) /* Table traverser functions. */ - void avl_t_init(struct avl_traverser *, struct avl_table *); - void *avl_t_first(struct avl_traverser *, struct avl_table *); - void *avl_t_last(struct avl_traverser *, struct avl_table *); - void *avl_t_find(struct avl_traverser *, struct avl_table *, void *); - void *avl_t_insert(struct avl_traverser *, struct avl_table *, void *); - void *avl_t_copy(struct avl_traverser *, const struct avl_traverser *); - void *avl_t_next(struct avl_traverser *); - void *avl_t_prev(struct avl_traverser *); - void *avl_t_cur(struct avl_traverser *); - void *avl_t_replace(struct avl_traverser *, void *); - -# if defined(__cplusplus) -} -# endif -#endif /* avl.h */ +void avl_t_init (struct avl_traverser *, struct avl_table *); +void *avl_t_first (struct avl_traverser *, struct avl_table *); +void *avl_t_last (struct avl_traverser *, struct avl_table *); +void *avl_t_find (struct avl_traverser *, struct avl_table *, void *); +void *avl_t_insert (struct avl_traverser *, struct avl_table *, void *); +void *avl_t_copy (struct avl_traverser *, const struct avl_traverser *); +void *avl_t_next (struct avl_traverser *); +void *avl_t_prev (struct avl_traverser *); +void *avl_t_cur (struct avl_traverser *); +void *avl_t_replace (struct avl_traverser *, void *); + +#endif /* avl.h */ diff --git a/Build/source/texk/web2c/pdftexdir/mapfile.c b/Build/source/texk/web2c/pdftexdir/mapfile.c index 42eeaaaa025..5ac8d51ebfa 100644 --- a/Build/source/texk/web2c/pdftexdir/mapfile.c +++ b/Build/source/texk/web2c/pdftexdir/mapfile.c @@ -197,7 +197,7 @@ int avl_do_entry(fm_entry * fm, int mode) break; case FM_REPLACE: case FM_DELETE: - if (fm->in_use) { + if (p->in_use) { pdftex_warn ("fontmap entry for `%s' has been used, replace/delete not allowed", fm->tfm_name); @@ -231,7 +231,7 @@ int avl_do_entry(fm_entry * fm, int mode) break; case FM_REPLACE: case FM_DELETE: - if (fm->in_use) + if (p->in_use) goto exit; a = avl_delete(ps_tree, p); assert(a != NULL); diff --git a/Build/source/texk/web2c/pdftexdir/pdftex.web b/Build/source/texk/web2c/pdftexdir/pdftex.web index bb5c71b1b45..21ba7327392 100644 --- a/Build/source/texk/web2c/pdftexdir/pdftex.web +++ b/Build/source/texk/web2c/pdftexdir/pdftex.web @@ -286,8 +286,8 @@ known as `\eTeX'. {printed when \eTeX\ starts} @# @d pdftex_version==140 { \.{\\pdftexversion} } -@d pdftex_revision=="1" { \.{\\pdftexrevision} } -@d pdftex_version_string=='-1.40.1' {current \pdfTeX\ version} +@d pdftex_revision=="2" { \.{\\pdftexrevision} } +@d pdftex_version_string=='-1.40.2' {current \pdfTeX\ version} @# @d pdfeTeX_banner=='This is pdfeTeX, Version 3.141592',pdftex_version_string,eTeX_version_string {printed when \pdfeTeX\ starts} |