Extensible Connection-oriented Messaging (XCM)
Loading...
Searching...
No Matches
xcm_attr.h
Go to the documentation of this file.
1/*
2 * SPDX-License-Identifier: BSD-3-Clause
3 * Copyright(c) 2020 Ericsson AB
4 */
5
6#ifndef XCM_ATTR_H
7#define XCM_ATTR_H
8#ifdef __cplusplus
9extern "C" {
10#endif
11
18#include <stdbool.h>
19#include <xcm.h>
20#include <xcm_attr_types.h>
21
44int xcm_attr_set(struct xcm_socket *socket, const char *name,
45 enum xcm_attr_type type, const void *value, size_t len);
46
59int xcm_attr_set_bool(struct xcm_socket *socket, const char *name, bool value);
60
73int xcm_attr_set_int64(struct xcm_socket *socket, const char *name,
74 int64_t value);
75
88int xcm_attr_set_double(struct xcm_socket *socket, const char *name,
89 double value);
90
103int xcm_attr_set_str(struct xcm_socket *socket, const char *name,
104 const char *value);
105
131int xcm_attr_get(struct xcm_socket *socket, const char *name,
132 enum xcm_attr_type *type, void *value, size_t capacity);
133
150int xcm_attr_get_bool(struct xcm_socket *socket, const char *name,
151 bool *value);
152
169int xcm_attr_get_int64(struct xcm_socket *socket, const char *name,
170 int64_t *value);
171
188int xcm_attr_get_double(struct xcm_socket *socket, const char *name,
189 double *value);
190
209int xcm_attr_get_str(struct xcm_socket *socket, const char *name,
210 char *value, size_t capacity);
211
229int xcm_attr_get_bin(struct xcm_socket *socket, const char *name,
230 void *value, size_t capacity);
231
233typedef void (*xcm_attr_cb)(const char *attr_name, enum xcm_attr_type type,
234 void *value, size_t value_len, void *cb_data);
235
249void xcm_attr_get_all(struct xcm_socket *socket, xcm_attr_cb cb,
250 void *cb_data);
251
252#ifdef __cplusplus
253}
254#endif
255#endif
This file contains the core Extensible Connection-oriented Messaging (XCM) API.
int xcm_attr_set_double(struct xcm_socket *socket, const char *name, double value)
int xcm_attr_set(struct xcm_socket *socket, const char *name, enum xcm_attr_type type, const void *value, size_t len)
int xcm_attr_get_int64(struct xcm_socket *socket, const char *name, int64_t *value)
int xcm_attr_get_bin(struct xcm_socket *socket, const char *name, void *value, size_t capacity)
int xcm_attr_get_str(struct xcm_socket *socket, const char *name, char *value, size_t capacity)
int xcm_attr_set_int64(struct xcm_socket *socket, const char *name, int64_t value)
void xcm_attr_get_all(struct xcm_socket *socket, xcm_attr_cb cb, void *cb_data)
int xcm_attr_set_str(struct xcm_socket *socket, const char *name, const char *value)
int xcm_attr_set_bool(struct xcm_socket *socket, const char *name, bool value)
int xcm_attr_get(struct xcm_socket *socket, const char *name, enum xcm_attr_type *type, void *value, size_t capacity)
int xcm_attr_get_bool(struct xcm_socket *socket, const char *name, bool *value)
int xcm_attr_get_double(struct xcm_socket *socket, const char *name, double *value)
void(* xcm_attr_cb)(const char *attr_name, enum xcm_attr_type type, void *value, size_t value_len, void *cb_data)
Definition xcm_attr.h:233
This file contains type definitions for the XCM attribute access API.
xcm_attr_type
Definition xcm_attr_types.h:18