summaryrefslogtreecommitdiff
path: root/usbredirhost/usbredirhost.h
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2011-12-17 15:26:05 +0100
committerHans de Goede <hdegoede@redhat.com>2011-12-19 11:59:07 +0100
commitdb603a6909ce3523a620d4c85e6e335b5f0670d6 (patch)
tree5147c08b60480c5d272c8e48b7255dbf4310827a /usbredirhost/usbredirhost.h
parente0c86c0c3b5ad0fa0e20c603360df0e458f0d622 (diff)
Allow specifying locking functions for multi-threading on open / create
Having separate set_locking_funcs functions causes the locking functions to be available potentially too late. And it just is not very pretty. This commit changes the API (in a way which is backward compat with 0.3.1), so that locking functions can be specified at creation time, just like all the other callbacks. This commit also bumps the reported version to 0.3.2, so that apps using libusbredirhost can check for this version to check the presence of the new usbredirhost_open_full function. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'usbredirhost/usbredirhost.h')
-rw-r--r--usbredirhost/usbredirhost.h24
1 files changed, 14 insertions, 10 deletions
diff --git a/usbredirhost/usbredirhost.h b/usbredirhost/usbredirhost.h
index 2ad2ea1..eaf840e 100644
--- a/usbredirhost/usbredirhost.h
+++ b/usbredirhost/usbredirhost.h
@@ -68,6 +68,20 @@ struct usbredirhost *usbredirhost_open(
usbredirparser_write write_guest_data_func,
void *func_priv, const char *version, int verbose, int flags);
+/* See README.multi-thread */
+struct usbredirhost *usbredirhost_open_full(
+ libusb_context *usb_ctx,
+ libusb_device_handle *usb_dev_handle,
+ usbredirparser_log log_func,
+ usbredirparser_read read_guest_data_func,
+ usbredirparser_write write_guest_data_func,
+ usbredirhost_flush_writes flush_writes_func,
+ usbredirparser_alloc_lock alloc_lock_func,
+ usbredirparser_lock lock_func,
+ usbredirparser_unlock unlock_func,
+ usbredirparser_free_lock free_lock_func,
+ void *func_priv, const char *version, int verbose, int flags);
+
/* Close the usbredirhost, returning control of the device back to any
host kernel drivers for it, freeing any allocated memory, etc.
@@ -77,16 +91,6 @@ struct usbredirhost *usbredirhost_open(
callbacks may get called! */
void usbredirhost_close(struct usbredirhost *host);
-/* See README.multi-thread */
-int usbredirhost_set_locking_funcs(struct usbredirhost *host,
- usbredirparser_alloc_lock alloc_lock_func,
- usbredirparser_lock lock_func,
- usbredirparser_unlock unlock_func,
- usbredirparser_free_lock free_lock_func);
-
-void usbredirhost_set_flush_writes_callback(struct usbredirhost *host,
- usbredirhost_flush_writes flush_writes_func);
-
/* Call this whenever there is data ready for the usbredirhost to read from
the usb-guest
returns 0 on success, -1 if a read error happened, -2 if a parse error