diff options
author | Mohamad Chaarawi <chaarawi@hdfgroup.org> | 2013-07-12 21:07:03 (GMT) |
---|---|---|
committer | Mohamad Chaarawi <chaarawi@hdfgroup.org> | 2013-07-12 21:07:03 (GMT) |
commit | f2a2ef446e0503d232f24270e78c91e7ba40fdfc (patch) | |
tree | 71ccdef0400e5f7fedecaeeb970f0d48b47e57e0 /src/H5VLiod_encdec.c | |
parent | 46b5d073b56090829f6f6519553b4a427703e129 (diff) | |
download | hdf5-f2a2ef446e0503d232f24270e78c91e7ba40fdfc.zip hdf5-f2a2ef446e0503d232f24270e78c91e7ba40fdfc.tar.gz hdf5-f2a2ef446e0503d232f24270e78c91e7ba40fdfc.tar.bz2 |
[svn-r23893] Add New HDF5 object - Map
Add the IOD VOL implementation. Not supported with native plugin.
Add example program to sanity check the API Forwarding
Diffstat (limited to 'src/H5VLiod_encdec.c')
-rw-r--r-- | src/H5VLiod_encdec.c | 78 |
1 files changed, 75 insertions, 3 deletions
diff --git a/src/H5VLiod_encdec.c b/src/H5VLiod_encdec.c index c342984..80cab90 100644 --- a/src/H5VLiod_encdec.c +++ b/src/H5VLiod_encdec.c @@ -207,7 +207,6 @@ int hg_proc_name_t(hg_proc_t proc, void *data) name_t *struct_data = (name_t *) data; ret = hg_proc_memcpy(proc, struct_data->value_size, sizeof(ssize_t)); - //ret = hg_proc_int64_t(proc, struct_data->value_size); if (ret != HG_SUCCESS) { HG_ERROR_DEFAULT("Proc error"); ret = HG_FAIL; @@ -216,7 +215,6 @@ int hg_proc_name_t(hg_proc_t proc, void *data) size = (size_t)(*struct_data->value_size); ret = hg_proc_memcpy(proc, &struct_data->size, sizeof(size_t)); - //ret = hg_proc_uint64_t(proc, &struct_data->size); if (ret != HG_SUCCESS) { HG_ERROR_DEFAULT("Proc error"); ret = HG_FAIL; @@ -235,6 +233,81 @@ int hg_proc_name_t(hg_proc_t proc, void *data) return ret; } +int hg_proc_binary_buf_t(hg_proc_t proc, void *data) +{ + int ret = HG_SUCCESS; + size_t size; + hg_proc_op_t op; + binary_buf_t *struct_data = (binary_buf_t *) data; + + ret = hg_proc_raw(proc, &struct_data->buf_size, sizeof(size_t)); + if (ret != HG_SUCCESS) { + HG_ERROR_DEFAULT("Proc error"); + ret = HG_FAIL; + return ret; + } + + op = hg_proc_get_op(proc); + + switch(op) { + case HG_ENCODE: + if(NULL != struct_data->buf && struct_data->buf_size != 0) { + ret = hg_proc_raw(proc, struct_data->buf, struct_data->buf_size); + if (ret != HG_SUCCESS) { + HG_ERROR_DEFAULT("Proc error"); + ret = HG_FAIL; + return ret; + } + } + break; + case HG_DECODE: + if(struct_data->buf_size != 0) { + struct_data->buf = malloc (struct_data->buf_size); + ret = hg_proc_raw(proc, struct_data->buf, struct_data->buf_size); + if (ret != HG_SUCCESS) { + HG_ERROR_DEFAULT("Proc error"); + ret = HG_FAIL; + return ret; + } + } + break; + case HG_FREE: + if(struct_data->buf_size != 0) { + free(struct_data->buf); + } + break; + default: + return HG_FAIL; + } + return ret; +} + +int hg_proc_value_t(hg_proc_t proc, void *data) +{ + int ret = HG_SUCCESS; + size_t size; + hg_proc_op_t op; + value_t *struct_data = (value_t *) data; + + ret = hg_proc_raw(proc, &struct_data->val_size, sizeof(size_t)); + if (ret != HG_SUCCESS) { + HG_ERROR_DEFAULT("Proc error"); + ret = HG_FAIL; + return ret; + } + + if(NULL != struct_data->val && struct_data->val_size != 0) { + ret = hg_proc_raw(proc, struct_data->val, struct_data->val_size); + if (ret != HG_SUCCESS) { + HG_ERROR_DEFAULT("Proc error"); + ret = HG_FAIL; + return ret; + } + } + + return ret; +} + /* Define hg_proc_plist_t */ static int hg_proc_plist_t(hg_proc_t proc, hid_t *data) { @@ -325,7 +398,6 @@ static int hg_proc_plist_t(hg_proc_t proc, hid_t *data) default: HG_ERROR_DEFAULT("PLIST unsupported op Proc error"); } - return ret; } |