From 47a2d6953a832792b9807745657903a888c31978 Mon Sep 17 00:00:00 2001 From: aeb Date: Wed, 5 Apr 2000 22:41:31 +0000 Subject: [PATCH] Add userdata functions. git-svn-id: svn://svn.linux1394.org/libraw1394/trunk@22 53a565d1-3bb7-0310-b661-cf11e63c67ab --- src/main.c | 9 +++++++++ src/raw1394.h | 7 +++++++ src/raw1394_private.h | 2 ++ 3 files changed, 18 insertions(+) diff --git a/src/main.c b/src/main.c index f7d9439..16e08f1 100644 --- a/src/main.c +++ b/src/main.c @@ -114,6 +114,15 @@ nodeid_t raw1394_get_local_id(struct raw1394_handle *handle) return handle->local_id; } +void *raw1394_get_userdata(struct raw1394_handle *handle) +{ + return handle->userdata; +} + +void raw1394_set_userdata(struct raw1394_handle *handle, void *data) +{ + handle->userdata = data; +} int raw1394_get_port_info(struct raw1394_handle *handle, struct raw1394_portinfo *pinf, int maxports) diff --git a/src/raw1394.h b/src/raw1394.h index 88c50f5..1c17172 100644 --- a/src/raw1394.h +++ b/src/raw1394.h @@ -31,6 +31,13 @@ void raw1394_destroy_handle(raw1394handle_t handle); */ int raw1394_get_fd(raw1394handle_t handle); +/* + * Set and get user data. This isn't used inside libraw1394, you can use it for + * your own purposes. + */ +void *raw1394_get_userdata(raw1394handle_t handle); +void raw1394_set_userdata(raw1394handle_t handle, void *data); + unsigned int raw1394_get_generation(raw1394handle_t handle); nodeid_t raw1394_get_local_id(raw1394handle_t handle); diff --git a/src/raw1394_private.h b/src/raw1394_private.h index e8440b8..fed60c9 100644 --- a/src/raw1394_private.h +++ b/src/raw1394_private.h @@ -16,6 +16,8 @@ struct raw1394_handle { struct raw1394_request req; quadlet_t buffer[2048]; + + void *userdata; }; struct sync_cb_data {