lib: move `bt_value` structures to `value-internal.h`
[babeltrace.git] / lib / value.c
index e4a0d1e4dc6420eaf7ce670c2dc28b5254092f33..07985ea84b7cbbe9d428407d571553fbaf2a51f0 100644 (file)
@@ -1,6 +1,5 @@
 /*
- * Copyright (c) 2015 EfficiOS Inc. and Linux Foundation
- * Copyright (c) 2015 Philippe Proulx <pproulx@efficios.com>
+ * Copyright (c) 2015-2018 Philippe Proulx <pproulx@efficios.com>
  *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this software and associated documentation files (the "Software"), to deal
 #include <inttypes.h>
 #include <babeltrace/compiler-internal.h>
 #include <babeltrace/common-internal.h>
-#include <babeltrace/object.h>
 #include <babeltrace/value-const.h>
 #include <babeltrace/value.h>
 #include <babeltrace/compat/glib-internal.h>
 #include <babeltrace/types.h>
-#include <babeltrace/object-internal.h>
+#include <babeltrace/assert-pre-internal.h>
 #include <babeltrace/value-internal.h>
 #include <babeltrace/assert-internal.h>
-#include <babeltrace/assert-pre-internal.h>
 
 #define BT_VALUE_FROM_CONCRETE(_concrete) ((struct bt_value *) (_concrete))
 #define BT_VALUE_TO_BOOL(_base) ((struct bt_value_bool *) (_base))
                "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,37 +80,7 @@ struct bt_value bt_value_null_instance = {
        .frozen = BT_TRUE,
 };
 
-struct bt_value *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;
-};
+struct bt_value *const bt_value_null = &bt_value_null_instance;
 
 static
 void bt_value_destroy(struct bt_object *obj);
@@ -1300,3 +1261,13 @@ bt_bool bt_value_compare(const struct bt_value *object_a,
 end:
        return ret;
 }
+
+void bt_value_get_ref(const struct bt_value *value)
+{
+       bt_object_get_ref(value);
+}
+
+void bt_value_put_ref(const struct bt_value *value)
+{
+       bt_object_put_ref(value);
+}
This page took 0.02585 seconds and 4 git commands to generate.