Fix: lib: pass down API function name to some helpers
[babeltrace.git] / src / lib / property.h
CommitLineData
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
16struct bt_property {
17 enum bt_property_availability avail;
18};
8bf65fbd 19
44c440bc
PP
20struct bt_property_uint {
21 struct bt_property base;
22 uint64_t value;
8bf65fbd
JG
23};
24
44c440bc
PP
25static inline
26void 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
33static inline
34void 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 */
This page took 0.081657 seconds and 4 git commands to generate.