PipeWire 1.6.8

Loading...
Searching...
No Matches
dict.h
Go to the documentation of this file.
1/* Simple Plugin API */
2/* SPDX-FileCopyrightText: Copyright © 2018 Wim Taymans */
3/* SPDX-License-Identifier: MIT */
4
5#ifndef SPA_DEBUG_DICT_H
6#define SPA_DEBUG_DICT_H
7
8#include <spa/debug/context.h>
9#include <spa/utils/dict.h>
10
11#ifdef __cplusplus
12 extern "C" {
13#endif
14
19
20#ifndef SPA_API_DEBUG_DICT
21 #ifdef SPA_API_IMPL
22 #define SPA_API_DEBUG_DICT SPA_API_IMPL
23 #else
24 #define SPA_API_DEBUG_DICT static inline
25 #endif
26#endif
27
28 SPA_API_DEBUG_DICT int spa_debugc_dict(struct spa_debug_context *ctx, int indent, const struct spa_dict *dict)
29{
30 const struct spa_dict_item *item;
31 spa_debugc(ctx, "%*sflags:%08x n_items:%d", indent, "", dict->flags, dict->n_items);
32 spa_dict_for_each(item, dict) {
33 spa_debugc(ctx, "%*s %s = \"%s\"", indent, "", item->key, item->value);
34 }
35 return 0;
36}
37
38 SPA_API_DEBUG_DICT int spa_debug_dict(int indent, const struct spa_dict *dict)
39{
40 return spa_debugc_dict(NULL, indent, dict);
41}
44
45
46#ifdef __cplusplus
47} /* extern "C" */
48#endif
49
50#endif /* SPA_DEBUG_DICT_H */
spa_debugc
#define spa_debugc(_c, _fmt,...)
Definition context.h:50
spa_debugc_dict
SPA_API_DEBUG_DICT int spa_debugc_dict(struct spa_debug_context *ctx, int indent, const struct spa_dict *dict)
Definition dict.h:35
SPA_API_DEBUG_DICT
#define SPA_API_DEBUG_DICT
Definition dict.h:31
spa_debug_dict
SPA_API_DEBUG_DICT int spa_debug_dict(int indent, const struct spa_dict *dict)
Definition dict.h:45
spa_dict_for_each
#define spa_dict_for_each(item, dict)
Definition dict.h:71
context.h
spa/debug/context.h
spa_debug_context
Definition context.h:46
spa_dict_item
Definition dict.h:41
spa_dict
Definition dict.h:51
spa_dict::n_items
uint32_t n_items
Definition dict.h:55
spa_dict::flags
uint32_t flags
Definition dict.h:54
dict.h
spa/utils/dict.h