From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============4836211208785507410==" MIME-Version: 1.0 From: =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis Subject: [RFC v6 06/12] emulator: Add set/get data APIs Date: Wed, 01 Aug 2012 12:09:41 +0200 Message-ID: <1343815787-22670-7-git-send-email-frederic.danis@linux.intel.com> In-Reply-To: <1343815787-22670-1-git-send-email-frederic.danis@linux.intel.com> List-Id: To: ofono@ofono.org --===============4836211208785507410== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable --- src/emulator.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/emulator.c b/src/emulator.c index c3165eb..14a39f3 100644 --- a/src/emulator.c +++ b/src/emulator.c @@ -52,6 +52,8 @@ struct ofono_emulator { gboolean clip; gboolean ccwa; int pns_id; + void *data; + ofono_destroy_func destroy; }; = struct indicator { @@ -951,6 +953,9 @@ static void emulator_remove(struct ofono_atom *atom) = DBG("atom: %p", atom); = + if (em->destroy) + em->destroy(em->data); + g_free(em); } = @@ -994,6 +999,18 @@ void ofono_emulator_remove(struct ofono_emulator *em) __ofono_atom_free(em->atom); } = +void ofono_emulator_set_data(struct ofono_emulator *em, void *data, + ofono_destroy_func destroy) +{ + em->data =3D data; + em->destroy =3D destroy; +} + +void *ofono_emulator_get_data(struct ofono_emulator *em) +{ + return em->data; +} + void ofono_emulator_send_final(struct ofono_emulator *em, const struct ofono_error *final) { -- = 1.7.9.5 --===============4836211208785507410==--