summaryrefslogtreecommitdiffstats
path: root/src/H5Tpkg.h
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@koziol.gov>2019-08-21 18:14:06 (GMT)
committerJerome Soumagne <jsoumagne@hdfgroup.org>2019-10-08 19:30:23 (GMT)
commiteaa65c862b09b399fc4727e664b56b648cfb37d2 (patch)
treecdf8678ee9adce377505dddac2df564b0e20b269 /src/H5Tpkg.h
parentf32e70895ef278a48c498477b9c29f131819e2f4 (diff)
downloadhdf5-eaa65c862b09b399fc4727e664b56b648cfb37d2.zip
hdf5-eaa65c862b09b399fc4727e664b56b648cfb37d2.tar.gz
hdf5-eaa65c862b09b399fc4727e664b56b648cfb37d2.tar.bz2
Add 'blob' callbacks to VOL, along with a native implementation to store them
in the global heap, and changed the VL datatype conversion code to use blobs. Move encode/decode of sequence lengths into VL datatype callbacks, from native VOL blob routines.
Diffstat (limited to 'src/H5Tpkg.h')
-rw-r--r--src/H5Tpkg.h39
1 files changed, 23 insertions, 16 deletions
diff --git a/src/H5Tpkg.h b/src/H5Tpkg.h
index 7798e37..281026c 100644
--- a/src/H5Tpkg.h
+++ b/src/H5Tpkg.h
@@ -243,14 +243,6 @@ typedef struct H5T_enum_t {
char **name; /*array of symbol names */
} H5T_enum_t;
-/* VL function pointers */
-typedef ssize_t (*H5T_vlen_getlenfunc_t)(const void *vl_addr);
-typedef void * (*H5T_vlen_getptrfunc_t)(void *vl_addr);
-typedef htri_t (*H5T_vlen_isnullfunc_t)(const H5F_t *f, void *vl_addr);
-typedef herr_t (*H5T_vlen_readfunc_t)(H5F_t *f, void *_vl, void *buf, size_t len);
-typedef herr_t (*H5T_vlen_writefunc_t)(H5F_t *f, const H5T_vlen_alloc_info_t *vl_alloc_info, void *_vl, void *buf, void *_bg, size_t seq_len, size_t base_size);
-typedef herr_t (*H5T_vlen_setnullfunc_t)(H5F_t *f, void *_vl, void *_bg);
-
/* VL types */
typedef enum {
H5T_VLEN_BADTYPE = -1, /* invalid VL Type */
@@ -259,20 +251,35 @@ typedef enum {
H5T_VLEN_MAXTYPE /* highest type (Invalid as true type) */
} H5T_vlen_type_t;
+/* VL function pointers */
+typedef herr_t (*H5T_vlen_getlen_func_t)(H5F_t *f, const void *vl_addr, size_t *len);
+typedef void * (*H5T_vlen_getptr_func_t)(void *vl_addr);
+typedef herr_t (*H5T_vlen_isnull_func_t)(const H5F_t *f, void *vl_addr, hbool_t *isnull);
+typedef herr_t (*H5T_vlen_setnull_func_t)(H5F_t *f, void *_vl, void *_bg);
+typedef herr_t (*H5T_vlen_read_func_t)(H5F_t *f, void *_vl, void *buf, size_t len);
+typedef herr_t (*H5T_vlen_write_func_t)(H5F_t *f, const H5T_vlen_alloc_info_t *vl_alloc_info, void *_vl, void *buf, void *_bg, size_t seq_len, size_t base_size);
+typedef herr_t (*H5T_vlen_delete_func_t)(H5F_t *f, const void *_vl);
+
+/* VL datatype callbacks */
+typedef struct H5T_vlen_class_t {
+ H5T_vlen_getlen_func_t getlen; /* Function to get VL sequence size (in element units, not bytes) */
+ H5T_vlen_getptr_func_t getptr; /* Function to get VL sequence pointer */
+ H5T_vlen_isnull_func_t isnull; /* Function to check if VL value is NIL */
+ H5T_vlen_setnull_func_t setnull;/* Function to set a VL value to NIL */
+ H5T_vlen_read_func_t read; /* Function to read VL sequence into buffer */
+ H5T_vlen_write_func_t write; /* Function to write VL sequence from buffer */
+ H5T_vlen_delete_func_t del; /* Function to delete VL sequence */
+} H5T_vlen_class_t;
+
/* A VL datatype */
typedef struct H5T_vlen_t {
H5T_vlen_type_t type; /* Type of VL data in buffer */
H5T_loc_t loc; /* Location of VL data in buffer */
- H5T_cset_t cset; /* For VL string. character set */
- H5T_str_t pad; /* For VL string. space or null padding of
+ H5T_cset_t cset; /* For VL string: character set */
+ H5T_str_t pad; /* For VL string: space or null padding of
* extra bytes */
H5F_t *f; /* File ID (if VL data is on disk) */
- H5T_vlen_getptrfunc_t getptr; /* Function to get VL sequence pointer */
- H5T_vlen_getlenfunc_t getlen; /* Function to get VL sequence size (in element units, not bytes) */
- H5T_vlen_isnullfunc_t isnull; /* Function to check if VL value is NIL */
- H5T_vlen_readfunc_t read; /* Function to read VL sequence into buffer */
- H5T_vlen_writefunc_t write; /* Function to write VL sequence from buffer */
- H5T_vlen_setnullfunc_t setnull; /* Function to set a VL value to NIL */
+ const H5T_vlen_class_t *cls; /* Pointer to VL class callbacks */
} H5T_vlen_t;
/* An opaque datatype */