PipeWire 0.2.5

Data Structures | Macros
map.h File Reference
Include dependency graph for map.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Data Structures
union | pw_map_item
| An entry in the map. More...
class | pw_map
| A map. More...

## Macros
#define | PW_MAP_INIT(extend) (struct pw_map) { PW_ARRAY_INIT(extend), 0 }
#define | pw_map_get_size(m) pw_array_get_len(&(m)->items, union pw_map_item)
#define | pw_map_get_item(m, id) pw_array_get_unchecked(&(m)->items,id,union pw_map_item)
#define | pw_map_item_is_free(item) ((item)->next & 0x1)
#define | pw_map_id_is_free(m, id) (pw_map_item_is_free(pw_map_get_item(m,id)))
#define | pw_map_check_id(m, id) ((id) < pw_map_get_size(m))
#define | pw_map_has_item(m, id) (pw_map_check_id(m,id) && !pw_map_id_is_free(m, id))
#define | pw_map_lookup_unchecked(m, id) pw_map_get_item(m,id)->data

## Macro Definition Documentation

## ◆ pw_map_check_id

#define pw_map_check_id | ( |  | m,
|  |  | id
| ) |  | ((id) < pw_map_get_size(m))

Referenced by pw_map::pw_map_lookup().

## ◆ pw_map_get_item

#define pw_map_get_item | ( |  | m,
|  |  | id
| ) |  | pw_array_get_unchecked(&(m)->items,id,union pw_map_item)

Referenced by pw_map::pw_map_insert_at(), pw_map::pw_map_lookup(), and pw_map::pw_map_remove().

## ◆ pw_map_get_size

#define pw_map_get_size | ( |  | m | ) | pw_array_get_len(&(m)->items, union pw_map_item)

Referenced by pw_map::pw_map_insert_at().

## ◆ pw_map_has_item

#define pw_map_has_item | ( |  | m,
|  |  | id
| ) |  | (pw_map_check_id(m,id) && !pw_map_id_is_free(m, id))

## ◆ pw_map_id_is_free

#define pw_map_id_is_free | ( |  | m,
|  |  | id
| ) |  | (pw_map_item_is_free(pw_map_get_item(m,id)))

## ◆ PW_MAP_INIT

#define PW_MAP_INIT | ( |  | extend | ) | (struct pw_map) { PW_ARRAY_INIT(extend), 0 }

## ◆ pw_map_item_is_free

#define pw_map_item_is_free | ( |  | item | ) | ((item)->next & 0x1)

Referenced by pw_map::pw_map_for_each(), and pw_map::pw_map_lookup().

## ◆ pw_map_lookup_unchecked

#define pw_map_lookup_unchecked | ( |  | m,
|  |  | id
| ) |  | pw_map_get_item(m,id)->data