aboutsummaryrefslogtreecommitdiff
path: root/vendor/sdl3/sdl3_log.odin
blob: 981bfcefd17b223acc3915c0503313be0351cbf4 (plain)
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
package sdl3

import "core:c"

LogCategory :: enum c.int {
	APPLICATION,
	ERROR,
	ASSERT,
	SYSTEM,
	AUDIO,
	VIDEO,
	RENDER,
	INPUT,
	TEST,
	GPU,

	/* Reserved for future SDL library use */
	RESERVED2,
	RESERVED3,
	RESERVED4,
	RESERVED5,
	RESERVED6,
	RESERVED7,
	RESERVED8,
	RESERVED9,
	RESERVED10,

	/* Beyond this point is reserved for application use, e.g.
		enum {
			MYAPP_CATEGORY_AWESOME1 = CUSTOM,
			MYAPP_CATEGORY_AWESOME2,
			MYAPP_CATEGORY_AWESOME3,
			...
		};
	*/
	CUSTOM,
}

LogPriority :: enum c.int {
	INVALID,
	TRACE,
	VERBOSE,
	DEBUG,
	INFO,
	WARN,
	ERROR,
	CRITICAL,
}

LogOutputFunction :: #type proc "c" (userdata: rawptr, category: LogCategory, priority: LogPriority, message: cstring)

@(default_calling_convention="c", link_prefix="SDL_")
foreign lib {
	SetLogPriorities            :: proc(priority: LogPriority) ---
	SetLogPriority              :: proc(category: LogCategory, priority: LogPriority) ---
	GetLogPriority              :: proc(category: LogCategory) -> LogPriority ---
	ResetLogPriorities          :: proc() ---
	SetLogPriorityPrefix        :: proc(priority: LogPriority, prefix: cstring) -> bool ---
	Log                         :: proc(fmt: cstring, #c_vararg args: ..any) ---
	LogTrace                    :: proc(category: c.int, fmt: cstring, #c_vararg args: ..any) ---
	LogVerbose                  :: proc(category: c.int, fmt: cstring, #c_vararg args: ..any) ---
	LogDebug                    :: proc(category: c.int, fmt: cstring, #c_vararg args: ..any) ---
	LogInfo                     :: proc(category: c.int, fmt: cstring, #c_vararg args: ..any) ---
	LogWarn                     :: proc(category: c.int, fmt: cstring, #c_vararg args: ..any) ---
	LogError                    :: proc(category: c.int, fmt: cstring, #c_vararg args: ..any) ---
	LogCritical                 :: proc(category: c.int, fmt: cstring, #c_vararg args: ..any) ---
	LogMessage                  :: proc(category: c.int, priority: LogPriority, fmt: cstring, #c_vararg args: ..any) ---
	LogMessageV                 :: proc(category: c.int, priority: LogPriority, fmt: cstring, ap: c.va_list) ---
	GetDefaultLogOutputFunction :: proc() -> LogOutputFunction ---
	GetLogOutputFunction        :: proc(callback: ^LogOutputFunction, userdata: ^rawptr) ---
	SetLogOutputFunction        :: proc(callback: LogOutputFunction, userdata: rawptr) ---
}