diff options
Diffstat (limited to 'tools/h5repack/h5repack.h')
-rw-r--r-- | tools/h5repack/h5repack.h | 108 |
1 files changed, 107 insertions, 1 deletions
diff --git a/tools/h5repack/h5repack.h b/tools/h5repack/h5repack.h index a1085da..bb0f8fc 100644 --- a/tools/h5repack/h5repack.h +++ b/tools/h5repack/h5repack.h @@ -17,6 +17,8 @@ #define H5REPACK_H__ #include "hdf5.h" +#include "h5trav.h" + #define PFORMAT "%-7s %-7s %-7s\n" /*chunk info, compression info, name*/ #define PFORMAT1 "%-7s %-7s %-7s" /*chunk info, compression info, name*/ @@ -85,7 +87,6 @@ typedef struct { comp_info_t comp_g; /*global compress INFO for the ALL case */ chunk_info_t chunk_g; /*global chunk INFO for the ALL case */ int verbose; /*verbose mode */ - int trip; /*which cycle are we in */ int threshold; /*minimum size to compress, in bytes */ } pack_opt_t; @@ -111,14 +112,119 @@ int h5repack_end (pack_opt_t *options); } #endif + + /*------------------------------------------------------------------------- * private functions *------------------------------------------------------------------------- */ +int check_objects(const char* fname, + pack_opt_t *options); + +int copy_file(const char* fnamein, + const char* fnameout, + pack_opt_t *options); + +void print_objlist(const char *filename, + int nobjects, + trav_info_t *info ); + +int do_copy_file(hid_t fidin, + hid_t fidout, + int nobjects, + trav_info_t *info, + pack_opt_t *options); + +int copy_attr(hid_t loc_in, + hid_t loc_out, + pack_opt_t *options + ); + + void read_info(const char *filename,pack_opt_t *options); +/*------------------------------------------------------------------------- + * options table + *------------------------------------------------------------------------- + */ + + +int options_table_init( pack_opttbl_t **tbl ); +int options_table_free( pack_opttbl_t *table ); +int options_add_chunk ( obj_list_t *obj_list, + int n_objs, + hsize_t *chunk_lengths, + int chunk_rank, + pack_opttbl_t *table ); +int options_add_comp ( obj_list_t *obj_list, + int n_objs, + comp_info_t comp, + pack_opttbl_t *table ); +pack_info_t* options_get_object( const char *path, + pack_opttbl_t *table); + + + + +/*------------------------------------------------------------------------- + * parse functions + *------------------------------------------------------------------------- + */ + +obj_list_t* parse_comp (const char *str, + int *n_objs, + comp_info_t *comp); +obj_list_t* parse_chunk (const char *str, + int *n_objs, + hsize_t *chunk_lengths, + int *chunk_rank); +const char* get_scomp (int code); +int parse_number(char *str); + +/*------------------------------------------------------------------------- + * tests + *------------------------------------------------------------------------- + */ + + +#define FNAME1 "testcopy.h5" +#define FNAME1OUT "testcopyout.h5" +#define FNAME2 "testfilters.h5" +#define FNAME2OUT "testfiltersout.h5" + + + +#define FNAME1 "testcopy.h5" +#define FNAME1OUT "testcopyout.h5" +#define FNAME2 "testfilters.h5" +#define FNAME2OUT "testfiltersout.h5" + + +int make_testfiles(void); + +int make_all_objects(hid_t fid); + +int make_attr(hid_t fid); + +int write_dset( hid_t loc_id, + int rank, + hsize_t *dims, + const char *dset_name, + hid_t type_id, + void *buf ); + +int write_attr(hid_t loc_id, + int rank, + hsize_t *dims, + const char *attr_name, + hid_t type_id, + void *buf); + + + + #endif /* H5REPACK_H__ */ |