File: bshuf_exists.c

package info (click to toggle)
hdf5-filter-plugin 0.0~git20221111.49e3b65-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 3,848 kB
  • sloc: ansic: 14,374; sh: 11,445; cpp: 1,463; makefile: 100; python: 19; xml: 6
file content (37 lines) | stat: -rw-r--r-- 780 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
#include <hdf5.h>
#include <stdlib.h>


int main()
{
    H5open();
    hid_t plist = H5Pcreate(H5P_DATASET_CREATE);
    if(plist<0)
    {
        fprintf(stderr,"Could not create property list!\n");
        return 1;
    }
        
    unsigned int params[] = {0,3,1,0,2};
    if(H5Pset_filter(plist,(H5Z_filter_t)32008,H5Z_FLAG_MANDATORY,(size_t)5,params)<0)
    {
        fprintf(stderr,"Failed to load filter!\n");
        return 1;
    }

    htri_t error = H5Zfilter_avail((H5Z_filter_t)32008);

    if(error==0) 
    {
        fprintf(stderr,"Could not find bitshuffle filter!\n");
        return 1;
    }
    else if(error<0)
    {
        fprintf(stderr,"Filter search failed!");
        return 1;
    }

    fprintf(stderr,"Bitshuffle filter found!\n");
    return 0;
};