1/*
2 * Copyright (c) 2007-2008 by Michael Lotz
3 * Heavily based on the original usb_serial driver which is:
4 *
5 * Copyright (c) 2003 by Siarzhuk Zharski <imker@gmx.li>
6 * Distributed under the terms of the MIT License.
7 */
8#ifndef _USB_SERIAL_TRACING_H_
9#define _USB_SERIAL_TRACING_H_
10
11void load_settings();
12void create_log_file();
13void usb_serial_trace(bool force, const char *format, ...);
14
15#define TRACE_ALWAYS(x...) usb_serial_trace(true, x);
16#define TRACE(x...) usb_serial_trace(false, x);
17
18extern bool gLogFunctionCalls;
19#define TRACE_FUNCALLS(x...) \
20	if (gLogFunctionCalls) \
21		usb_serial_trace(false, x);
22
23extern bool gLogFunctionReturns;
24#define TRACE_FUNCRET(x...) \
25	if (gLogFunctionReturns) \
26		usb_serial_trace(false, x);
27
28extern bool gLogFunctionResults;
29#define TRACE_FUNCRES(func, param) \
30	if (gLogFunctionResults) \
31		func(param);
32
33void trace_termios(struct termios *tios);
34
35#endif //_USB_SERIAL_TRACING_H_
36