summaryrefslogtreecommitdiffstats
path: root/src/H5SLprivate.h
diff options
context:
space:
mode:
authorNeil Fortner <nfortne2@hdfgroup.org>2011-10-18 21:27:58 (GMT)
committerNeil Fortner <nfortne2@hdfgroup.org>2011-10-18 21:27:58 (GMT)
commit395c1c7db532897452716615889ad882c4ee935a (patch)
tree1625604f48f8d78b13efe29909fd1eff801fb766 /src/H5SLprivate.h
parentaca9bf5cf3039fa0179067c1ee8877870350e819 (diff)
downloadhdf5-395c1c7db532897452716615889ad882c4ee935a.zip
hdf5-395c1c7db532897452716615889ad882c4ee935a.tar.gz
hdf5-395c1c7db532897452716615889ad882c4ee935a.tar.bz2
[svn-r21603] Purpose: Add generic skip list implementation
Description: Added new H5SL_TYPE_GENERIC skip list type, which uses void *'s as keys and a client-supplied callback for key comparison. This was added to support the upcoming "merge named datatype" feature for H5Ocopy, but may be used in other places as well. Also added testing. Also fixed a potential bug with the H5SL_TYPE_OBJ implementation, and added testing for that. Tested: jam, koala, heiwa (h5committest), durandal
Diffstat (limited to 'src/H5SLprivate.h')
-rw-r--r--src/H5SLprivate.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/H5SLprivate.h b/src/H5SLprivate.h
index 40fbfa9..07ee414 100644
--- a/src/H5SLprivate.h
+++ b/src/H5SLprivate.h
@@ -47,13 +47,17 @@ typedef enum {
H5SL_TYPE_HSIZE, /* Skip list keys are 'hsize_t's */
H5SL_TYPE_UNSIGNED, /* Skip list keys are 'unsigned's */
H5SL_TYPE_SIZE, /* Skip list keys are 'size_t's */
- H5SL_TYPE_OBJ /* Skip list keys are 'H5_obj_t's */
+ H5SL_TYPE_OBJ, /* Skip list keys are 'H5_obj_t's */
+ H5SL_TYPE_GENERIC /* Skip list keys are unknown, comparison callback supplied */
} H5SL_type_t;
/**********/
/* Macros */
/**********/
+/* Typedef for comparison operations */
+typedef int (*H5SL_cmp_t)(const void *key1, const void *key2);
+
/* Typedef for iteration operations */
typedef herr_t (*H5SL_operator_t)(void *item, void *key,
void *operator_data/*in,out*/);
@@ -61,7 +65,7 @@ typedef herr_t (*H5SL_operator_t)(void *item, void *key,
/********************/
/* Private routines */
/********************/
-H5_DLL H5SL_t *H5SL_create(H5SL_type_t type);
+H5_DLL H5SL_t *H5SL_create(H5SL_type_t type, H5SL_cmp_t cmp);
H5_DLL size_t H5SL_count(H5SL_t *slist);
H5_DLL herr_t H5SL_insert(H5SL_t *slist, void *item, const void *key);
H5_DLL H5SL_node_t *H5SL_add(H5SL_t *slist, void *item, const void *key);