File: hrepack.h

package info (click to toggle)
libhdf4 4.3.0-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 29,892 kB
  • sloc: ansic: 128,688; sh: 14,969; fortran: 12,444; java: 5,864; xml: 1,305; makefile: 900; yacc: 678; pascal: 418; perl: 360; javascript: 203; lex: 163; csh: 41
file content (89 lines) | stat: -rw-r--r-- 3,347 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 * Copyright by The HDF Group.                                               *
 * Copyright by the Board of Trustees of the University of Illinois.         *
 * All rights reserved.                                                      *
 *                                                                           *
 * This file is part of HDF.  The full HDF copyright notice, including       *
 * terms governing use, modification, and redistribution, is contained in    *
 * the COPYING file, which can be found at the root of the source code       *
 * distribution tree, or in https://support.hdfgroup.org/ftp/HDF/releases/.  *
 * If you do not have access to either file, you may request a copy from     *
 * help@hdfgroup.org.                                                        *
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

#ifndef HREPACK_H
#define HREPACK_H

#include "hrepack_lsttable.h"

#ifdef H4_HAVE_LIBSZ
#include "szlib.h"
#endif
#define NN_MODE       0
#define EC_MODE       1
#define TAG_GRP_IMAGE DFTAG_RIG
#define TAG_GRP_DSET  DFTAG_NDG

/* a list of names */
typedef struct {
    char obj[H4_MAX_NC_NAME];
} obj_list_t;

/* the type of compression and additional parameter */
typedef struct {
    comp_coder_t type;      /* compression enum type */
    int          info;      /* numerical parameter for several types of compression */
    int          szip_mode; /* NN_MODE or EC_MODE */
} comp_info_t;

/* chunk lengths along each dimension and rank */
typedef struct {
    int32 chunk_lengths[H4_MAX_VAR_DIMS];
    int   rank;
} chunk_info_t;

/* information for one object, contains PATH, CHUNK info and COMP info */
typedef struct {
    char         objpath[H4_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;

/* 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 */
} options_t;

#ifdef __cplusplus
extern "C" {
#endif

int  hrepack(const char *infname, const char *outfname, options_t *options);
int  hrepack_addcomp(const char *str, options_t *options);
int  hrepack_addchunk(const char *str, options_t *options);
void hrepack_init(options_t *options, int verbose);
void hrepack_end(options_t *options);
int  hrepack_main(const char *infile, const char *outfile, options_t *options);

int list(const char *infname, const char *outfname, options_t *options);
int read_info(const char *filename, options_t *options);

#ifdef __cplusplus
}
#endif

#endif /* HREPACK_H */