diff options
Diffstat (limited to 'inc')
-rw-r--r-- | inc/optimize.h | 11 | ||||
-rw-r--r-- | inc/pqueue.h | 3 | ||||
-rw-r--r-- | inc/tree.h | 6 |
3 files changed, 17 insertions, 3 deletions
diff --git a/inc/optimize.h b/inc/optimize.h new file mode 100644 index 0000000..51cb793 --- /dev/null +++ b/inc/optimize.h @@ -0,0 +1,11 @@ +// Copyright (c) 2023, Marvin Borner <dev@marvinborner.de> +// SPDX-License-Identifier: MIT + +#ifndef BLOC_OPTIMIZE +#define BLOC_OPTIMIZE + +#include <tree.h> + +struct list *optimize_tree(struct tree *tree, void **all_trees); + +#endif diff --git a/inc/pqueue.h b/inc/pqueue.h index 3b4752d..c3ad021 100644 --- a/inc/pqueue.h +++ b/inc/pqueue.h @@ -58,6 +58,7 @@ struct pqueue { size_t step; /**< growth stepping setting */ pqueue_cmp_pri_f cmppri; /**< callback to compare nodes */ pqueue_get_pri_f getpri; /**< callback to get priority of a node */ + pqueue_set_pos_f setpos; /**< callback to set position of a node */ void **d; /**< The actualy queue in binary heap form */ }; @@ -74,7 +75,7 @@ struct pqueue { * @return the handle or NULL for insufficent memory */ struct pqueue *pqueue_init(size_t n, pqueue_cmp_pri_f cmppri, - pqueue_get_pri_f getpri); + pqueue_get_pri_f getpri, pqueue_set_pos_f set_pos); /** * free all memory used by the queue @@ -31,7 +31,8 @@ struct tree { int index; } var; struct { - size_t index; + size_t hash; + int table_index; } ref; } u; }; @@ -42,7 +43,8 @@ struct list { struct list *next; }; -struct list *tree_merge_duplicates(struct term *term); +struct list *list_add(struct list *list, void *data); +struct tree *tree_merge_duplicates(struct term *term, void **all_trees); void tree_destroy(struct list *table); #endif |