Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion hidtest/test.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#include <wchar.h>
#include <string.h>
#include <stdlib.h>

#include <hidapi.h>

// Headers needed for sleeping.
Expand Down
4 changes: 1 addition & 3 deletions libusb/hid.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,14 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdint.h>
#include <ctype.h>
#include <locale.h>
#include <errno.h>

/* Unix */
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/ioctl.h>
#include <sys/utsname.h>
#include <fcntl.h>
#include <wchar.h>

Expand Down
12 changes: 8 additions & 4 deletions linux/hid.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,24 +26,26 @@
#include <stdlib.h>
#include <locale.h>
#include <errno.h>

/* Unix */
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/ioctl.h>
#include <sys/utsname.h>
#include <fcntl.h>
#include <poll.h>
#include <linux/types.h>
#include <linux/hid.h>
#include <stdarg.h>
#include <wchar.h>

/* Linux */
#include <linux/hidraw.h>
#include <linux/version.h>
#include <linux/input.h>
#include <libudev.h>

#include "hidapi.h"

struct udev_device;

#ifdef HIDAPI_ALLOW_BUILD_WORKAROUND_KERNEL_2_6_39
/* This definitions first appeared in Linux Kernel 2.6.39 in linux/hidraw.h.
hidapi doesn't support kernels older than that,
Expand Down Expand Up @@ -616,10 +618,12 @@ static int parse_uevent_info(const char *uevent, unsigned *bus_type,
}
} else if (strcmp(key, "HID_NAME") == 0) {
/* The caller has to free the product name */
free(*product_name_utf8);
*product_name_utf8 = strdup(value);
found_name = 1;
} else if (strcmp(key, "HID_UNIQ") == 0) {
/* The caller has to free the serial number */
free(*serial_number_utf8);
*serial_number_utf8 = strdup(value);
found_serial = 1;
}
Expand Down
3 changes: 3 additions & 0 deletions mac/hid.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,15 @@
#include <CoreFoundation/CoreFoundation.h>
#include <mach/mach_error.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#include <wchar.h>
#include <locale.h>
#include <pthread.h>
#include <sys/time.h>
#include <unistd.h>
#include <dlfcn.h>
#include <errno.h>

#include "hidapi_darwin.h"

Expand Down
Loading