debug.h

Go to the documentation of this file.
00001 #ifndef __INCLUDED_DEBUG_H__
00002 #define __INCLUDED_DEBUG_H__
00003 
00004 #ifndef HID_INTERNAL
00005 #  error "this file is only supposed to be used from within libhid."
00006 #endif /* HID_INTERNAL */
00007 
00008 #include <hid.h>
00009 #include <usb.h>
00010 
00011 extern HIDDebugLevel hid_debug_level;
00012 extern FILE* hid_debug_stream;
00013 
00014 #define DEBUGPRINTF(t, s, a...) if (hid_debug_stream) { \
00015                                   fprintf(hid_debug_stream, "%s: %s(): ", t, __FUNCTION__); \
00016                                   fprintf(hid_debug_stream, s "\n", ##a); \
00017                                 }
00018 #define TRACE(s, a...) if (hid_debug_level & HID_DEBUG_TRACES) { DEBUGPRINTF("  TRACE", s, ##a) }
00019 #define NOTICE(s, a...) if (hid_debug_level & HID_DEBUG_NOTICES) { DEBUGPRINTF(" NOTICE", s, ##a) }
00020 #define WARNING(s, a...) if (hid_debug_level & HID_DEBUG_WARNINGS) { DEBUGPRINTF("WARNING", s, ##a) }
00021 #define ERROR(s, a...) if (hid_debug_level & HID_DEBUG_ERRORS) { DEBUGPRINTF("  ERROR", s, ##a) }
00022 
00023 void trace_usb_bus(FILE* const out, struct usb_bus const* const usbbus);
00024 void trace_usb_device(FILE* const out, struct usb_device const* const usbdev);
00025 void trace_usb_device_descriptor(FILE* const out, struct usb_device_descriptor const* const descriptor);
00026 void trace_usb_config_descriptor(FILE* const out, struct usb_config_descriptor const* const config);
00027 void trace_usb_dev_handle(FILE* const out, usb_dev_handle const* const usbdev_h);
00028 
00029 #endif /* __INCLUDED_DEBUG_H__ */
00030 
00031 /* COPYRIGHT --
00032  *
00033  * This file is part of libhid, a user-space HID access library.
00034  * libhid is (c) 2003-2005
00035  *   Martin F. Krafft <libhid@pobox.madduck.net>
00036  *   Charles Lepple <clepple@ghz.cc>
00037  *   Arnaud Quette <arnaud.quette@free.fr> && <arnaud.quette@mgeups.com>
00038  * and distributed under the terms of the GNU General Public License.
00039  * See the file ./COPYING in the source distribution for more information.
00040  *
00041  * THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
00042  * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES
00043  * OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00044  */

Generated on Sun Mar 30 15:28:24 2008 for libhid by  doxygen 1.5.1