summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Drake <dsd@gentoo.org>2008-03-10 11:29:24 +0000
committerDaniel Drake <dsd@gentoo.org>2008-03-10 11:29:24 +0000
commit7c5ea95297c2f3f6afc42f60c1bf1bef777bb1fb (patch)
tree0efd99536bc4b2ee606a096438c51df2f631e8a1
parent9e89d1aa82cbe7e21672ee3e2e545238fffc5318 (diff)
downloadlibusb-7c5ea95297c2f3f6afc42f60c1bf1bef777bb1fb.tar.gz
get_device fixup
Rename API away from "devh" and fix implementation to match header
-rw-r--r--examples/dpfp.c3
-rw-r--r--libusb/core.c16
-rw-r--r--libusb/libusb.h4
3 files changed, 12 insertions, 11 deletions
diff --git a/examples/dpfp.c b/examples/dpfp.c
index 6006bf5..a5151f2 100644
--- a/examples/dpfp.c
+++ b/examples/dpfp.c
@@ -158,7 +158,8 @@ static void cb_mode_changed(struct libusb_transfer *transfer)
do_exit = 2;
}
- printf("async cb_mode_changed\n");
+ printf("async cb_mode_changed length=%d actual_length=%d\n",
+ transfer->length, transfer->actual_length);
if (next_state() < 0)
do_exit = 2;
free(transfer->buffer);
diff --git a/libusb/core.c b/libusb/core.c
index 98c6be3..8d7abcf 100644
--- a/libusb/core.c
+++ b/libusb/core.c
@@ -528,21 +528,21 @@ static void do_close(struct libusb_device_handle *devh)
libusb_device_unref(devh->dev);
}
-API_EXPORTED void libusb_close(struct libusb_device_handle *devh)
+API_EXPORTED void libusb_close(struct libusb_device_handle *dev_handle)
{
- if (!devh)
+ if (!dev_handle)
return;
usbi_dbg("");
- list_del(&devh->list);
- do_close(devh);
- free(devh);
+ list_del(&dev_handle->list);
+ do_close(dev_handle);
+ free(dev_handle);
}
-API_EXPORTED struct libusb_device *libusb_devh_get_dev(
- struct libusb_device_handle *devh)
+API_EXPORTED struct libusb_device *libusb_get_device(
+ struct libusb_device_handle *dev_handle)
{
- return devh->dev;
+ return dev_handle->dev;
}
API_EXPORTED int libusb_claim_interface(struct libusb_device_handle *dev,
diff --git a/libusb/libusb.h b/libusb/libusb.h
index e9abd54..3413301 100644
--- a/libusb/libusb.h
+++ b/libusb/libusb.h
@@ -225,8 +225,8 @@ libusb_device *libusb_device_ref(libusb_device *dev);
void libusb_device_unref(libusb_device *dev);
libusb_device_handle *libusb_open(libusb_device *dev);
-void libusb_close(libusb_device_handle *devh);
-libusb_device *libusb_devh_get_device(libusb_device_handle *devh);
+void libusb_close(libusb_device_handle *dev_handle);
+libusb_device *libusb_get_device(libusb_device_handle *dev_handle);
int libusb_claim_interface(libusb_device_handle *dev, int iface);
int libusb_release_interface(libusb_device_handle *dev, int iface);