[API] blob: move user_data before destroy()
This is the common convention for language binding tools.
diff --git a/src/hb-blob.c b/src/hb-blob.c
index 37e7787..97ffd99 100644
--- a/src/hb-blob.c
+++ b/src/hb-blob.c
@@ -57,8 +57,8 @@
NULL, /* data */
- NULL, /* destroy */
- NULL /* user_data */
+ NULL, /* user_data */
+ NULL /* destroy */
};
static void
@@ -66,8 +66,8 @@
{
if (blob->destroy) {
blob->destroy (blob->user_data);
- blob->destroy = NULL;
blob->user_data = NULL;
+ blob->destroy = NULL;
}
}
@@ -82,8 +82,8 @@
hb_blob_create (const char *data,
unsigned int length,
hb_memory_mode_t mode,
- hb_destroy_func_t destroy,
- void *user_data)
+ void *user_data,
+ hb_destroy_func_t destroy)
{
hb_blob_t *blob;
@@ -100,8 +100,8 @@
blob->length = length;
blob->mode = mode;
- blob->destroy = destroy;
blob->user_data = user_data;
+ blob->destroy = destroy;
if (blob->mode == HB_MEMORY_MODE_DUPLICATE) {
blob->mode = HB_MEMORY_MODE_READONLY;
@@ -134,8 +134,8 @@
blob->mode = parent->mode;
hb_mutex_unlock (parent->lock);
- blob->destroy = (hb_destroy_func_t) _hb_blob_unlock_and_destroy;
blob->user_data = hb_blob_reference (parent);
+ blob->destroy = (hb_destroy_func_t) _hb_blob_unlock_and_destroy;
return blob;
}
@@ -345,8 +345,8 @@
_hb_blob_destroy_user_data (blob);
blob->mode = HB_MEMORY_MODE_WRITABLE;
blob->data = new_data;
- blob->destroy = free;
blob->user_data = new_data;
+ blob->destroy = free;
}
}