forked from antonioginer/switchres
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathlog.h
38 lines (26 loc) · 1.01 KB
/
log.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/**************************************************************
log.h - Simple logging for Switchres
---------------------------------------------------------
Switchres Modeline generation engine for emulation
License GPL-2.0+
Copyright 2010-2021 Chris Kennedy, Antonio Giner,
Alexandre Wodarczyk, Gil Delescluse
**************************************************************/
#ifndef __LOG__
#define __LOG__
#if defined(__GNUC__)
#define ATTR_PRINTF(x,y) __attribute__((format(printf, x, y)))
#else
#define ATTR_PRINTF(x,y)
#endif
typedef void (*LOG_VERBOSE)(const char *format, ...) ATTR_PRINTF(1,2);
extern LOG_VERBOSE log_verbose;
typedef void (*LOG_INFO)(const char *format, ...) ATTR_PRINTF(1,2);
extern LOG_INFO log_info;
typedef void (*LOG_ERROR)(const char *format, ...) ATTR_PRINTF(1,2);
extern LOG_ERROR log_error;
void set_log_verbosity(int);
void set_log_verbose(void *func_ptr);
void set_log_info(void *func_ptr);
void set_log_error(void *func_ptr);
#endif