summaryrefslogtreecommitdiffstats
path: root/src/H5SLprivate.h
diff options
context:
space:
mode:
authorNeil Fortner <nfortne2@hdfgroup.org>2011-10-21 19:51:32 (GMT)
committerNeil Fortner <nfortne2@hdfgroup.org>2011-10-21 19:51:32 (GMT)
commitf22b7d2e1268549e343e141206ab143b88da25ed (patch)
treeeb22bac6752b7212cf2138cbb44caf70cc141d5b /src/H5SLprivate.h
parentfb1937371d160d267c6d18c88f49b59b67b663d9 (diff)
downloadhdf5-f22b7d2e1268549e343e141206ab143b88da25ed.zip
hdf5-f22b7d2e1268549e343e141206ab143b88da25ed.tar.gz
hdf5-f22b7d2e1268549e343e141206ab143b88da25ed.tar.bz2
[svn-r21646] Port r21603 to 1.8 branch
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);