PipeWire: spa/debug/context.h Source File

PipeWire 1.0.3

Loading...
Searching...
No Matches
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
9extern "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
28struct 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 */
defs.h
spa/utils/defs.h
SPA_PRINTF_FUNC
#define SPA_PRINTF_FUNC(fmt, arg1)
Definition defs.h:277
spa_debug_context
Definition context.h:33
spa_debug_context::log
void(* log)(struct spa_debug_context *ctx, const char *fmt,...) 1(2
Definition context.h:34