diff options
Diffstat (limited to 'src/H5Tprivate.h')
-rw-r--r-- | src/H5Tprivate.h | 55 |
1 files changed, 34 insertions, 21 deletions
diff --git a/src/H5Tprivate.h b/src/H5Tprivate.h index 8cdc4f1..a78d303 100644 --- a/src/H5Tprivate.h +++ b/src/H5Tprivate.h @@ -22,17 +22,10 @@ #include <H5private.h> #include <H5Gprivate.h> /*for H5G_entry_t */ -#define H5T_RESERVED_ATOMS 8 -typedef struct H5T_t H5T_t; +#define H5T_RESERVED_ATOMS 8 +#define H5T_NAMELEN 32 /*length of debugging name buffer */ -/* Statistics about a conversion function */ -typedef struct H5T_stats_t { - uintn ncalls; /*num calls to conversion function */ -#ifdef H5T_DEBUG - hsize_t nelmts; /*total data points converted */ - H5_timer_t timer; /*total time for conversion */ -#endif -} H5T_stats_t; +typedef struct H5T_t H5T_t; /* How to copy a data type */ typedef enum H5T_copy_t { @@ -41,9 +34,35 @@ typedef enum H5T_copy_t { H5T_COPY_REOPEN } H5T_copy_t; +/* Statistics about a conversion function */ +typedef struct H5T_stats_t { + unsigned ncalls; /*num calls to conversion function */ + hsize_t nelmts; /*total data points converted */ + H5_timer_t timer; /*total time for conversion */ +} H5T_stats_t; + +/* The data type conversion database */ +typedef struct H5T_path_t { + char name[H5T_NAMELEN]; /*name for debugging only */ + H5T_t *src; /*source data type ID */ + H5T_t *dst; /*destination data type ID */ + H5T_conv_t func; /*data conversion function */ + hbool_t is_hard; /*is it a hard function? */ + H5T_stats_t stats; /*statistics for the conversion */ + H5T_cdata_t cdata; /*data for this function */ +} H5T_path_t; + +/* + * Is the path the special no-op path? The no-op function can be set by the + * application and there might be more than one no-op path in a + * multi-threaded application if one thread is using the no-op path when some + * other thread changes its definition. + */ +#define H5T_IS_NOOP(P) ((P)->is_hard && 0==H5T_cmp((P)->src, (P)->dst)) + /* Private functions */ herr_t H5T_native_open(void); -herr_t H5T_init_interface (void); +herr_t H5T_init(void); htri_t H5T_isa(H5G_entry_t *ent); H5T_t *H5T_open (H5G_entry_t *loc, const char *name); H5T_t *H5T_create (H5T_class_t type, size_t size); @@ -60,16 +79,10 @@ herr_t H5T_insert (H5T_t *parent, const char *name, size_t offset, herr_t H5T_sort_by_offset (H5T_t *dt); herr_t H5T_pack (H5T_t *dt); herr_t H5T_debug (H5T_t *dt, FILE * stream); -H5T_conv_t H5T_find (const H5T_t *src, const H5T_t *dst, H5T_bkg_t need_bkg, - H5T_cdata_t **pcdata/*out*/); H5G_entry_t *H5T_entof (H5T_t *dt); -void H5T_timer_begin (H5_timer_t *timer, H5T_cdata_t *cdata); -void H5T_timer_end (H5_timer_t *timer, H5T_cdata_t *cdata, size_t nelmts); +H5T_path_t *H5T_path_find (const H5T_t *src, const H5T_t *dst, + const char *name, H5T_conv_t func); +herr_t H5T_convert(H5T_path_t *tpath, hid_t src_id, hid_t dst_id, + size_t nelmts, void *buf, void *bkg); -/* - * This conversion function is here so we can determine whether a conversion - * is a no-op or not. The other conversion functions can go in H5Tpkg.h - */ -herr_t H5T_conv_noop (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, void *buf, void *bkg); #endif |