#include <string.h>
// see also ez-set.h ez_string_node_hash()
-
-static __inline__ int ez_string_node_equals(void *a, void *b) {
+static __inline__ int ez_string_node_equals(const void *a, const void *b) {
return strcmp(((struct ez_string_node *)a)->name, ((struct ez_string_node *)b)->name) == 0;
}
-static __inline__ int ez_string_node_cmp(void *a, void *b) {
+static __inline__ int ez_string_node_cmp(const void *a, const void *b) {
return strcmp(((struct ez_string_node *)a)->name, ((struct ez_string_node *)b)->name);
}
}
}
-void *ez_tree_scan_init_key(ez_tree *tree, ez_tree_scan *scan, enum ez_node_link_t scan_dir, enum ez_node_link_t key_dir, void *key) {
+void *ez_tree_scan_init_key(ez_tree *tree, ez_tree_scan *scan, enum ez_node_link_t scan_dir, enum ez_node_link_t key_dir, const void *key) {
struct ez_node *p = ez_node_right(&tree->root);
ez_cmp_fn node_cmp = tree->node_cmp;
int l = 0;
* @param key_node optional key node for starting point.
* @return The found node if any is returned.
*/
-void *ez_tree_scan_init_key(ez_tree *tree, ez_tree_scan *scan, enum ez_node_link_t scan_dir, enum ez_node_link_t key_dir, void *key_node);
-
+void *ez_tree_scan_init_key(ez_tree *tree, ez_tree_scan *scan, enum ez_node_link_t scan_dir, enum ez_node_link_t key_dir, const void *key_node);
/**
* Initialise tree scanner for walking tree in order from an end.