summaryrefslogtreecommitdiff
path: root/src/common/sort.h
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2016-12-18 21:36:14 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2016-12-18 21:36:14 (GMT)
commitd50544a3de540727137f2b13010ca4450f8ea10f (patch)
tree05e4ad65c25570016d5732f425a9eff2f4117d34 /src/common/sort.h
parentb0bcf250999b2242019f137e38f52390a86e71cd (diff)
Used a fast sorted array to track shared instances instead of a simple hash table.
Diffstat (limited to 'src/common/sort.h')
-rw-r--r--src/common/sort.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/common/sort.h b/src/common/sort.h
index 5b274b4..afae2b3 100644
--- a/src/common/sort.h
+++ b/src/common/sort.h
@@ -30,12 +30,21 @@
+/* Compare une valeur avec une autre. */
+int sort_unsigned_long(unsigned long, unsigned long);
+
/* Effectue une recherche dichotomique dans un tableau. */
bool bsearch_index(const void *, const void *, size_t, size_t, __compar_fn_t, size_t *);
+/* Ajoute à l'endroit indiqué un élément dans un tableau. */
+void *_qinsert(void *, size_t *, size_t, void *, size_t);
+
/* Ajoute au bon endroit un élément dans un tableau trié. */
void *qinsert(void *, size_t *, size_t, __compar_fn_t, void *);
+/* Supprime un élément dans un tableau trié. */
+void *qdelete(void *, size_t *, size_t, __compar_fn_t, void *);
+
#endif /* _COMMON_SORT_H */