From f1567d42d9ac021ba18e64d1fb9327ccf5b18999 Mon Sep 17 00:00:00 2001 From: Philippe Proulx Date: Fri, 3 May 2019 11:24:23 -0400 Subject: [PATCH] lib: move `bt_value` structures to `value-internal.h` MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit It's unusual to have internal structures in the C file. To remain consistent with the rest of the library, put them in the internal header. Signed-off-by: Philippe Proulx Change-Id: I5a946004a172560acecab1b182214293f61f02fd Reviewed-on: https://review.lttng.org/c/babeltrace/+/1255 CI-Build: Jérémie Galarneau Tested-by: jenkins --- include/babeltrace/value-internal.h | 39 +++++++++++++++++++++++++++++ lib/value.c | 37 --------------------------- 2 files changed, 39 insertions(+), 37 deletions(-) diff --git a/include/babeltrace/value-internal.h b/include/babeltrace/value-internal.h index b4368f56..dd3fb7d9 100644 --- a/include/babeltrace/value-internal.h +++ b/include/babeltrace/value-internal.h @@ -23,8 +23,47 @@ * SOFTWARE. */ +#include #include #include +#include +#include + +struct bt_value { + struct bt_object base; + enum bt_value_type type; + bt_bool frozen; +}; + +struct bt_value_bool { + struct bt_value base; + bt_bool value; +}; + +struct bt_value_integer { + struct bt_value base; + int64_t value; +}; + +struct bt_value_real { + struct bt_value base; + double value; +}; + +struct bt_value_string { + struct bt_value base; + GString *gstr; +}; + +struct bt_value_array { + struct bt_value base; + GPtrArray *garray; +}; + +struct bt_value_map { + struct bt_value base; + GHashTable *ght; +}; BT_HIDDEN enum bt_value_status _bt_value_freeze(const struct bt_value *object); diff --git a/lib/value.c b/lib/value.c index 83168e74..07985ea8 100644 --- a/lib/value.c +++ b/lib/value.c @@ -34,7 +34,6 @@ #include #include #include -#include #include #include @@ -61,12 +60,6 @@ "Index is out of bound: " \ "index=%" PRIu64 ", count=%u", (_index), (_count)); -struct bt_value { - struct bt_object base; - enum bt_value_type type; - bt_bool frozen; -}; - static void bt_value_null_instance_release_func(struct bt_object *obj) { @@ -89,36 +82,6 @@ struct bt_value bt_value_null_instance = { struct bt_value *const bt_value_null = &bt_value_null_instance; -struct bt_value_bool { - struct bt_value base; - bt_bool value; -}; - -struct bt_value_integer { - struct bt_value base; - int64_t value; -}; - -struct bt_value_real { - struct bt_value base; - double value; -}; - -struct bt_value_string { - struct bt_value base; - GString *gstr; -}; - -struct bt_value_array { - struct bt_value base; - GPtrArray *garray; -}; - -struct bt_value_map { - struct bt_value base; - GHashTable *ght; -}; - static void bt_value_destroy(struct bt_object *obj); -- 2.34.1