PipeWire  0.3.66
spa/include/spa/debug/context.h
Go to the documentation of this file.
1 /* Simple Plugin API */
2 /* SPDX-FileCopyrightText: Copyright © 2023 Wim Taymans */
3 /* SPDX-License-Identifier: MIT */
4 
5 #ifndef SPA_DEBUG_CONTEXT_H
6 #define SPA_DEBUG_CONTEXT_H
7 
8 #ifdef __cplusplus
9 extern "C" {
10 #endif
11 
12 #include <stdio.h>
13 #include <stdarg.h>
14 
15 #include <spa/utils/defs.h>
21 #ifndef spa_debugn
22 #define spa_debugn(_fmt,...) printf((_fmt), ## __VA_ARGS__)
23 #endif
24 #ifndef spa_debug
25 #define spa_debug(_fmt,...) spa_debugn(_fmt"\n", ## __VA_ARGS__)
26 #endif
27 
28 struct spa_debug_context {
29  void (*log) (struct spa_debug_context *ctx, const char *fmt, ...) SPA_PRINTF_FUNC(2, 3);
30 };
31 
32 #define spa_debugc(_c,_fmt,...) (_c)?((_c)->log((_c),_fmt, ## __VA_ARGS__)):(void)spa_debug(_fmt, ## __VA_ARGS__)
33 
38 #ifdef __cplusplus
39 } /* extern "C" */
40 #endif
41 
42 #endif /* SPA_DEBUG_CONTEXT_H */
spa/utils/defs.h
#define SPA_PRINTF_FUNC(fmt, arg1)
Definition: defs.h:269
Definition: spa/include/spa/debug/context.h:33
void(* log)(struct spa_debug_context *ctx, const char *fmt,...) 1(2
Definition: spa/include/spa/debug/context.h:34