aboutsummaryrefslogtreecommitdiffstats
path: root/meson/test cases/frameworks/25 hdf5/main.c
blob: 4c46310e121e9f7634471ac5930edabd4d4ca5b2 (plain)
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
#include <stdio.h>
#include <stdlib.h>

#include "hdf5.h"

int main(void)
{
herr_t ier;
unsigned maj, min, rel;

ier = H5open();
if (ier) {
    fprintf(stderr,"Unable to initialize HDF5: %d\n", ier);
    return EXIT_FAILURE;
}

ier = H5get_libversion(&maj, &min, &rel);
if (ier) {
    fprintf(stderr,"HDF5 did not initialize!\n");
    return EXIT_FAILURE;
}
printf("C HDF5 version %d.%d.%d\n", maj, min, rel);

ier = H5close();
if (ier) {
    fprintf(stderr,"Unable to close HDF5: %d\n", ier);
    return EXIT_FAILURE;
}
return EXIT_SUCCESS;
}