/* usb-lib/usb/lib/debug.h
 *
 * (c) 2002 Simtec Electronics
 *
 * Ben Dooks
 *
 * General debugging function definitions
 * 
 * $Id: debug.h,v 1.5 2003/08/06 15:56:11 ben Exp $
 *
 * This Library file is part of the Simtec Electronics USB stack development
 *   suite.
 * Specific licence is granted to use this file by third parties for the
 *   development of USB device drivers.
 *
*/

#ifndef __USBLIB_USB_LIB_DEBUG_H
#define __USBLIB_USB_LIB_DEBUG_H "$Id: debug.h,v 1.5 2003/08/06 15:56:11 ben Exp $"

#include <stdio.h>

extern int usbdebug_doopen(char *title, int width, int height, int flags);
extern void usbdebug_doclose(int handle);

extern int usbdebug_open(char *name, int, int, int flags);
extern int usbdebug_close(void);

extern void usbdebug_printf(const char *fmt, ...);

struct usbdebug_module {
  char          prefix[16];

  /* stuff for each module being debugged will go here, like being
   * able to use specific debug window or not */

};

struct usbdebug_info {
  struct usbdebug_module *mod;
  FILE                   *file;
  unsigned long          handle;
  char                   prefix[48];
};

/* definition of debugging bits */
extern struct usbdebug_module usbdebug_mod;
extern struct usbdebug_info   usbdebug_inf;

/* set this to copy the debug output to the stdio stream */
extern int usbdebug_copystdio;

extern FILE *usbdebug_file;

extern int usbdebug_standalone;


extern void usbdebug_writes(struct usbdebug_info *, char *);

extern int usbdebug_register(struct usbdebug_info *, char *, char *);
extern int usbdebug_deregister(struct usbdebug_info *);

extern void usbdebug_dprintf(struct usbdebug_info *, const char *fmt, ...);

#endif /* __USBLIB_USB_LIB_DEBUG_H */
