| 85 | |
| 86 | |
| 87 | static hid_device *new_hid_device(void) |
| 88 | { |
| 89 | hid_device *dev = (hid_device*) calloc(1, sizeof(hid_device)); |
| 90 | if (dev == NULL) { |
| 91 | return NULL; |
| 92 | } |
| 93 | |
| 94 | dev->device_handle = -1; |
| 95 | dev->blocking = 1; |
| 96 | dev->last_error_str = NULL; |
| 97 | dev->device_info = NULL; |
| 98 | |
| 99 | return dev; |
| 100 | } |
| 101 | |
| 102 | |
| 103 | /* The caller must free the returned string with free(). */ |