StudyGlib/app/src/main/cpp/study/type.c
/* vips_blob_set:
 * @blob: #VipsBlob to set
 * @free_fn: (scope async) (allow-none): @data will be freed with this function
 * @data: (array length=length) (element-type guint8) (transfer full): data to store
 * @length: number of bytes in @data
 *
 * Any old data is freed and new data attached.
 *
 * It's sometimes useful to be able to create blobs as empty and then fill
 * them later.
 *
 * See also: vips_blob_new().
 */


Any old data is freed and new data attached.

It's sometimes useful to be able to create blobs as empty and then fill
them later.


Any old data is freed and new data attached . It ' s sometimes useful to be able to create blobs as empty and then fill them later .
void
vips_blob_set( VipsBlob *blob,
               VipsCallbackFn free_fn, const void *data, size_t length )
{
    VipsArea *area = VIPS_AREA( blob );
    g_mutex_lock( area->lock );
    vips_area_free( area );
    area->free_fn = free_fn;
    area->length = length;
    area->data = (void *) data;
    g_mutex_unlock( area->lock );
}
void vips_blob_set ( VipsBlob * blob , VipsCallbackFn free_fn , const void * data , size_t length ) { VipsArea * area = VIPS_AREA ( blob ) ; g_mutex_lock ( area -> lock ) ; vips_area_free ( area ) ; area -> free_fn = free_fn ; area -> length = length ; area -> data = ( void * ) data ; g_mutex_unlock ( area -> lock ) ; }
vips_blob_set:
 @blob: #VipsBlob to set
 @free_fn: (scope async) (allow-none): @data will be freed with this function
 @data: (array length=length) (element-type guint8) (transfer full): data to store
 @length: number of bytes in @data
vips_blob_set : @blob : #VipsBlob to set @free_fn : ( scope async ) ( allow - none ) : @data will be freed with this function @data : ( array length = length ) ( element - type guint8 ) ( transfer full ) : data to store @length : number of bytes in @data