Commit | Line | Data |
---|---|---|
c4628760 | 1 | /* |
0235b0db | 2 | * SPDX-License-Identifier: MIT |
c4628760 | 3 | * |
0235b0db | 4 | * Copyright (c) 2015-2018 Philippe Proulx <pproulx@efficios.com> |
c4628760 PP |
5 | */ |
6 | ||
0235b0db MJ |
7 | #ifndef BABELTRACE_VALUES_INTERNAL_H |
8 | #define BABELTRACE_VALUES_INTERNAL_H | |
9 | ||
f1567d42 | 10 | #include <glib.h> |
4fa90f32 PP |
11 | #include <babeltrace2/babeltrace.h> |
12 | ||
13 | #include "lib/object.h" | |
91d81473 | 14 | #include "common/macros.h" |
f1567d42 PP |
15 | |
16 | struct bt_value { | |
17 | struct bt_object base; | |
18 | enum bt_value_type type; | |
19 | bt_bool frozen; | |
20 | }; | |
21 | ||
22 | struct bt_value_bool { | |
23 | struct bt_value base; | |
24 | bt_bool value; | |
25 | }; | |
26 | ||
27 | struct bt_value_integer { | |
28 | struct bt_value base; | |
fdd3a2da PP |
29 | union { |
30 | uint64_t i; | |
31 | int64_t u; | |
32 | } value; | |
f1567d42 PP |
33 | }; |
34 | ||
35 | struct bt_value_real { | |
36 | struct bt_value base; | |
37 | double value; | |
38 | }; | |
39 | ||
40 | struct bt_value_string { | |
41 | struct bt_value base; | |
42 | GString *gstr; | |
43 | }; | |
44 | ||
45 | struct bt_value_array { | |
46 | struct bt_value base; | |
47 | GPtrArray *garray; | |
48 | }; | |
49 | ||
50 | struct bt_value_map { | |
51 | struct bt_value base; | |
52 | GHashTable *ght; | |
53 | }; | |
c4628760 | 54 | |
f6ccaed9 | 55 | BT_HIDDEN |
d24d5663 | 56 | void _bt_value_freeze(const struct bt_value *object); |
f6ccaed9 PP |
57 | |
58 | #ifdef BT_DEV_MODE | |
59 | # define bt_value_freeze _bt_value_freeze | |
60 | #else | |
61 | # define bt_value_freeze(_value) | |
62 | #endif /* BT_DEV_MODE */ | |
63 | ||
c4628760 | 64 | #endif /* BABELTRACE_VALUES_INTERNAL_H */ |