Commit | Line | Data |
---|---|---|
8bf65fbd | 1 | /* |
0235b0db | 2 | * SPDX-License-Identifier: MIT |
8bf65fbd | 3 | * |
0235b0db | 4 | * Copyright (c) 2018 Philippe Proulx <pproulx@efficios.com> |
8bf65fbd JG |
5 | */ |
6 | ||
0235b0db MJ |
7 | #ifndef BABELTRACE_PROPERTY_INTERNAL_H |
8 | #define BABELTRACE_PROPERTY_INTERNAL_H | |
9 | ||
578e048b | 10 | #include "common/assert.h" |
4fa90f32 | 11 | #include <babeltrace2/babeltrace.h> |
44c440bc PP |
12 | #include <glib.h> |
13 | #include <stdint.h> | |
44c440bc | 14 | #include <string.h> |
8bf65fbd | 15 | |
44c440bc PP |
16 | struct bt_property { |
17 | enum bt_property_availability avail; | |
18 | }; | |
8bf65fbd | 19 | |
44c440bc PP |
20 | struct bt_property_uint { |
21 | struct bt_property base; | |
22 | uint64_t value; | |
8bf65fbd JG |
23 | }; |
24 | ||
44c440bc PP |
25 | static inline |
26 | void bt_property_uint_set(struct bt_property_uint *prop, uint64_t value) | |
27 | { | |
28 | BT_ASSERT(prop); | |
29 | prop->base.avail = BT_PROPERTY_AVAILABILITY_AVAILABLE; | |
30 | prop->value = value; | |
31 | } | |
32 | ||
33 | static inline | |
34 | void bt_property_uint_init(struct bt_property_uint *prop, | |
35 | enum bt_property_availability avail, uint64_t value) | |
36 | { | |
37 | BT_ASSERT(prop); | |
38 | prop->base.avail = avail; | |
39 | prop->value = value; | |
40 | } | |
8bf65fbd | 41 | |
44c440bc | 42 | #endif /* BABELTRACE_PROPERTY_INTERNAL_H */ |