PipeWire 1.4.1
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
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#ifdef __cplusplus
9extern "C" {
10#endif
11
17#include <spa/debug/context.h>
18#include <spa/utils/dict.h>
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
28SPA_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
38SPA_API_DEBUG_DICT int spa_debug_dict(int indent, const struct spa_dict *dict)
39{
40 return spa_debugc_dict(NULL, indent, dict);
41}
46#ifdef __cplusplus
47} /* extern "C" */
48#endif
49
50#endif /* SPA_DEBUG_DICT_H */
#define spa_debugc(_c, _fmt,...)
Definition context.h:49
SPA_API_DEBUG_DICT int spa_debugc_dict(struct spa_debug_context *ctx, int indent, const struct spa_dict *dict)
Definition dict.h:35
#define SPA_API_DEBUG_DICT
Definition dict.h:31
SPA_API_DEBUG_DICT int spa_debug_dict(int indent, const struct spa_dict *dict)
Definition dict.h:45
#define spa_dict_for_each(item, dict)
Definition dict.h:71
spa/debug/context.h
Definition context.h:45
Definition dict.h:41
Definition dict.h:51
uint32_t n_items
Definition dict.h:55
uint32_t flags
Definition dict.h:54
spa/utils/dict.h