diff options
author | Neil Fortner <nfortne2@hdfgroup.org> | 2011-10-18 21:29:13 (GMT) |
---|---|---|
committer | Neil Fortner <nfortne2@hdfgroup.org> | 2011-10-18 21:29:13 (GMT) |
commit | b02f6c2171986e08df00cbf47361a94a0833d72e (patch) | |
tree | 1e261c5416ebc0dd725c0dd53d55984cac83ed6e /src/H5SLprivate.h | |
parent | fa25014d40a6e74b451e3aa9fef45e61a62d6f80 (diff) | |
download | hdf5-b02f6c2171986e08df00cbf47361a94a0833d72e.zip hdf5-b02f6c2171986e08df00cbf47361a94a0833d72e.tar.gz hdf5-b02f6c2171986e08df00cbf47361a94a0833d72e.tar.bz2 |
[svn-r21604] 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.h | 8 |
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); |