summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/H5F.c9
-rw-r--r--src/H5Fpkg.h1
-rw-r--r--src/H5Fprivate.h5
-rw-r--r--src/H5Pfapl.c75
-rw-r--r--src/H5Ppublic.h119
5 files changed, 156 insertions, 53 deletions
diff --git a/src/H5F.c b/src/H5F.c
index 40fc45f..4e224d8 100644
--- a/src/H5F.c
+++ b/src/H5F.c
@@ -207,6 +207,7 @@ H5F_init_interface(void)
hsize_t family_newsize = H5F_ACS_FAMILY_NEWSIZE_DEF;
hbool_t family_to_sec2 = H5F_ACS_FAMILY_TO_SEC2_DEF;
H5FD_mem_t mem_type = H5F_ACS_MULTI_TYPE_DEF;
+ hbool_t latest_format = H5F_ACS_LATEST_FORMAT_DEF;
/* File mount property class variable.
* - Mount property class to modify
@@ -361,6 +362,10 @@ H5F_init_interface(void)
/* Register the data type of multi driver info */
if(H5P_register(acs_pclass,H5F_ACS_MULTI_TYPE_NAME,H5F_ACS_MULTI_TYPE_SIZE, &mem_type,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class")
+
+ /* Register the 'use the latest version of the format' flag */
+ if(H5P_register(acs_pclass,H5F_ACS_LATEST_FORMAT_NAME, H5F_ACS_LATEST_FORMAT_SIZE, &latest_format, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class")
} /* end if */
/* Only register the default property list if it hasn't been created yet */
@@ -869,6 +874,8 @@ H5F_get_access_plist(H5F_t *f)
HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't sieve buffer size")
if(H5P_set(new_plist, H5F_ACS_SDATA_BLOCK_SIZE_NAME, &(f->shared->lf->def_sdata_block_size)) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set 'small data' cache size")
+ if(H5P_set(new_plist, H5F_ACS_LATEST_FORMAT_NAME, &(f->shared->latest_format)) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set 'latest format' flag")
/*
* Since we're resetting the driver ID and info, close them if they
@@ -1511,6 +1518,8 @@ H5F_new(H5F_file_t *shared, hid_t fcpl_id, hid_t fapl_id, H5FD_t *lf)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get garbage collect reference")
if(H5P_get(plist, H5F_ACS_SIEVE_BUF_SIZE_NAME, &(f->shared->sieve_buf_size)) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get sieve buffer size")
+ if(H5P_get(plist, H5F_ACS_LATEST_FORMAT_NAME, &(f->shared->latest_format)) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get 'latest format' flag")
/*
* Create a meta data cache with the specified number of elements.
diff --git a/src/H5Fpkg.h b/src/H5Fpkg.h
index 10facbf..7dba833 100644
--- a/src/H5Fpkg.h
+++ b/src/H5Fpkg.h
@@ -111,6 +111,7 @@ typedef struct H5F_file_t {
hsize_t threshold; /* Threshold for alignment */
hsize_t alignment; /* Alignment */
unsigned gc_ref; /* Garbage-collect references? */
+ hbool_t latest_format; /* Always use the latest format? */
int ncwfs; /* Num entries on cwfs list */
struct H5HG_heap_t **cwfs; /* Global heap cache */
struct H5G_t *root_grp; /* Open root group */
diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h
index 14f43bd..bfba2e5 100644
--- a/src/H5Fprivate.h
+++ b/src/H5Fprivate.h
@@ -454,6 +454,11 @@ typedef struct H5F_t H5F_t;
#define H5F_ACS_MULTI_TYPE_SIZE sizeof(H5FD_mem_t)
#define H5F_ACS_MULTI_TYPE_DEF H5FD_MEM_DEFAULT
+/* Definition for 'use latest format version' flag */
+#define H5F_ACS_LATEST_FORMAT_NAME "latest_format"
+#define H5F_ACS_LATEST_FORMAT_SIZE sizeof(hbool_t)
+#define H5F_ACS_LATEST_FORMAT_DEF FALSE
+
/* ======================== File Mount properties ====================*/
/* Definition for whether absolute symlinks local to file. */
#define H5F_MNT_SYM_LOCAL_NAME "local"
diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c
index 0a9e29e..e05b983 100644
--- a/src/H5Pfapl.c
+++ b/src/H5Pfapl.c
@@ -1462,7 +1462,7 @@ H5Pget_small_data_block_size(hid_t plist_id, hsize_t *size/*out*/)
/* Get values */
if (size) {
- if(H5P_get(plist, H5F_ACS_META_BLOCK_SIZE_NAME, size) < 0)
+ if(H5P_get(plist, H5F_ACS_SDATA_BLOCK_SIZE_NAME, size) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get 'small data' block size");
} /* end if */
@@ -1470,3 +1470,76 @@ done:
FUNC_LEAVE_API(ret_value);
} /* end H5Pget_small_data_block_size() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5Pset_latest_format
+ *
+ * Purpose: Indicates that the library should always use the latest version
+ * of the file format when creating objects. If this flag is not set,
+ * the library will always use the most backwardly compatibly format
+ * possible that can store the information about an object.
+ *
+ * The default value is set to FALSE (creating backwardly compatible files)
+ *
+ * Return: Non-negative on success/Negative on failure
+ *
+ * Programmer: Quincey Koziol
+ * Friday, September 9, 2006
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5Pset_latest_format(hid_t plist_id, hbool_t latest)
+{
+ H5P_genplist_t *plist; /* Property list pointer */
+ herr_t ret_value = SUCCEED; /* return value */
+
+ FUNC_ENTER_API(H5Pset_latest_format, FAIL)
+
+ /* Get the plist structure */
+ if(NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS)))
+ HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+
+ /* Set values */
+ if(H5P_set(plist, H5F_ACS_LATEST_FORMAT_NAME, &latest) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set 'latest format' flag")
+
+done:
+ FUNC_LEAVE_API(ret_value)
+} /* end H5Pset_latest_format() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5Pget_latest_format
+ *
+ * Purpose: Returns the current settings for the 'latest format' flag
+ * from a file access property list.
+ *
+ * Return: Non-negative on success/Negative on failure
+ *
+ * Programmer: Quincey Koziol
+ * Friday, September 9, 2006
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5Pget_latest_format(hid_t plist_id, hbool_t *latest/*out*/)
+{
+ H5P_genplist_t *plist; /* Property list pointer */
+ herr_t ret_value = SUCCEED; /* return value */
+
+ FUNC_ENTER_API(H5Pget_latest_format, FAIL)
+
+ /* Get the plist structure */
+ if(NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS)))
+ HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+
+ /* Get value */
+ if(latest)
+ if(H5P_get(plist, H5F_ACS_LATEST_FORMAT_NAME, latest) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get 'latest format' flag")
+
+done:
+ FUNC_LEAVE_API(ret_value)
+} /* end H5Pget_latest_format() */
+
diff --git a/src/H5Ppublic.h b/src/H5Ppublic.h
index d76e743..3a749b7 100644
--- a/src/H5Ppublic.h
+++ b/src/H5Ppublic.h
@@ -206,15 +206,12 @@ H5_DLL herr_t H5Pclose_class(hid_t plist_id);
H5_DLL herr_t H5Pclose(hid_t plist_id);
H5_DLL hid_t H5Pcopy(hid_t plist_id);
+/* File creation property list (FCPL) routines */
H5_DLL herr_t H5Pget_version(hid_t plist_id, unsigned *boot/*out*/,
unsigned *freelist/*out*/, unsigned *stab/*out*/,
unsigned *shhdr/*out*/);
H5_DLL herr_t H5Pset_userblock(hid_t plist_id, hsize_t size);
H5_DLL herr_t H5Pget_userblock(hid_t plist_id, hsize_t *size);
-H5_DLL herr_t H5Pset_alignment(hid_t fapl_id, hsize_t threshold,
- hsize_t alignment);
-H5_DLL herr_t H5Pget_alignment(hid_t fapl_id, hsize_t *threshold/*out*/,
- hsize_t *alignment/*out*/);
H5_DLL herr_t H5Pset_sizes(hid_t plist_id, size_t sizeof_addr,
size_t sizeof_size);
H5_DLL herr_t H5Pget_sizes(hid_t plist_id, size_t *sizeof_addr/*out*/,
@@ -223,32 +220,55 @@ H5_DLL herr_t H5Pset_sym_k(hid_t plist_id, unsigned ik, unsigned lk);
H5_DLL herr_t H5Pget_sym_k(hid_t plist_id, unsigned *ik/*out*/, unsigned *lk/*out*/);
H5_DLL herr_t H5Pset_istore_k(hid_t plist_id, unsigned ik);
H5_DLL herr_t H5Pget_istore_k(hid_t plist_id, unsigned *ik/*out*/);
+
+/* File access property list (FAPL) routines */
+H5_DLL herr_t H5Pset_alignment(hid_t fapl_id, hsize_t threshold,
+ hsize_t alignment);
+H5_DLL herr_t H5Pget_alignment(hid_t fapl_id, hsize_t *threshold/*out*/,
+ hsize_t *alignment/*out*/);
+H5_DLL herr_t H5Pset_driver(hid_t plist_id, hid_t driver_id,
+ const void *driver_info);
+H5_DLL hid_t H5Pget_driver(hid_t plist_id);
+H5_DLL void *H5Pget_driver_info(hid_t plist_id);
+H5_DLL herr_t H5Pset_family_offset(hid_t fapl_id, hsize_t offset);
+H5_DLL herr_t H5Pget_family_offset(hid_t fapl_id, hsize_t *offset);
+H5_DLL herr_t H5Pset_multi_type(hid_t fapl_id, H5FD_mem_t type);
+H5_DLL herr_t H5Pget_multi_type(hid_t fapl_id, H5FD_mem_t *type);
+H5_DLL herr_t H5Pset_cache(hid_t plist_id, int mdc_nelmts,
+ size_t rdcc_nelmts, size_t rdcc_nbytes,
+ double rdcc_w0);
+H5_DLL herr_t H5Pget_cache(hid_t plist_id,
+ int *mdc_nelmts, /* out */
+ size_t *rdcc_nelmts/*out*/,
+ size_t *rdcc_nbytes/*out*/, double *rdcc_w0);
+H5_DLL herr_t H5Pset_mdc_config(hid_t plist_id,
+ H5AC_cache_config_t * config_ptr);
+H5_DLL herr_t H5Pget_mdc_config(hid_t plist_id,
+ H5AC_cache_config_t * config_ptr); /* out */
+H5_DLL herr_t H5Pset_gc_references(hid_t fapl_id, unsigned gc_ref);
+H5_DLL herr_t H5Pget_gc_references(hid_t fapl_id, unsigned *gc_ref/*out*/);
+H5_DLL herr_t H5Pset_fclose_degree(hid_t fapl_id, H5F_close_degree_t degree);
+H5_DLL herr_t H5Pget_fclose_degree(hid_t fapl_id, H5F_close_degree_t *degree);
+H5_DLL herr_t H5Pset_meta_block_size(hid_t fapl_id, hsize_t size);
+H5_DLL herr_t H5Pget_meta_block_size(hid_t fapl_id, hsize_t *size/*out*/);
+H5_DLL herr_t H5Pset_sieve_buf_size(hid_t fapl_id, size_t size);
+H5_DLL herr_t H5Pget_sieve_buf_size(hid_t fapl_id, size_t *size/*out*/);
+H5_DLL herr_t H5Pset_small_data_block_size(hid_t fapl_id, hsize_t size);
+H5_DLL herr_t H5Pget_small_data_block_size(hid_t fapl_id, hsize_t *size/*out*/);
+H5_DLL herr_t H5Pset_latest_format(hid_t plist_id, hbool_t latest);
+H5_DLL herr_t H5Pget_latest_format(hid_t plist_id, hbool_t *latest);
+
+/* Dataset creation property list (DCPL) routines */
H5_DLL herr_t H5Pset_layout(hid_t plist_id, H5D_layout_t layout);
H5_DLL H5D_layout_t H5Pget_layout(hid_t plist_id);
H5_DLL herr_t H5Pset_chunk(hid_t plist_id, int ndims, const hsize_t dim[]);
H5_DLL int H5Pget_chunk(hid_t plist_id, int max_ndims, hsize_t dim[]/*out*/);
-H5_DLL herr_t H5Pset_data_transform(hid_t plist_id, const char* expression);
-H5_DLL ssize_t H5Pget_data_transform(hid_t plist_id, char* expression /*out*/, size_t size);
H5_DLL herr_t H5Pset_external(hid_t plist_id, const char *name, off_t offset,
hsize_t size);
H5_DLL int H5Pget_external_count(hid_t plist_id);
H5_DLL herr_t H5Pget_external(hid_t plist_id, unsigned idx, size_t name_size,
char *name/*out*/, off_t *offset/*out*/,
hsize_t *size/*out*/);
-H5_DLL herr_t H5Pset_driver(hid_t plist_id, hid_t driver_id,
- const void *driver_info);
-H5_DLL hid_t H5Pget_driver(hid_t plist_id);
-H5_DLL void *H5Pget_driver_info(hid_t plist_id);
-H5_DLL herr_t H5Pset_family_offset(hid_t fapl_id, hsize_t offset);
-H5_DLL herr_t H5Pget_family_offset(hid_t fapl_id, hsize_t *offset);
-H5_DLL herr_t H5Pset_multi_type(hid_t fapl_id, H5FD_mem_t type);
-H5_DLL herr_t H5Pget_multi_type(hid_t fapl_id, H5FD_mem_t *type);
-H5_DLL herr_t H5Pset_buffer(hid_t plist_id, size_t size, void *tconv,
- void *bkg);
-H5_DLL size_t H5Pget_buffer(hid_t plist_id, void **tconv/*out*/,
- void **bkg/*out*/);
-H5_DLL herr_t H5Pset_preserve(hid_t plist_id, hbool_t status);
-H5_DLL int H5Pget_preserve(hid_t plist_id);
H5_DLL herr_t H5Pmodify_filter(hid_t plist_id, H5Z_filter_t filter,
unsigned int flags, size_t cd_nelmts,
const unsigned int cd_values[/*cd_nelmts*/]);
@@ -285,32 +305,13 @@ H5_DLL H5Z_filter_t H5Pget_filter_by_id(hid_t plist_id, H5Z_filter_t id,
unsigned int *filter_config/*out*/);
#endif /* H5_WANT_H5_V1_6_COMPAT */
H5_DLL htri_t H5Pall_filters_avail(hid_t plist_id);
+H5_DLL herr_t H5Premove_filter(hid_t plist_id, H5Z_filter_t filter);
H5_DLL herr_t H5Pset_deflate(hid_t plist_id, unsigned aggression);
H5_DLL herr_t H5Pset_szip(hid_t plist_id, unsigned options_mask, unsigned pixels_per_block);
H5_DLL herr_t H5Pset_shuffle(hid_t plist_id);
H5_DLL herr_t H5Pset_nbit(hid_t plist_id);
H5_DLL herr_t H5Pset_scaleoffset(hid_t plist_id, H5Z_SO_scale_type_t scale_type, int scale_factor);
H5_DLL herr_t H5Pset_fletcher32(hid_t plist_id);
-H5_DLL herr_t H5Pset_edc_check(hid_t plist_id, H5Z_EDC_t check);
-H5_DLL H5Z_EDC_t H5Pget_edc_check(hid_t plist_id);
-H5_DLL herr_t H5Pset_filter_callback(hid_t plist_id, H5Z_filter_func_t func,
- void* op_data);
-H5_DLL herr_t H5Pset_cache(hid_t plist_id, int mdc_nelmts,
- size_t rdcc_nelmts, size_t rdcc_nbytes,
- double rdcc_w0);
-H5_DLL herr_t H5Pget_cache(hid_t plist_id,
- int *mdc_nelmts, /* out */
- size_t *rdcc_nelmts/*out*/,
- size_t *rdcc_nbytes/*out*/, double *rdcc_w0);
-H5_DLL herr_t H5Pset_mdc_config(hid_t plist_id,
- H5AC_cache_config_t * config_ptr);
-H5_DLL herr_t H5Pget_mdc_config(hid_t plist_id,
- H5AC_cache_config_t * config_ptr); /* out */
-H5_DLL herr_t H5Pset_btree_ratios(hid_t plist_id, double left, double middle,
- double right);
-H5_DLL herr_t H5Pget_btree_ratios(hid_t plist_id, double *left/*out*/,
- double *middle/*out*/,
- double *right/*out*/);
H5_DLL herr_t H5Pset_fill_value(hid_t plist_id, hid_t type_id,
const void *value);
H5_DLL herr_t H5Pget_fill_value(hid_t plist_id, hid_t type_id,
@@ -323,10 +324,25 @@ H5_DLL herr_t H5Pget_alloc_time(hid_t plist_id, H5D_alloc_time_t
H5_DLL herr_t H5Pset_fill_time(hid_t plist_id, H5D_fill_time_t fill_time);
H5_DLL herr_t H5Pget_fill_time(hid_t plist_id, H5D_fill_time_t
*fill_time/*out*/);
-H5_DLL herr_t H5Pset_gc_references(hid_t fapl_id, unsigned gc_ref);
-H5_DLL herr_t H5Pget_gc_references(hid_t fapl_id, unsigned *gc_ref/*out*/);
-H5_DLL herr_t H5Pset_fclose_degree(hid_t fapl_id, H5F_close_degree_t degree);
-H5_DLL herr_t H5Pget_fclose_degree(hid_t fapl_id, H5F_close_degree_t *degree);
+
+/* Dataset xfer property list (DXPL) routines */
+H5_DLL herr_t H5Pset_data_transform(hid_t plist_id, const char* expression);
+H5_DLL ssize_t H5Pget_data_transform(hid_t plist_id, char* expression /*out*/, size_t size);
+H5_DLL herr_t H5Pset_buffer(hid_t plist_id, size_t size, void *tconv,
+ void *bkg);
+H5_DLL size_t H5Pget_buffer(hid_t plist_id, void **tconv/*out*/,
+ void **bkg/*out*/);
+H5_DLL herr_t H5Pset_preserve(hid_t plist_id, hbool_t status);
+H5_DLL int H5Pget_preserve(hid_t plist_id);
+H5_DLL herr_t H5Pset_edc_check(hid_t plist_id, H5Z_EDC_t check);
+H5_DLL H5Z_EDC_t H5Pget_edc_check(hid_t plist_id);
+H5_DLL herr_t H5Pset_filter_callback(hid_t plist_id, H5Z_filter_func_t func,
+ void* op_data);
+H5_DLL herr_t H5Pset_btree_ratios(hid_t plist_id, double left, double middle,
+ double right);
+H5_DLL herr_t H5Pget_btree_ratios(hid_t plist_id, double *left/*out*/,
+ double *middle/*out*/,
+ double *right/*out*/);
H5_DLL herr_t H5Pset_vlen_mem_manager(hid_t plist_id,
H5MM_allocate_t alloc_func,
void *alloc_info, H5MM_free_t free_func,
@@ -336,22 +352,17 @@ H5_DLL herr_t H5Pget_vlen_mem_manager(hid_t plist_id,
void **alloc_info,
H5MM_free_t *free_func,
void **free_info);
-H5_DLL herr_t H5Pset_meta_block_size(hid_t fapl_id, hsize_t size);
-H5_DLL herr_t H5Pget_meta_block_size(hid_t fapl_id, hsize_t *size/*out*/);
-H5_DLL herr_t H5Pset_sieve_buf_size(hid_t fapl_id, size_t size);
-H5_DLL herr_t H5Pget_sieve_buf_size(hid_t fapl_id, size_t *size/*out*/);
H5_DLL herr_t H5Pset_hyper_vector_size(hid_t fapl_id, size_t size);
H5_DLL herr_t H5Pget_hyper_vector_size(hid_t fapl_id, size_t *size/*out*/);
-H5_DLL herr_t H5Pset_small_data_block_size(hid_t fapl_id, hsize_t size);
-H5_DLL herr_t H5Pget_small_data_block_size(hid_t fapl_id, hsize_t *size/*out*/);
-H5_DLL herr_t H5Premove_filter(hid_t plist_id, H5Z_filter_t filter);
H5_DLL herr_t H5Pset_type_conv_cb(hid_t dxpl_id, H5T_conv_except_func_t op, void* operate_data);
H5_DLL herr_t H5Pget_type_conv_cb(hid_t dxpl_id, H5T_conv_except_func_t *op, void** operate_data);
#ifdef H5_GROUP_REVISION
+/* Link creation property list (LCPL) routines */
H5_DLL herr_t H5Pset_create_intermediate_group(hid_t plist_id, unsigned crt_intmd);
H5_DLL herr_t H5Pget_create_intermediate_group(hid_t plist_id, unsigned *crt_intmd /*out*/);
+/* Group creation property list (GCPL) routines */
H5_DLL herr_t H5Pset_local_heap_size_hint(hid_t plist_id, size_t size_hint);
H5_DLL herr_t H5Pget_local_heap_size_hint(hid_t plist_id, size_t *size_hint /*out*/);
H5_DLL herr_t H5Pset_link_phase_change(hid_t plist_id, unsigned max_compact, unsigned min_dense);
@@ -359,20 +370,24 @@ H5_DLL herr_t H5Pget_link_phase_change(hid_t plist_id, unsigned *max_compact /*o
H5_DLL herr_t H5Pset_est_link_info(hid_t plist_id, unsigned est_num_entries, unsigned est_name_len);
H5_DLL herr_t H5Pget_est_link_info(hid_t plist_id, unsigned *est_num_entries /* out */, unsigned *est_name_len /* out */);
+/* String creation property list (SCPL) routines */
H5_DLL herr_t H5Pset_char_encoding(hid_t plist_id, H5T_cset_t encoding);
H5_DLL herr_t H5Pget_char_encoding(hid_t plist_id, H5T_cset_t *encoding /*out*/);
#endif /* H5_GROUP_REVISION */
+/* Link access property list (LAPL) routines */
H5_DLL herr_t H5Pset_nlinks(hid_t plist_id, size_t nlinks);
H5_DLL herr_t H5Pget_nlinks(hid_t plist_id, size_t *nlinks);
H5_DLL herr_t H5Pset_elink_prefix(hid_t plist_id, const char *prefix);
H5_DLL herr_t H5Pget_elink_prefix(hid_t plist_id, char **prefix);
+/* Object copy property list (OCPL) routines */
H5_DLL herr_t H5Pset_copy_object(hid_t plist_id, unsigned crt_intmd);
H5_DLL herr_t H5Pget_copy_object(hid_t plist_id, unsigned *crt_intmd /*out*/);
#ifdef __cplusplus
}
#endif
-#endif
+#endif /* _H5Ppublic_H */
+