Bind a blob to memory¶
ss_blob_bind_m is a function defined in ssblob.c.
Synopsis:
-
herr_t
ss_blob_bind_m(ss_blob_t *blob, void *mem, hid_t mtype, hid_t mspace)¶
Formal Arguments:
blob: The blob to which memory is associatedmem: The memory to which the blob will now pointmtype: 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.mspace: The extent of memory and a selection of elements in that memory. This data space will be copied into the blob, so the caller should close its handle.
Description: This function binds a blob to a memory buffer that will be used for I/O. This is used when data is output
from memory to the file and mtype and mspace describe the elements of memory to be written to the file. The
memory is not copied by this function and so must not be freed by the caller until it is unbound from the
blob.
A blob can be disassociated from memory by supplying a null pointer for the mem argument, in which case the
following arguments are ignored. It is the caller’s responsibility to deallocate any memory if appropriate.
The memory can also be disassociated automatically after an ss_blob_read, ss_blob_read1, ss_blob_write,
or ss_blob_write1 call if the SS_BLOB_UNBIND bit is passed in the flags argument to those functions.
Return Value: Returns non-negative on success; negative on failure.
Parallel Notes: Independent
See Also:
- ss_blob_read: 15.14: Read data from a file
- ss_blob_read1: 15.15: Read data from a file
- ss_blob_write: 15.16: Write data to a blob
- ss_blob_write1: 15.17: Write data to a blob
- I/O: Introduction for current chapter