From 54c06f8d1ef4daba55403d20b64b370885a0fb4d Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 22 Oct 2020 14:05:09 +1000 Subject: [PATCH] libeis: add eis_client_get/set_user_data Signed-off-by: Peter Hutterer --- src/libeis-client.c | 4 ++++ src/libeis-private.h | 1 + src/libeis.h | 6 ++++++ 3 files changed, 11 insertions(+) diff --git a/src/libeis-client.c b/src/libeis-client.c index 2c5b305..3bce045 100644 --- a/src/libeis-client.c +++ b/src/libeis-client.c @@ -62,6 +62,10 @@ OBJECT_IMPLEMENT_UNREF(eis_client); _public_ OBJECT_IMPLEMENT_GETTER(eis_client, name, const char*); +_public_ +OBJECT_IMPLEMENT_SETTER(eis_client, user_data, void*); +_public_ +OBJECT_IMPLEMENT_GETTER(eis_client, user_data, void*); _public_ struct eis* eis_client_get_context(struct eis_client *client) diff --git a/src/libeis-private.h b/src/libeis-private.h index d7f52e5..f30f351 100644 --- a/src/libeis-private.h +++ b/src/libeis-private.h @@ -61,6 +61,7 @@ enum eis_client_state { struct eis_client { struct object object; + void *user_data; struct list link; struct source *source; uint32_t id; diff --git a/src/libeis.h b/src/libeis.h index 475147a..00d14a4 100644 --- a/src/libeis.h +++ b/src/libeis.h @@ -248,6 +248,12 @@ eis_client_ref(struct eis_client *client); struct eis_client * eis_client_unref(struct eis_client *client); +void * +eis_client_get_user_data(struct eis_client *eis_client); + +void +eis_client_set_user_data(struct eis_client *eis_client, void *user_data); + /** * Return the name set by this client. The server is under no obligation to * use this name.