diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2018-11-28 04:15:34 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2018-11-28 04:15:34 (GMT) |
commit | bf79e1bd766c0660ecd5b26daf2658b98f2732a0 (patch) | |
tree | 1cf72b098bf882cc1427864e63f079350b62a45b /src/H5VLint.c | |
parent | 3c5706ff5b402e3adf1a2f0b11edd0403bcfa941 (diff) | |
download | hdf5-bf79e1bd766c0660ecd5b26daf2658b98f2732a0.zip hdf5-bf79e1bd766c0660ecd5b26daf2658b98f2732a0.tar.gz hdf5-bf79e1bd766c0660ecd5b26daf2658b98f2732a0.tar.bz2 |
Added 'notify' callback for async requests; switched VOL class and info
comparison to return comparison value as parameter, so they can return error
values; "cancelled" -> "canceled"; switched order of 'wrap_object' and
'free_wrap_ctx' management callbacks.
Diffstat (limited to 'src/H5VLint.c')
-rw-r--r-- | src/H5VLint.c | 64 |
1 files changed, 41 insertions, 23 deletions
diff --git a/src/H5VLint.c b/src/H5VLint.c index 167d098..82886cd 100644 --- a/src/H5VLint.c +++ b/src/H5VLint.c @@ -883,47 +883,65 @@ done: * *------------------------------------------------------------------------- */ -int -H5VL_cmp_connector_cls(const H5VL_class_t *cls1, const H5VL_class_t *cls2) +herr_t +H5VL_cmp_connector_cls(int *cmp_value, const H5VL_class_t *cls1, const H5VL_class_t *cls2) { - int cmp_value; /* Value from comparison */ - int ret_value = 0; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ HDassert(cls1); - HDassert(cls1); + HDassert(cls2); /* Compare connector "values" */ - if(cls1->value < cls2->value) - HGOTO_DONE(-1) - if(cls1->value > cls2->value) - HGOTO_DONE(1) + if(cls1->value < cls2->value) { + *cmp_value = -1; + HGOTO_DONE(SUCCEED) + } /* end if */ + if(cls1->value > cls2->value) { + *cmp_value = 1; + HGOTO_DONE(SUCCEED) + } /* end if */ HDassert(cls1->value == cls2->value); /* Compare connector names */ - if(cls1->name == NULL && cls2->name != NULL) - HGOTO_DONE(-1); - if(cls1->name != NULL && cls2->name == NULL) - HGOTO_DONE(1); - if(0 != (cmp_value = HDstrcmp(cls1->name, cls2->name))) - HGOTO_DONE(cmp_value); + if(cls1->name == NULL && cls2->name != NULL) { + *cmp_value = -1; + HGOTO_DONE(SUCCEED) + } /* end if */ + if(cls1->name != NULL && cls2->name == NULL) { + *cmp_value = 1; + HGOTO_DONE(SUCCEED) + } /* end if */ + if(0 != (*cmp_value = HDstrcmp(cls1->name, cls2->name))) + HGOTO_DONE(SUCCEED) /* Compare connector VOL API versions */ - if(cls1->version < cls2->version) - HGOTO_DONE(-1) - if(cls1->version > cls2->version) - HGOTO_DONE(1) + if(cls1->version < cls2->version) { + *cmp_value = -1; + HGOTO_DONE(SUCCEED) + } /* end if */ + if(cls1->version > cls2->version) { + *cmp_value = 1; + HGOTO_DONE(SUCCEED) + } /* end if */ HDassert(cls1->version == cls2->version); /* Compare connector info */ - if(cls1->info_size < cls2->info_size) - HGOTO_DONE(-1) - if(cls1->info_size > cls2->info_size) - HGOTO_DONE(1) + if(cls1->info_size < cls2->info_size) { + *cmp_value = -1; + HGOTO_DONE(SUCCEED) + } /* end if */ + if(cls1->info_size > cls2->info_size) { + *cmp_value = 1; + HGOTO_DONE(SUCCEED) + } /* end if */ HDassert(cls1->info_size == cls2->info_size); + /* Set comparison value to 'equal' */ + *cmp_value = 0; + done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5VL_cmp_connector_cls() */ |