File: nc_provenance.h

package info (click to toggle)
netcdf-parallel 1%3A4.7.4-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 105,352 kB
  • sloc: ansic: 229,114; sh: 11,180; yacc: 2,561; makefile: 1,390; lex: 1,173; xml: 173; awk: 2
file content (82 lines) | stat: -rw-r--r-- 2,566 bytes parent folder | download | duplicates (3)
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
/* Copyright 2018-2018 University Corporation for Atmospheric
   Research/Unidata. */
/**
 * @file
 * @internal Contains information for creating provenance
 * info and/or displaying provenance info.
 *
 * It has come to pass that we can't guarantee that this information is
 * contained only within netcdf4 files.  As a result, we need
 * to make printing these hidden attributes available to
 * netcdf3 as well.
 *
 *
 * For netcdf4 files, capture state information about the following:
 * - Global: netcdf library version
 * - Global: hdf5 library version
 * - Global: any parameters specified by the --with-ncproperties option for ./configure
 * - Per file: superblock version
 * - Per File: was it created by netcdf-4?
 * - Per file: _NCProperties attribute
 *
 * @author Dennis Heimbigner, Ward Fisher
*/

#ifndef _NCPROVENANCE_
#define _NCPROVENANCE_

#define NCPROPS "_NCProperties"
#define NCPVERSION "version" /* Of the properties format */
#define NCPHDF5LIB1 "hdf5libversion"
#define NCPNCLIB1 "netcdflibversion"
#define NCPHDF5LIB2 "hdf5"
#define NCPNCLIB2 "netcdf"
#define NCPROPS_VERSION (2)
/* Version 2 changes this because '|' was causing bash problems */
#define NCPROPSSEP1  '|'
#define NCPROPSSEP2  ','

/* Other hidden attributes */
#define ISNETCDF4ATT "_IsNetcdf4"
#define SUPERBLOCKATT "_SuperblockVersion"

/* Forward */
struct NC_FILE_INFO;

/**************************************************/
/**
   For netcdf4 files, capture state information about the following:
   1. Global: netcdf library version
   2. Global: hdf5 library version
   3. Per file: superblock version
   4. Per File: was it created by netcdf-4?
   5. Per file: _NCProperties attribute
*/

typedef struct NC4_Provenance {
    char* ncproperties; /* raw value of _NCProperties; NULL => does not exist */
    int version; 
    int superblockversion;
} NC4_Provenance;

/* Provenance Management (moved from nc4internal.h) */

/* Initialize the provenance global state */
extern int NC4_provenance_init(void);

/* Finalize the provenance global state */
extern int NC4_provenance_finalize(void);

/* Read and store the provenance from an existing file */
extern int NC4_read_provenance(struct NC_FILE_INFO* file);

/* Write the provenance into a newly created file */
extern int NC4_write_provenance(struct NC_FILE_INFO* file);

/* Create the provenance for a newly created file */
extern int NC4_new_provenance(struct NC_FILE_INFO* file);

/* Clean up the provenance info in a file */
extern int NC4_clear_provenance(NC4_Provenance* prov);

#endif /* _NCPROVENANCE_ */