GsfBlob 3 GSF Library GsfBlobA generic, unstructured block of binary data Synopsis GsfBlob; GsfBlobClass; GsfBlob* gsf_blob_new (gsize size, gconstpointer data_to_copy, GError **error); gsize gsf_blob_get_size (GsfBlob *blob); gconstpointer gsf_blob_peek_data (GsfBlob *blob); Description Some libgsf functions, in particular the metadata functions, can generate unstructured blocks of data, or blobs. Libgsf represents these blobs using a GsfBlob object. Details <anchor id="GsfBlob"/>GsfBlob GsfBlobtypedef struct { GObject object; GsfBlobPrivate *priv; } GsfBlob; Represents an unstructured block of binary data, that is, a sequence of bytes and an integer specifying the size of the sequence. <anchor id="GsfBlobClass"/>GsfBlobClass GsfBlobClasstypedef struct { GObjectClass parent_class; } GsfBlobClass; <anchor id="gsf-blob-new"/>gsf_blob_new () gsf_blob_newGsfBlob* gsf_blob_new (gsize size, gconstpointer data_to_copy, GError **error); Creates a new GsfBlob object to hold the specified data. The blob can then be used as a facility for reference-counting for the data. The data is copied internally, so the blob does not hold references to external chunks of memory. size : Size of the data in bytes. data_to_copy : Data which will be copied into the blob, or NULL if size is zero. error : location to store error, or NULL. Returns : A newly-created GsfBlob, or NULL if the data could not be copied. Error domain: GSF_ERROR Possible errors: GSF_ERROR_OUT_OF_MEMORY if the data_to_copy could not be copied. <anchor id="gsf-blob-get-size"/>gsf_blob_get_size () gsf_blob_get_sizegsize gsf_blob_get_size (GsfBlob *blob); Queries the size in bytes of the data stored in the blob. blob : A GsfBlob. Returns : Size in bytes, or 0 if the data is NULL. <anchor id="gsf-blob-peek-data"/>gsf_blob_peek_data () gsf_blob_peek_datagconstpointer gsf_blob_peek_data (GsfBlob *blob); Queries a pointer to the data stored in the blob. This does not copy the data for you; it returns a pointer to the actual buffer which the blob uses internally, so you should not free this buffer on your own. blob : A GsfBlob. Returns : Pointer to the data stored in the blob, or NULL if the size of the data is zero. See Also GsfClipData, GsfMetadata