summaryrefslogtreecommitdiff
path: root/src/common/sort.h
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2016-05-13 19:59:41 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2016-05-13 19:59:41 (GMT)
commited5541867f94b36e701708757a0489298fe77135 (patch)
tree56cc80141354d1d955a6ad9599e3bc2ab7366ad7 /src/common/sort.h
parent3d28b198f12671e4933890a4b79933d064593ce3 (diff)
Inserted symbols and routines using an optimized 100 times faster method.
Diffstat (limited to 'src/common/sort.h')
-rw-r--r--src/common/sort.h41
1 files changed, 41 insertions, 0 deletions
diff --git a/src/common/sort.h b/src/common/sort.h
new file mode 100644
index 0000000..4f41313
--- /dev/null
+++ b/src/common/sort.h
@@ -0,0 +1,41 @@
+
+/* Chrysalide - Outil d'analyse de fichiers binaires
+ * sort.h - prototypes pour les opérations sur des tableaux triés
+ *
+ * Copyright (C) 2016 Cyrille Bagard
+ *
+ * This file is part of Chrysalide.
+ *
+ * OpenIDA is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * OpenIDA is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Foobar. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+
+#ifndef _COMMON_SORT_H
+#define _COMMON_SORT_H
+
+
+#include <stdbool.h>
+#include <stdlib.h>
+
+
+
+/* Effectue une recherche dichotomique dans un tableau. */
+bool bsearch_index(const void *, const void *, size_t, size_t, __compar_fn_t, size_t *);
+
+/* Ajoute au bon endroit un élément dans un tableau trié. */
+void *qinsert(void *, size_t *, size_t, __compar_fn_t, void *);
+
+
+
+#endif /* _COMMON_SORT_H */