summaryrefslogtreecommitdiffstats
path: root/tools/lib/h5tools.h
diff options
context:
space:
mode:
Diffstat (limited to 'tools/lib/h5tools.h')
-rw-r--r--tools/lib/h5tools.h187
1 files changed, 27 insertions, 160 deletions
diff --git a/tools/lib/h5tools.h b/tools/lib/h5tools.h
index 01bcca7..3400008 100644
--- a/tools/lib/h5tools.h
+++ b/tools/lib/h5tools.h
@@ -32,7 +32,7 @@
/*
* Information about how to format output.
*/
-typedef struct h5dump_t {
+typedef struct h5tool_format_t {
/*
* Fields associated with formatting numeric data. If a datatype matches
* multiple formats based on its size, then the first applicable format
@@ -321,102 +321,27 @@ typedef struct h5dump_t {
/*escape non printable characters */
int do_escape;
-} h5dump_t;
-
-typedef struct dump_header{
- const char *name;
- const char *filebegin;
- const char *fileend;
- const char *bootblockbegin;
- const char *bootblockend;
- const char *groupbegin;
- const char *groupend;
- const char *datasetbegin;
- const char *datasetend;
- const char *attributebegin;
- const char *attributeend;
- const char *datatypebegin;
- const char *datatypeend;
- const char *dataspacebegin;
- const char *dataspaceend;
- const char *databegin;
- const char *dataend;
- const char *softlinkbegin;
- const char *softlinkend;
- const char *subsettingbegin;
- const char *subsettingend;
- const char *startbegin;
- const char *startend;
- const char *stridebegin;
- const char *strideend;
- const char *countbegin;
- const char *countend;
- const char *blockbegin;
- const char *blockend;
-
- const char *fileblockbegin;
- const char *fileblockend;
- const char *bootblockblockbegin;
- const char *bootblockblockend;
- const char *groupblockbegin;
- const char *groupblockend;
- const char *datasetblockbegin;
- const char *datasetblockend;
- const char *attributeblockbegin;
- const char *attributeblockend;
- const char *datatypeblockbegin;
- const char *datatypeblockend;
- const char *dataspaceblockbegin;
- const char *dataspaceblockend;
- const char *datablockbegin;
- const char *datablockend;
- const char *softlinkblockbegin;
- const char *softlinkblockend;
- const char *strblockbegin;
- const char *strblockend;
- const char *enumblockbegin;
- const char *enumblockend;
- const char *structblockbegin;
- const char *structblockend;
- const char *vlenblockbegin;
- const char *vlenblockend;
- const char *subsettingblockbegin;
- const char *subsettingblockend;
- const char *startblockbegin;
- const char *startblockend;
- const char *strideblockbegin;
- const char *strideblockend;
- const char *countblockbegin;
- const char *countblockend;
- const char *blockblockbegin;
- const char *blockblockend;
-
- const char *dataspacedescriptionbegin;
- const char *dataspacedescriptionend;
- const char *dataspacedimbegin;
- const char *dataspacedimend;
-
-} dump_header;
+} h5tool_format_t;
typedef struct h5tools_context_t {
- size_t cur_column; /*current column for output */
- size_t cur_elmt; /*current element/output line */
- int need_prefix; /*is line prefix needed? */
- int ndims; /*dimensionality */
- hsize_t p_min_idx[H5S_MAX_RANK]; /*min selected index */
- hsize_t p_max_idx[H5S_MAX_RANK]; /*max selected index */
- int prev_multiline; /*was prev datum multiline? */
- size_t prev_prefix_len;/*length of previous prefix */
- int continuation; /*continuation of previous data?*/
- hsize_t size_last_dim; /*the size of the last dimension,
- *needed so we can break after each
- *row */
- int indent_level; /*the number of times we need some
- *extra indentation */
- int default_indent_level; /*this is used when the indent level gets changed */
- hsize_t acc[H5S_MAX_RANK]; /* accumulator position */
- hsize_t pos[H5S_MAX_RANK]; /* matrix position */
- hsize_t sm_pos; /* current stripmine element position */
+ size_t cur_column; /*current column for output */
+ size_t cur_elmt; /*current element/output line */
+ int need_prefix; /*is line prefix needed? */
+ int ndims; /*dimensionality */
+ hsize_t p_min_idx[H5S_MAX_RANK]; /*min selected index */
+ hsize_t p_max_idx[H5S_MAX_RANK]; /*max selected index */
+ int prev_multiline; /*was prev datum multiline? */
+ size_t prev_prefix_len; /*length of previous prefix */
+ int continuation; /*continuation of previous data?*/
+ hsize_t size_last_dim; /*the size of the last dimension,
+ *needed so we can break after each
+ *row */
+ int indent_level; /*the number of times we need some
+ *extra indentation */
+ int default_indent_level; /*this is used when the indent level gets changed */
+ hsize_t acc[H5S_MAX_RANK]; /* accumulator position */
+ hsize_t pos[H5S_MAX_RANK]; /* matrix position */
+ hsize_t sm_pos; /* current stripmine element position */
} h5tools_context_t;
/* a structure to hold the subsetting particulars for a dataset */
@@ -427,70 +352,12 @@ struct subset_t {
hsize_t *block;
};
-/*if we get a new program that needs to use the library add its name here*/
-typedef enum {
- UNKNOWN = 0,
- H5LS,
- H5DUMP
-} ProgType;
-
-/* taken from h5dump.h */
-#define ATTRIBUTE_DATA 0
-#define DATASET_DATA 1
-#define ENUM_DATA 2
-
-#define COL 3
-
-extern int indent; /*how far in to indent the line */
extern FILE *rawdatastream; /*output stream for raw data */
-/* taken from h5dump.h*/
-#define ATTRIBUTE "ATTRIBUTE"
-#define BLOCK "BLOCK"
-#define SUPER_BLOCK "SUPER_BLOCK"
-#define COMPRESSION "COMPRESSION"
-#define CONCATENATOR "//"
-#define COMPLEX "COMPLEX"
-#define COUNT "COUNT"
-#define CSET "CSET"
-#define CTYPE "CTYPE"
-#define DATA "DATA"
+/* Strings for output */
+#define GROUP "GROUP"
#define DATASET "DATASET"
-#define DATASPACE "DATASPACE"
#define DATATYPE "DATATYPE"
-#define EXTERNAL "EXTERNAL"
-#define FILENO "FILENO"
-#define GROUPNAME "GROUP"
-#define HARDLINK "HARDLINK"
-#define NLINK "NLINK"
-#define OBJID "OBJECTID"
-#define OBJNO "OBJNO"
-#define S_SCALAR "SCALAR"
-#define S_SIMPLE "SIMPLE"
-#define SOFTLINK "SOFTLINK"
-#define STORAGELAYOUT "STORAGELAYOUT"
-#define START "START"
-#define STRIDE "STRIDE"
-#define STRSIZE "STRSIZE"
-#define STRPAD "STRPAD"
-#define SUBSET "SUBSET"
-#define FILTERS "FILTERS"
-#define DEFLATE "COMPRESSION DEFLATE"
-#define DEFLATE_LEVEL "LEVEL"
-#define SHUFFLE "PREPROCESSING SHUFFLE"
-#define FLETCHER32 "CHECKSUM FLETCHER32"
-#define SZIP "COMPRESSION SZIP"
-#define STORAGE_LAYOUT "STORAGE_LAYOUT"
-#define CONTIGUOUS "CONTIGUOUS"
-#define COMPACT "COMPACT"
-#define CHUNKED "CHUNKED"
-#define EXTERNAL_FILE "EXTERNAL_FILE"
-#define FILLVALUE "FILLVALUE"
-#define FILE_CONTENTS "FILE_CONTENTS"
-
-
-#define BEGIN "{"
-#define END "}"
/* Definitions of useful routines */
extern void h5tools_init(void);
@@ -498,13 +365,13 @@ extern void h5tools_close(void);
extern hid_t h5tools_fopen(const char *fname, const char *driver,
char *drivername, size_t drivername_len,
int argc, const char *argv[]);
-extern int h5tools_dump_dset(FILE *stream, const h5dump_t *info, hid_t dset,
+extern int h5tools_dump_dset(FILE *stream, const h5tool_format_t *info, hid_t dset,
hid_t p_typ, struct subset_t *sset, int indentlevel);
-extern int h5tools_dump_mem(FILE *stream, const h5dump_t *info, hid_t obj_id,
+extern int h5tools_dump_mem(FILE *stream, const h5tool_format_t *info, hid_t obj_id,
hid_t type, hid_t space, void *mem, int indentlevel);
extern hid_t h5tools_get_native_type(hid_t type);
-extern void h5tools_dump_simple_data(FILE *stream, const h5dump_t *info, hid_t container,
+extern void h5tools_dump_simple_data(FILE *stream, const h5tool_format_t *info, hid_t container,
h5tools_context_t *ctx/*in,out*/, unsigned flags,
hsize_t nelmts, hid_t type, void *_mem);
@@ -512,7 +379,7 @@ extern int h5tools_canreadf(const char* name,
hid_t dcpl_id);
extern int h5tools_can_encode(H5Z_filter_t filtn);
-void init_acc_pos(h5tools_context_t *ctx, hsize_t *dims);
-
+void init_acc_pos(h5tools_context_t *ctx, hsize_t *dims);
#endif /* H5TOOLS_H__ */
+