Deleted Added
sdiff udiff text old ( 194676 ) new ( 195560 )
full compact
1/* $FreeBSD: head/lib/libusb/libusb10.h 195560 2009-07-10 14:15:53Z thompsa $ */
2/*-
3 * Copyright (c) 2009 Sylvestre Gallon. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.

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

26
27#ifndef __LIBUSB10_H__
28#define __LIBUSB10_H__
29
30/*
31 * The two following macros were taken from the original LibUSB v1.0
32 * for sake of compatibility:
33 */
34
35static int get_next_timeout(libusb_context *ctx, struct timeval *tv, struct timeval *out);
36static int handle_timeouts(struct libusb_context *ctx);
37static int handle_events(struct libusb_context *ctx, struct timeval *tv);
38extern struct libusb_context *usbi_default_context;
39extern pthread_mutex_t libusb20_lock;
40
41/* if ctx is NULL use default context*/
42
43#define GET_CONTEXT(ctx) \
44 if (ctx == NULL) ctx = usbi_default_context;
45
46#define MAX(a,b) (((a)>(b))?(a):(b))
47#define USB_TIMED_OUT (1<<0)
48#define UNEXPORTED __attribute__((__visibility__("hidden")))
49
50#define DPRINTF(ctx, dbg, format, args...) \
51if (ctx->debug == dbg) { \
52 printf("LIBUSB_%s : ", (ctx->debug == LIBUSB_DEBUG_FUNCTION) ? "FUNCTION" : "TRANSFER"); \
53 switch(ctx->debug) { \
54 case LIBUSB_DEBUG_FUNCTION: \
55 printf(format, ## args);\
56 break ; \
57 case LIBUSB_DEBUG_TRANSFER: \
58 printf(format, ## args);\
59 break ; \
60 } \
61 printf("\n"); \
62}
63
64UNEXPORTED int usb_add_pollfd(libusb_context *ctx, int fd, short events);
65UNEXPORTED void usb_remove_pollfd(libusb_context *ctx, int fd);
66UNEXPORTED void usb_handle_transfer_completion(struct usb_transfer *uxfer,
67 enum libusb_transfer_status status);
68UNEXPORTED void usb_handle_disconnect(struct libusb_device_handle *devh);
69
70#endif /*__LIBUSB10_H__*/