summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorNikolai Kondrashov <spbnick@gmail.com>2010-08-19 20:46:30 +0400
committerNikolai Kondrashov <spbnick@gmail.com>2010-08-19 20:51:34 +0400
commit490ac2a5fc080ecc6daeef60117e65143013d4d1 (patch)
tree97ec6dafa703adf104ebd354932ab3891feecb1f /lib
parentfaa5530291e9799acca48cda59e8ce94c1a7d354 (diff)
downloadusbhid-dump-490ac2a5fc080ecc6daeef60117e65143013d4d1.tar.gz
Renamed the package from hid-dump to usbhid-dump
In preparation for integration with usbutils, the package is given a more globally correct name "usbhid-dump". All the relevant directories and files are renamed. All the relevant symbols in the code are renamed. The resulting binary is renamed. All the license notices in the files are updated with the new name.
Diffstat (limited to 'lib')
-rw-r--r--lib/Makefile.am12
-rw-r--r--lib/iface.c106
-rw-r--r--lib/libusb.c12
-rw-r--r--lib/str.c14
4 files changed, 72 insertions, 72 deletions
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 1d31032..89f56cd 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -1,24 +1,24 @@
# Copyright (C) 2009-2010 Nikolai Kondrashov
#
-# This file is part of hid-dump.
+# This file is part of usbhid-dump.
#
-# Hid-dump is free software; you can redistribute it and/or modify
+# Usbhid-dump is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
-# Hid-dump is distributed in the hope that it will be useful,
+# Usbhid-dump is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with hid-dump; if not, write to the Free Software
+# along with usbhid-dump; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-noinst_LTLIBRARIES = libhid_dump.la
+noinst_LTLIBRARIES = libusbhid_dump.la
-libhid_dump_la_SOURCES = \
+libusbhid_dump_la_SOURCES = \
iface.c \
libusb.c \
str.c
diff --git a/lib/iface.c b/lib/iface.c
index 1f1a7b0..573d760 100644
--- a/lib/iface.c
+++ b/lib/iface.c
@@ -1,22 +1,22 @@
/** @file
- * @brief hid-dump - interface
+ * @brief usbhid-dump - interface
*
* Copyright (C) 2010 Nikolai Kondrashov
*
- * This file is part of hid-dump.
+ * This file is part of usbhid-dump.
*
- * Hid-dump is free software; you can redistribute it and/or modify
+ * Usbhid-dump is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
- * Hid-dump is distributed in the hope that it will be useful,
+ * Usbhid-dump is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with hid-dump; if not, write to the Free Software
+ * along with usbhid-dump; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
* @author Nikolai Kondrashov <spbnick@gmail.com>
@@ -24,26 +24,26 @@
* @(#) $Id$
*/
-#include "hid_dump/iface.h"
+#include "usbhid_dump/iface.h"
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
bool
-hid_dump_iface_valid(const hid_dump_iface *iface)
+usbhid_dump_iface_valid(const usbhid_dump_iface *iface)
{
return iface != NULL &&
iface->handle != NULL &&
iface->number < UINT8_MAX;
}
-hid_dump_iface *
-hid_dump_iface_new(libusb_device_handle *handle,
- uint8_t number,
- uint8_t int_in_ep_addr,
- uint16_t int_in_ep_maxp)
+usbhid_dump_iface *
+usbhid_dump_iface_new(libusb_device_handle *handle,
+ uint8_t number,
+ uint8_t int_in_ep_addr,
+ uint16_t int_in_ep_maxp)
{
- hid_dump_iface *iface;
+ usbhid_dump_iface *iface;
iface = malloc(sizeof(*iface));
if (iface == NULL)
@@ -63,22 +63,22 @@ hid_dump_iface_new(libusb_device_handle *handle,
void
-hid_dump_iface_free(hid_dump_iface *iface)
+usbhid_dump_iface_free(usbhid_dump_iface *iface)
{
if (iface == NULL)
return;
- assert(hid_dump_iface_valid(iface));
+ assert(usbhid_dump_iface_valid(iface));
free(iface);
}
bool
-hid_dump_iface_list_valid(const hid_dump_iface *list)
+usbhid_dump_iface_list_valid(const usbhid_dump_iface *list)
{
for (; list != NULL; list = list->next)
- if (!hid_dump_iface_valid(list))
+ if (!usbhid_dump_iface_valid(list))
return false;
return true;
@@ -86,7 +86,7 @@ hid_dump_iface_list_valid(const hid_dump_iface *list)
size_t
-hid_dump_iface_list_len(const hid_dump_iface *list)
+usbhid_dump_iface_list_len(const usbhid_dump_iface *list)
{
size_t len = 0;
@@ -98,21 +98,21 @@ hid_dump_iface_list_len(const hid_dump_iface *list)
void
-hid_dump_iface_list_free(hid_dump_iface *list)
+usbhid_dump_iface_list_free(usbhid_dump_iface *list)
{
- hid_dump_iface *next;
+ usbhid_dump_iface *next;
for (; list != NULL; list = next)
{
next = list->next;
- hid_dump_iface_free(list);
+ usbhid_dump_iface_free(list);
}
}
enum libusb_error
-hid_dump_iface_list_new_from_dev(libusb_device_handle *handle,
- hid_dump_iface **plist)
+usbhid_dump_iface_list_new_from_dev(libusb_device_handle *handle,
+ usbhid_dump_iface **plist)
{
enum libusb_error err = LIBUSB_ERROR_OTHER;
@@ -121,9 +121,9 @@ hid_dump_iface_list_new_from_dev(libusb_device_handle *handle,
const struct libusb_endpoint_descriptor *ep_list;
uint8_t ep_num;
const struct libusb_endpoint_descriptor *ep;
- hid_dump_iface *list = NULL;
- hid_dump_iface *last = NULL;
- hid_dump_iface *iface;
+ usbhid_dump_iface *list = NULL;
+ usbhid_dump_iface *last = NULL;
+ usbhid_dump_iface *iface;
assert(handle != NULL);
@@ -153,7 +153,7 @@ hid_dump_iface_list_new_from_dev(libusb_device_handle *handle,
LIBUSB_ENDPOINT_IN)
continue;
- iface = hid_dump_iface_new(
+ iface = usbhid_dump_iface_new(
handle,
libusb_iface->altsetting->bInterfaceNumber,
ep->bEndpointAddress, ep->wMaxPacketSize);
@@ -182,7 +182,7 @@ hid_dump_iface_list_new_from_dev(libusb_device_handle *handle,
cleanup:
- hid_dump_iface_list_free(list);
+ usbhid_dump_iface_list_free(list);
if (config != NULL)
libusb_free_config_descriptor(config);
@@ -191,15 +191,15 @@ cleanup:
}
-hid_dump_iface *
-hid_dump_iface_list_fltr_by_num(hid_dump_iface *list,
- int number)
+usbhid_dump_iface *
+usbhid_dump_iface_list_fltr_by_num(usbhid_dump_iface *list,
+ int number)
{
- hid_dump_iface *prev;
- hid_dump_iface *iface;
- hid_dump_iface *next;
+ usbhid_dump_iface *prev;
+ usbhid_dump_iface *iface;
+ usbhid_dump_iface *next;
- assert(hid_dump_iface_list_valid(list));
+ assert(usbhid_dump_iface_list_valid(list));
assert(number < UINT8_MAX);
if (number < 0)
@@ -225,11 +225,11 @@ hid_dump_iface_list_fltr_by_num(hid_dump_iface *list,
enum libusb_error
-hid_dump_iface_list_detach(hid_dump_iface *list)
+usbhid_dump_iface_list_detach(usbhid_dump_iface *list)
{
enum libusb_error err;
- assert(hid_dump_iface_list_valid(list));
+ assert(usbhid_dump_iface_list_valid(list));
for (; list != NULL; list = list->next)
{
@@ -245,11 +245,11 @@ hid_dump_iface_list_detach(hid_dump_iface *list)
enum libusb_error
-hid_dump_iface_list_attach(hid_dump_iface *list)
+usbhid_dump_iface_list_attach(usbhid_dump_iface *list)
{
enum libusb_error err;
- assert(hid_dump_iface_list_valid(list));
+ assert(usbhid_dump_iface_list_valid(list));
for (; list != NULL; list = list->next)
if (list->detached)
@@ -265,11 +265,11 @@ hid_dump_iface_list_attach(hid_dump_iface *list)
enum libusb_error
-hid_dump_iface_list_claim(hid_dump_iface *list)
+usbhid_dump_iface_list_claim(usbhid_dump_iface *list)
{
enum libusb_error err;
- assert(hid_dump_iface_list_valid(list));
+ assert(usbhid_dump_iface_list_valid(list));
for (; list != NULL; list = list->next)
{
@@ -285,11 +285,11 @@ hid_dump_iface_list_claim(hid_dump_iface *list)
enum libusb_error
-hid_dump_iface_list_clear_halt(hid_dump_iface *list)
+usbhid_dump_iface_list_clear_halt(usbhid_dump_iface *list)
{
enum libusb_error err;
- assert(hid_dump_iface_list_valid(list));
+ assert(usbhid_dump_iface_list_valid(list));
for (; list != NULL; list = list->next)
{
@@ -303,13 +303,13 @@ hid_dump_iface_list_clear_halt(hid_dump_iface *list)
enum libusb_error
-hid_dump_iface_list_set_idle(const hid_dump_iface *list,
- uint8_t duration,
- unsigned int timeout)
+usbhid_dump_iface_list_set_idle(const usbhid_dump_iface *list,
+ uint8_t duration,
+ unsigned int timeout)
{
int rc;
- assert(hid_dump_iface_list_valid(list));
+ assert(usbhid_dump_iface_list_valid(list));
for (; list != NULL; list = list->next)
{
@@ -338,13 +338,13 @@ hid_dump_iface_list_set_idle(const hid_dump_iface *list,
enum libusb_error
-hid_dump_iface_list_set_protocol(const hid_dump_iface *list,
- bool report,
- unsigned int timeout)
+usbhid_dump_iface_list_set_protocol(const usbhid_dump_iface *list,
+ bool report,
+ unsigned int timeout)
{
int rc;
- assert(hid_dump_iface_list_valid(list));
+ assert(usbhid_dump_iface_list_valid(list));
for (; list != NULL; list = list->next)
{
@@ -373,11 +373,11 @@ hid_dump_iface_list_set_protocol(const hid_dump_iface *list,
enum libusb_error
-hid_dump_iface_list_release(hid_dump_iface *list)
+usbhid_dump_iface_list_release(usbhid_dump_iface *list)
{
enum libusb_error err;
- assert(hid_dump_iface_list_valid(list));
+ assert(usbhid_dump_iface_list_valid(list));
for (; list != NULL; list = list->next)
if (list->claimed)
diff --git a/lib/libusb.c b/lib/libusb.c
index ae3da9a..fae109b 100644
--- a/lib/libusb.c
+++ b/lib/libusb.c
@@ -1,22 +1,22 @@
/** @file
- * @brief hid-dump - libusb API extensions
+ * @brief usbhid-dump - libusb API extensions
*
* Copyright (C) 2010 Nikolai Kondrashov
*
- * This file is part of hid-dump.
+ * This file is part of usbhid-dump.
*
- * Hid-dump is free software; you can redistribute it and/or modify
+ * Usbhid-dump is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
- * Hid-dump is distributed in the hope that it will be useful,
+ * Usbhid-dump is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with hid-dump; if not, write to the Free Software
+ * along with usbhid-dump; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
* @author Nikolai Kondrashov <spbnick@gmail.com>
@@ -24,7 +24,7 @@
* @(#) $Id$
*/
-#include "hid_dump/libusb.h"
+#include "usbhid_dump/libusb.h"
#include <stdbool.h>
const char *
diff --git a/lib/str.c b/lib/str.c
index 26e5fcf..ceff86d 100644
--- a/lib/str.c
+++ b/lib/str.c
@@ -1,22 +1,22 @@
/** @file
- * @brief hid-dump - string utilities
+ * @brief usbhid-dump - string utilities
*
* Copyright (C) 2010 Nikolai Kondrashov
*
- * This file is part of hid-dump.
+ * This file is part of usbhid-dump.
*
- * Hid-dump is free software; you can redistribute it and/or modify
+ * Usbhid-dump is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
- * Hid-dump is distributed in the hope that it will be useful,
+ * Usbhid-dump is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with hid-dump; if not, write to the Free Software
+ * along with usbhid-dump; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
* @author Nikolai Kondrashov <spbnick@gmail.com>
@@ -24,11 +24,11 @@
* @(#) $Id$
*/
-#include "hid_dump/str.h"
+#include "usbhid_dump/str.h"
#include <ctype.h>
bool
-hid_dump_strisblank(const char *str)
+usbhid_dump_strisblank(const char *str)
{
for (; *str != '\0'; str++)
if (!isblank(*str))