From 8ccb5c7b12eb7d54dfd8d2d70b64cd8f6a8cdc2b Mon Sep 17 00:00:00 2001 From: Philipp Schafft Date: Sat, 14 Sep 2019 12:32:03 +0000 Subject: [PATCH] Update: Pass instance to igloo_ro_clone_t, igloo_ro_convert_t, and igloo_ro_get_interface_t --- include/igloo/ro.h | 6 +++--- src/ro.c | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/igloo/ro.h b/include/igloo/ro.h index 7b4cea4..6d3302e 100644 --- a/include/igloo/ro.h +++ b/include/igloo/ro.h @@ -88,7 +88,7 @@ typedef unsigned long int igloo_ro_cf_t; * name, associated * See igloo_ro_new(). */ -typedef igloo_ro_t (*igloo_ro_clone_t)(igloo_ro_t self, igloo_ro_cf_t required, igloo_ro_cf_t allowed, const char *name, igloo_ro_t associated); +typedef igloo_ro_t (*igloo_ro_clone_t)(igloo_ro_t self, igloo_ro_cf_t required, igloo_ro_cf_t allowed, const char *name, igloo_ro_t associated, igloo_ro_t instance); /* Type used for callback called when the object needs to be converted to another type. * @@ -111,7 +111,7 @@ typedef igloo_ro_t (*igloo_ro_clone_t)(igloo_ro_t self, igloo_ro_cf_t required, * name, associated * See igloo_ro_new(). */ -typedef igloo_ro_t (*igloo_ro_convert_t)(igloo_ro_t self, const igloo_ro_type_t *type, igloo_ro_cf_t required, igloo_ro_cf_t allowed, const char *name, igloo_ro_t associated); +typedef igloo_ro_t (*igloo_ro_convert_t)(igloo_ro_t self, const igloo_ro_type_t *type, igloo_ro_cf_t required, igloo_ro_cf_t allowed, const char *name, igloo_ro_t associated, igloo_ro_t instance); /* Type used for callback called when a specific interface to the object is requested. * @@ -129,7 +129,7 @@ typedef igloo_ro_t (*igloo_ro_convert_t)(igloo_ro_t self, const igloo_ro_type_t * name, associated * See igloo_ro_new(). */ -typedef igloo_ro_t (*igloo_ro_get_interface_t)(igloo_ro_t self, const igloo_ro_type_t *type, const char *name, igloo_ro_t associated); +typedef igloo_ro_t (*igloo_ro_get_interface_t)(igloo_ro_t self, const igloo_ro_type_t *type, const char *name, igloo_ro_t associated, igloo_ro_t instance); /* Type used to store flags for stringify operation. */ diff --git a/src/ro.c b/src/ro.c index b524ed1..63d35c7 100644 --- a/src/ro.c +++ b/src/ro.c @@ -367,7 +367,7 @@ igloo_ro_t igloo_ro_clone(igloo_ro_t self, igloo_ro_cf_t required, igloo_ro } if (base->type->type_clonecb) - ret = base->type->type_clonecb(self, required, allowed, name, associated); + ret = base->type->type_clonecb(self, required, allowed, name, associated, base->instance); igloo_thread_mutex_unlock(&(base->lock)); return ret; @@ -398,11 +398,11 @@ igloo_ro_t igloo_ro_convert(igloo_ro_t self, const igloo_ro_type_t *type, i allowed = igloo_RO_CF_DEFAULT; if (base->type->type_convertcb) - ret = base->type->type_convertcb(self, type, required, allowed, name, associated); + ret = base->type->type_convertcb(self, type, required, allowed, name, associated, base->instance); if (igloo_RO_IS_NULL(ret)) if (type->type_convertcb) - ret = type->type_convertcb(self, type, required, allowed, name, associated); + ret = type->type_convertcb(self, type, required, allowed, name, associated, base->instance); igloo_thread_mutex_unlock(&(base->lock)); return ret; @@ -428,7 +428,7 @@ igloo_ro_t igloo_ro_get_interface_ext(igloo_ro_t self, const igloo_ro_type_t *ty igloo_thread_mutex_unlock(&(base->lock)); if (base->type->type_get_interfacecb) - ret = base->type->type_get_interfacecb(self, type, name, associated); + ret = base->type->type_get_interfacecb(self, type, name, associated, base->instance); igloo_thread_mutex_lock(&(base->lock)); /* remove temp reference