PipeWire 1.2.6

Loading...
Searching...
No Matches
Files | Data Structures | Macros | Functions
Dictionary
SPA » Utilities

Dictionary data structure More...

## Files
file | dict.h
| `spa/utils/dict.h`

## Data Structures
struct | spa_dict_item
struct | spa_dict

## Macros
#define | SPA_DICT_ITEM_INIT(key, value)
#define | SPA_DICT_FLAG_SORTED (1<<0)
| items are sorted
#define | SPA_DICT_INIT(items, n_items)
#define | SPA_DICT_INIT_ARRAY(items)
#define | spa_dict_for_each(item, dict)

## Functions
static int | spa_dict_item_compare (const void *i1, const void *i2)
static void | spa_dict_qsort (struct spa_dict *dict)
static const struct spa_dict_item * | spa_dict_lookup_item (const struct spa_dict *dict, const char *key)
static const char * | spa_dict_lookup (const struct spa_dict *dict, const char *key)

## Detailed Description

Dictionary data structure

## Macro Definition Documentation

## ◆ SPA_DICT_ITEM_INIT

#define SPA_DICT_ITEM_INIT | ( |  | key,
|  |  | value )

Value:
((struct spa_dict_item) { (key), (value) })
spa_dict_item
Definition dict.h:31
spa_dict_item::key
const char * key
Definition dict.h:32
spa_dict_item::value
const char * value
Definition dict.h:33

Examples
  export-source.c, spa/examples/adapter-control.c, video-dsp-src.c, video-play.c, and video-src.c.

## ◆ SPA_DICT_FLAG_SORTED

#define SPA_DICT_FLAG_SORTED (1<<0)

items are sorted

## ◆ SPA_DICT_INIT

#define SPA_DICT_INIT | ( |  | items,
|  |  | n_items )

Value:
((struct spa_dict) { 0, (n_items), (items) })
spa_dict
Definition dict.h:39
spa_dict::items
const struct spa_dict_item * items
Definition dict.h:44
spa_dict::n_items
uint32_t n_items
Definition dict.h:43

Examples
  spa/examples/adapter-control.c, video-dsp-src.c, video-play.c, and video-src.c.

## ◆ SPA_DICT_INIT_ARRAY

#define SPA_DICT_INIT_ARRAY | ( |  | items | ) |

Value:
((struct spa_dict) { 0, SPA_N_ELEMENTS(items), (items) })
SPA_N_ELEMENTS
#define SPA_N_ELEMENTS(arr)
Definition defs.h:143

Examples
  export-source.c.

## ◆ spa_dict_for_each

#define spa_dict_for_each | ( |  | item,
|  |  | dict )

Examples
  tutorial6.c.

## Function Documentation

## ◆ spa_dict_item_compare()

static int spa_dict_item_compare | ( | const void * | i1,
|  | const void * | i2 )
| inline static

## ◆ spa_dict_qsort()

static void spa_dict_qsort | ( | struct spa_dict * | dict | ) |
| inline static

## ◆ spa_dict_lookup_item()

static const struct spa_dict_item * spa_dict_lookup_item | ( | const struct spa_dict * | dict,
|  | const char * | key )
| inline static

## ◆ spa_dict_lookup()

static const char * spa_dict_lookup | ( | const struct spa_dict * | dict,
|  | const char * | key )
| inline static