1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
 herr_t
 ss_blob_bind_m1(ss_blob_t *blob,                /* The blob to which memory is associated. */
                 void *mem,                      /* The memory to be associated with the blob. */
                 hid_t mtype,                    /* The datatype of each element of the memory. This datatype will be copied
                                                  * into the blob so the caller is free to close the handle at any time. */
                 hsize_t nelmts                  /* Number of elements pointed to by MEM. */
                 )
 {
     SS_ENTER(ss_blob_bind_m1, herr_t);
     hid_t       mspace=-1;

     /* We have to use unlimited dimensions here because nelmts might be zero and HDF5 won't allow that */
     if (mem && (mspace=H5Screate_simple(1, &nelmts, ss_blob_unlim_g))<0) SS_ERROR(HDF5);
     if (ss_blob_bind_m(blob, mem, mtype, mspace)<0) SS_ERROR(FAILED);
     if (mem && H5Sclose(mspace)<0) SS_ERROR(HDF5);
     mspace = -1;

  SS_CLEANUP:
     if (mspace>0) H5Sclose(mspace);
     SS_LEAVE(0);
 }