libusb.h (aa87aa52326be7b726664dba65e91ec3d8160f48) libusb.h (4c6bcffd04f9d0b6cb57af0ffcc9be3098fe950c)
1/* $FreeBSD$ */
2/*-
3 * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
4 *
5 * Copyright (c) 2009 Sylvestre Gallon. All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

--- 252 unchanged lines hidden (view full) ---

261 LIBUSB_HOTPLUG_ENUMERATE = 1 << 0,
262} libusb_hotplug_flag;
263
264typedef enum {
265 LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED = 1,
266 LIBUSB_HOTPLUG_EVENT_DEVICE_LEFT = 2,
267} libusb_hotplug_event;
268
1/* $FreeBSD$ */
2/*-
3 * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
4 *
5 * Copyright (c) 2009 Sylvestre Gallon. All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

--- 252 unchanged lines hidden (view full) ---

261 LIBUSB_HOTPLUG_ENUMERATE = 1 << 0,
262} libusb_hotplug_flag;
263
264typedef enum {
265 LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED = 1,
266 LIBUSB_HOTPLUG_EVENT_DEVICE_LEFT = 2,
267} libusb_hotplug_event;
268
269enum libusb_option {
270 LIBUSB_OPTION_LOG_LEVEL = 0,
271 LIBUSB_OPTION_USE_USBDK = 1,
272 LIBUSB_OPTION_NO_DEVICE_DISCOVERY = 2,
273 LIBUSB_OPTION_WEAK_AUTHORITY = 2,
274 LIBUSB_OPTION_MAX = 3,
275};
276
269/* libusb structures */
270
271struct libusb_context;
272struct libusb_device;
273struct libusb_transfer;
274struct libusb_device_handle;
275struct libusb_hotplug_callback_handle_struct;
276

--- 6 unchanged lines hidden (view full) ---

283 const uint16_t major;
284 const uint16_t minor;
285 const uint16_t micro;
286 const uint16_t nano;
287 const char *rc;
288 const char *describe;
289};
290
277/* libusb structures */
278
279struct libusb_context;
280struct libusb_device;
281struct libusb_transfer;
282struct libusb_device_handle;
283struct libusb_hotplug_callback_handle_struct;
284

--- 6 unchanged lines hidden (view full) ---

291 const uint16_t major;
292 const uint16_t minor;
293 const uint16_t micro;
294 const uint16_t nano;
295 const char *rc;
296 const char *describe;
297};
298
299struct libusb_init_option {
300 enum libusb_option option;
301 union {
302 int64_t ival;
303 } value;
304};
305
291typedef struct libusb_context libusb_context;
292typedef struct libusb_device libusb_device;
293typedef struct libusb_device_handle libusb_device_handle;
294typedef struct libusb_pollfd libusb_pollfd;
295typedef void (*libusb_pollfd_added_cb) (int fd, short events, void *user_data);
296typedef void (*libusb_pollfd_removed_cb) (int fd, void *user_data);
297typedef struct libusb_hotplug_callback_handle_struct *libusb_hotplug_callback_handle;
298

--- 161 unchanged lines hidden (view full) ---

460
461/* Library initialisation */
462
463void libusb_set_debug(libusb_context * ctx, int level);
464const struct libusb_version *libusb_get_version(void);
465const char *libusb_strerror(int code);
466const char *libusb_error_name(int code);
467int libusb_init(libusb_context ** context);
306typedef struct libusb_context libusb_context;
307typedef struct libusb_device libusb_device;
308typedef struct libusb_device_handle libusb_device_handle;
309typedef struct libusb_pollfd libusb_pollfd;
310typedef void (*libusb_pollfd_added_cb) (int fd, short events, void *user_data);
311typedef void (*libusb_pollfd_removed_cb) (int fd, void *user_data);
312typedef struct libusb_hotplug_callback_handle_struct *libusb_hotplug_callback_handle;
313

--- 161 unchanged lines hidden (view full) ---

475
476/* Library initialisation */
477
478void libusb_set_debug(libusb_context * ctx, int level);
479const struct libusb_version *libusb_get_version(void);
480const char *libusb_strerror(int code);
481const char *libusb_error_name(int code);
482int libusb_init(libusb_context ** context);
483int libusb_init_context(libusb_context **, const struct libusb_init_option [], int num_options);
468void libusb_exit(struct libusb_context *ctx);
469int libusb_has_capability(uint32_t capability);
470
471/* Device handling and enumeration */
472
473ssize_t libusb_get_device_list(libusb_context * ctx, libusb_device *** list);
474void libusb_free_device_list(libusb_device ** list, int unref_devices);
475uint8_t libusb_get_bus_number(libusb_device * dev);

--- 125 unchanged lines hidden ---
484void libusb_exit(struct libusb_context *ctx);
485int libusb_has_capability(uint32_t capability);
486
487/* Device handling and enumeration */
488
489ssize_t libusb_get_device_list(libusb_context * ctx, libusb_device *** list);
490void libusb_free_device_list(libusb_device ** list, int unref_devices);
491uint8_t libusb_get_bus_number(libusb_device * dev);

--- 125 unchanged lines hidden ---