diff options
author | Pedro Vicente Nunes <pvn@hdfgroup.org> | 2003-10-22 21:55:07 (GMT) |
---|---|---|
committer | Pedro Vicente Nunes <pvn@hdfgroup.org> | 2003-10-22 21:55:07 (GMT) |
commit | 9ad2479dd4a207f0c1e8f66b1155a6d364f16c07 (patch) | |
tree | 70523a7af54fe82b10f5bed7ba7d421c4eebc96b /tools | |
parent | 04d8607a9a119bf7315907c45b2a0d66afb257d1 (diff) | |
download | hdf5-9ad2479dd4a207f0c1e8f66b1155a6d364f16c07.zip hdf5-9ad2479dd4a207f0c1e8f66b1155a6d364f16c07.tar.gz hdf5-9ad2479dd4a207f0c1e8f66b1155a6d364f16c07.tar.bz2 |
[svn-r7705] Purpose:
forgot to CVS add these new .h files to the h5repack bunch
Misc. update:
Diffstat (limited to 'tools')
-rw-r--r-- | tools/h5repack/h5repack.h | 116 | ||||
-rw-r--r-- | tools/h5repack/h5repack_list.h | 38 | ||||
-rw-r--r-- | tools/h5repack/h5repack_opttable.h | 48 | ||||
-rw-r--r-- | tools/h5repack/h5repack_parse.h | 45 | ||||
-rw-r--r-- | tools/h5repack/test_h5repack_add.h | 37 |
5 files changed, 284 insertions, 0 deletions
diff --git a/tools/h5repack/h5repack.h b/tools/h5repack/h5repack.h new file mode 100644 index 0000000..29b04ac --- /dev/null +++ b/tools/h5repack/h5repack.h @@ -0,0 +1,116 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by the Board of Trustees of the University of Illinois. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the files COPYING and Copyright.html. COPYING can be found at the root * + * of the source code distribution tree; Copyright.html can be found at the * + * root level of an installed copy of the electronic HDF5 document set and * + * is linked from the top-level documents page. It can also be found at * + * http://hdf.ncsa.uiuc.edu/HDF5/doc/Copyright.html. If you do not have * + * access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + + +#ifndef H5REPACK_H__ +#define H5REPACK_H__ + +#include "hdf5.h" + +#define PFORMAT "%-7s %-7s %-7s\n" /*chunk info, compression info, name*/ +#define PFORMAT1 "%-7s %-7s %-7s" /*chunk info, compression info, name*/ + +#define MAX_NC_NAME 256 /* max length of a name */ +#define MAX_VAR_DIMS 32 /* max per variable dimensions */ + + + + +/*------------------------------------------------------------------------- + * data structures for command line options + *------------------------------------------------------------------------- + */ + +/* a list of names */ +typedef struct { + char obj[MAX_NC_NAME]; +} obj_list_t; + +/* + the type of compression and additional parameter + type can be one of the filters + H5Z_FILTER_NONE 0, uncompress if compressed + H5Z_FILTER_DEFLATE 1 , deflation like gzip + H5Z_FILTER_SZIP 4 , szip compression +*/ +typedef struct { + int type; + int info; +} comp_info_t; + +/* chunk lengths along each dimension and rank */ +typedef struct { + hsize_t chunk_lengths[MAX_VAR_DIMS]; + int rank; +} chunk_info_t; + +/* information for one object, contains PATH, CHUNK info and COMP info */ +typedef struct { + char path[MAX_NC_NAME]; /* name of object */ + comp_info_t comp; /* compression information */ + chunk_info_t chunk; /* chunk information */ +} pack_info_t; + +/* store a list of all objects */ +typedef struct { + int size; + int nelems; + pack_info_t *objs; +} options_table_t; + + +/*------------------------------------------------------------------------- + * command line options + *------------------------------------------------------------------------- + */ + +/* all the above, ready to go to the hrepack call */ +typedef struct { + options_table_t *op_tbl; /*table with all -c and -t options */ + int all_chunk; /*chunk all objects, input of "*" */ + int all_comp; /*comp all objects, input of "*" */ + 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 */ + +} packoptions_t; + + + +/*------------------------------------------------------------------------- + * public functions + *------------------------------------------------------------------------- + */ + +#ifdef __cplusplus +extern "C" { +#endif + +int h5repack (char* infile, char* outfile, packoptions_t *options); +int h5repack_addcomp (char* str, packoptions_t *options); +int h5repack_addchunk(char* str, packoptions_t *options); +int h5repack_init (packoptions_t *options, int verbose); +int h5repack_end (packoptions_t *options); + + + +#ifdef __cplusplus +} +#endif + + + +#endif /* H5REPACK_H__ */ diff --git a/tools/h5repack/h5repack_list.h b/tools/h5repack/h5repack_list.h new file mode 100644 index 0000000..e11b7fe --- /dev/null +++ b/tools/h5repack/h5repack_list.h @@ -0,0 +1,38 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by the Board of Trustees of the University of Illinois. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the files COPYING and Copyright.html. COPYING can be found at the root * + * of the source code distribution tree; Copyright.html can be found at the * + * root level of an installed copy of the electronic HDF5 document set and * + * is linked from the top-level documents page. It can also be found at * + * http://hdf.ncsa.uiuc.edu/HDF5/doc/Copyright.html. If you do not have * + * access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + + + +#ifndef H5REPACK_LIST_H__ +#define H5REPACK_LIST_H__ + +#include "h5repack.h" + + +#ifdef __cplusplus +extern "C" { +#endif + + + +int get_objlist(char* infname, packoptions_t *options); + + + +#ifdef __cplusplus +} +#endif + + +#endif /* H5REPACK_LIST_H__ */ diff --git a/tools/h5repack/h5repack_opttable.h b/tools/h5repack/h5repack_opttable.h new file mode 100644 index 0000000..9122ea7 --- /dev/null +++ b/tools/h5repack/h5repack_opttable.h @@ -0,0 +1,48 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by the Board of Trustees of the University of Illinois. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the files COPYING and Copyright.html. COPYING can be found at the root * + * of the source code distribution tree; Copyright.html can be found at the * + * root level of an installed copy of the electronic HDF5 document set and * + * is linked from the top-level documents page. It can also be found at * + * http://hdf.ncsa.uiuc.edu/HDF5/doc/Copyright.html. If you do not have * + * access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + + +#ifndef H5REPACK_OPTTABLE_H__ +#define H5REPACK_OPTTABLE_H__ + + +#include "h5repack.h" + + +#ifdef __cplusplus +extern "C" { +#endif + + +int options_table_init( options_table_t **tbl ); +int options_table_free( options_table_t *table ); +int options_add_chunk ( obj_list_t *obj_list, + int n_objs, + hsize_t *chunk_lengths, + int chunk_rank, + options_table_t *table ); +int options_add_comp ( obj_list_t *obj_list, + int n_objs, + comp_info_t comp, + options_table_t *table ); +pack_info_t* options_get_object( char *path, + options_table_t *table); + + +#ifdef __cplusplus +} +#endif + + +#endif /* H5REPACK_OPTTABLE_H__ */ diff --git a/tools/h5repack/h5repack_parse.h b/tools/h5repack/h5repack_parse.h new file mode 100644 index 0000000..264b4b7 --- /dev/null +++ b/tools/h5repack/h5repack_parse.h @@ -0,0 +1,45 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by the Board of Trustees of the University of Illinois. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the files COPYING and Copyright.html. COPYING can be found at the root * + * of the source code distribution tree; Copyright.html can be found at the * + * root level of an installed copy of the electronic HDF5 document set and * + * is linked from the top-level documents page. It can also be found at * + * http://hdf.ncsa.uiuc.edu/HDF5/doc/Copyright.html. If you do not have * + * access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + + +#ifndef H5REPACK_PARSE_H__ +#define H5REPACK_PARSE_H__ + + +#include "h5repack.h" + + +#ifdef __cplusplus +extern "C" { +#endif + +int parse_number(char *str); + + +/* compression */ + +obj_list_t* parse_comp(char *str, int *n_objs, comp_info_t *comp); +char* get_scomp(int code); + +/* chunking */ + +obj_list_t* parse_chunk(char *str, int *n_objs, hsize_t *chunk_lengths, int *chunk_rank); + + +#ifdef __cplusplus +} +#endif + + +#endif /* H5REPACK_PARSE_H__ */ diff --git a/tools/h5repack/test_h5repack_add.h b/tools/h5repack/test_h5repack_add.h new file mode 100644 index 0000000..e1d31c3 --- /dev/null +++ b/tools/h5repack/test_h5repack_add.h @@ -0,0 +1,37 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by the Board of Trustees of the University of Illinois. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the files COPYING and Copyright.html. COPYING can be found at the root * + * of the source code distribution tree; Copyright.html can be found at the * + * root level of an installed copy of the electronic HDF5 document set and * + * is linked from the top-level documents page. It can also be found at * + * http://hdf.ncsa.uiuc.edu/HDF5/doc/Copyright.html. If you do not have * + * access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + + + +#ifndef H5REPACK_ADD_H__ +#define H5REPACK_ADD_H__ + + +#define FILENAME "h5repacktst.h5" +#define FILENAME_OUT "h5repacktstout.h5" + + +#ifdef __cplusplus +extern "C" { +#endif + +int make_dsets(); + + +#ifdef __cplusplus +} +#endif + + +#endif /* H5REPACK_ADD_H__ */ |