Extensible Connection-oriented Messaging (XCM)
Loading...
Searching...
No Matches
xcm_attr_map.h
Go to the documentation of this file.
1/*
2 * SPDX-License-Identifier: BSD-3-Clause
3 * Copyright(c) 2021 Ericsson AB
4 */
5
6#ifndef XCM_ATTR_MAP_H
7#define XCM_ATTR_MAP_H
8#ifdef __cplusplus
9extern "C" {
10#endif
11
22#include <xcm_attr_types.h>
23
24#include <stdbool.h>
25#include <stdint.h>
26#include <sys/types.h>
27
28struct xcm_attr_map;
29
30
36struct xcm_attr_map *xcm_attr_map_create(void);
37
38
46struct xcm_attr_map *xcm_attr_map_clone(const struct xcm_attr_map *original);
47
65void xcm_attr_map_add(struct xcm_attr_map *attr_map, const char *attr_name,
66 enum xcm_attr_type attr_type, const void *attr_value,
67 size_t attr_value_len);
68
69
79void xcm_attr_map_add_bool(struct xcm_attr_map *attr_map,
80 const char *attr_name,
81 bool attr_value);
82
83
93void xcm_attr_map_add_int64(struct xcm_attr_map *attr_map,
94 const char *attr_name,
95 int64_t attr_value);
96
97
107void xcm_attr_map_add_str(struct xcm_attr_map *attr_map,
108 const char *attr_name,
109 const char *attr_value);
110
111
128const void *xcm_attr_map_get(const struct xcm_attr_map *attr_map,
129 const char *attr_name,
130 enum xcm_attr_type *attr_type,
131 size_t *attr_value_len);
132
133
148const bool *xcm_attr_map_get_bool(const struct xcm_attr_map *attr_map,
149 const char *attr_name);
150
151
166const int64_t *xcm_attr_map_get_int64(const struct xcm_attr_map *attr_map,
167 const char *attr_name);
168
169
184const char *xcm_attr_map_get_str(const struct xcm_attr_map *attr_map,
185 const char *attr_name);
186
195bool xcm_attr_map_exists(const struct xcm_attr_map *attr_map,
196 const char *attr_name);
197
198
207void xcm_attr_map_del(struct xcm_attr_map *attr_map, const char *attr_name);
208
209
217size_t xcm_attr_map_size(const struct xcm_attr_map *attr_map);
218
219
223typedef void (*xcm_attr_map_foreach_cb)(const char *attr_name,
224 enum xcm_attr_type attr_type,
225 const void *attr_value,
226 size_t attr_value_len,
227 void *user);
228
229
242void xcm_attr_map_foreach(const struct xcm_attr_map *attr_map,
243 xcm_attr_map_foreach_cb cb, void *user);
244
245
254bool xcm_attr_map_equal(const struct xcm_attr_map *attr_map_a,
255 const struct xcm_attr_map *attr_map_b);
256
265void xcm_attr_map_destroy(struct xcm_attr_map *attr_map);
266
267#ifdef __cplusplus
268}
269#endif
270#endif
const bool * xcm_attr_map_get_bool(const struct xcm_attr_map *attr_map, const char *attr_name)
const int64_t * xcm_attr_map_get_int64(const struct xcm_attr_map *attr_map, const char *attr_name)
struct xcm_attr_map * xcm_attr_map_create(void)
void xcm_attr_map_foreach(const struct xcm_attr_map *attr_map, xcm_attr_map_foreach_cb cb, void *user)
void xcm_attr_map_add(struct xcm_attr_map *attr_map, const char *attr_name, enum xcm_attr_type attr_type, const void *attr_value, size_t attr_value_len)
struct xcm_attr_map * xcm_attr_map_clone(const struct xcm_attr_map *original)
void xcm_attr_map_add_str(struct xcm_attr_map *attr_map, const char *attr_name, const char *attr_value)
void xcm_attr_map_add_int64(struct xcm_attr_map *attr_map, const char *attr_name, int64_t attr_value)
bool xcm_attr_map_equal(const struct xcm_attr_map *attr_map_a, const struct xcm_attr_map *attr_map_b)
void xcm_attr_map_del(struct xcm_attr_map *attr_map, const char *attr_name)
const char * xcm_attr_map_get_str(const struct xcm_attr_map *attr_map, const char *attr_name)
void(* xcm_attr_map_foreach_cb)(const char *attr_name, enum xcm_attr_type attr_type, const void *attr_value, size_t attr_value_len, void *user)
Definition xcm_attr_map.h:223
size_t xcm_attr_map_size(const struct xcm_attr_map *attr_map)
void xcm_attr_map_add_bool(struct xcm_attr_map *attr_map, const char *attr_name, bool attr_value)
void xcm_attr_map_destroy(struct xcm_attr_map *attr_map)
bool xcm_attr_map_exists(const struct xcm_attr_map *attr_map, const char *attr_name)
const void * xcm_attr_map_get(const struct xcm_attr_map *attr_map, const char *attr_name, enum xcm_attr_type *attr_type, size_t *attr_value_len)
This file contains type definitions for the XCM attribute access API.
xcm_attr_type
Definition xcm_attr_types.h:18