Move ABI headers under side/abi/
[libside.git] / include / side / abi / attribute.h
1 // SPDX-License-Identifier: MIT
2 /*
3 * Copyright 2022-2023 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
4 */
5
6 #ifndef SIDE_ABI_ATTRIBUTE_H
7 #define SIDE_ABI_ATTRIBUTE_H
8
9 #include <stdint.h>
10 #include <side/macros.h>
11 #include <side/endian.h>
12
13 #include <side/abi/type-value.h>
14
15 enum side_attr_type {
16 SIDE_ATTR_TYPE_NULL,
17 SIDE_ATTR_TYPE_BOOL,
18 SIDE_ATTR_TYPE_U8,
19 SIDE_ATTR_TYPE_U16,
20 SIDE_ATTR_TYPE_U32,
21 SIDE_ATTR_TYPE_U64,
22 SIDE_ATTR_TYPE_S8,
23 SIDE_ATTR_TYPE_S16,
24 SIDE_ATTR_TYPE_S32,
25 SIDE_ATTR_TYPE_S64,
26 SIDE_ATTR_TYPE_FLOAT_BINARY16,
27 SIDE_ATTR_TYPE_FLOAT_BINARY32,
28 SIDE_ATTR_TYPE_FLOAT_BINARY64,
29 SIDE_ATTR_TYPE_FLOAT_BINARY128,
30 SIDE_ATTR_TYPE_STRING,
31
32 _NR_SIDE_ATTR_TYPE, /* Last entry. */
33 };
34
35 struct side_attr_value {
36 side_enum_t(enum side_attr_type, uint32_t) type;
37 union {
38 uint8_t bool_value;
39 struct side_type_raw_string string_value;
40 union side_integer_value integer_value;
41 union side_float_value float_value;
42 side_padding(32);
43 } SIDE_PACKED u;
44 };
45 side_check_size(struct side_attr_value, 36);
46
47 struct side_attr {
48 const struct side_type_raw_string key;
49 const struct side_attr_value value;
50 } SIDE_PACKED;
51 side_check_size(struct side_attr, 54);
52
53 #endif /* SIDE_ABI_ATTRIBUTE_H */
This page took 0.029494 seconds and 4 git commands to generate.