.gitignore: add some more IDE / tools related file
[babeltrace.git] / src / lib / error.c
index bd8259ab71057103385d75b711ffd59a5508007a..77064005dc3ddfcc24e3ac1b6830635bbb0a8591 100644 (file)
 #include <babeltrace2/babeltrace.h>
 
 #include "error.h"
-#include "graph/message/iterator.h"
 #include "graph/component.h"
 #include "graph/component-class.h"
+#include "graph/iterator.h"
 #include "common/assert.h"
+#include "common/common.h"
 #include "lib/assert-cond.h"
 #include "lib/func-status.h"
 
@@ -155,8 +156,6 @@ int init_error_cause(struct bt_error_cause *cause,
                goto end;
        }
 
-       BT_LIB_LOGD("Initialized error cause: %!+r", cause);
-
 end:
        return ret;
 }
@@ -420,7 +419,6 @@ end:
        return cause;
 }
 
-BT_HIDDEN
 struct bt_error *bt_error_create(void)
 {
        struct bt_error *error;
@@ -450,7 +448,6 @@ end:
        return error;
 }
 
-BT_HIDDEN
 void bt_error_destroy(struct bt_error *error)
 {
        if (!error) {
@@ -468,7 +465,6 @@ end:
        return;
 }
 
-BT_HIDDEN
 int bt_error_append_cause_from_unknown(struct bt_error *error,
                const char *module_name, const char *file_name,
                uint64_t line_no, const char *msg_fmt, va_list args)
@@ -496,11 +492,9 @@ int bt_error_append_cause_from_unknown(struct bt_error *error,
        cause = NULL;
 
 end:
-       destroy_error_cause(cause);
        return status;
 }
 
-BT_HIDDEN
 int bt_error_append_cause_from_component(
                struct bt_error *error, bt_self_component *self_comp,
                const char *file_name, uint64_t line_no,
@@ -529,14 +523,9 @@ int bt_error_append_cause_from_component(
        cause = NULL;
 
 end:
-       if (cause) {
-               destroy_error_cause(&cause->base);
-       }
-
        return status;
 }
 
-BT_HIDDEN
 int bt_error_append_cause_from_component_class(
                struct bt_error *error,
                bt_self_component_class *self_comp_class,
@@ -566,14 +555,9 @@ int bt_error_append_cause_from_component_class(
        cause = NULL;
 
 end:
-       if (cause) {
-               destroy_error_cause(&cause->base);
-       }
-
        return status;
 }
 
-BT_HIDDEN
 int bt_error_append_cause_from_message_iterator(
                struct bt_error *error, bt_self_message_iterator *self_iter,
                const char *file_name, uint64_t line_no,
@@ -602,10 +586,6 @@ int bt_error_append_cause_from_message_iterator(
        cause = NULL;
 
 end:
-       if (cause) {
-               destroy_error_cause(&cause->base);
-       }
-
        return status;
 }
 
@@ -615,18 +595,21 @@ uint64_t error_cause_count(const bt_error *error)
        return error->causes ? error->causes->len : 0;
 }
 
+BT_EXPORT
 uint64_t bt_error_get_cause_count(const bt_error *error)
 {
        BT_ASSERT_PRE_ERROR_NON_NULL(error);
        return error_cause_count(error);
 }
 
+BT_EXPORT
 void bt_error_release(const struct bt_error *error)
 {
        BT_ASSERT_PRE_ERROR_NON_NULL(error);
        bt_error_destroy((void *) error);
 }
 
+BT_EXPORT
 const struct bt_error_cause *bt_error_borrow_cause_by_index(
                const bt_error *error, uint64_t index)
 {
@@ -635,6 +618,7 @@ const struct bt_error_cause *bt_error_borrow_cause_by_index(
        return error->causes->pdata[index];
 }
 
+BT_EXPORT
 enum bt_error_cause_actor_type bt_error_cause_get_actor_type(
                const struct bt_error_cause *cause)
 {
@@ -642,30 +626,35 @@ enum bt_error_cause_actor_type bt_error_cause_get_actor_type(
        return cause->actor_type;
 }
 
+BT_EXPORT
 const char *bt_error_cause_get_message(const struct bt_error_cause *cause)
 {
        BT_ASSERT_PRE_ERROR_CAUSE_NON_NULL(cause);
        return cause->message->str;
 }
 
+BT_EXPORT
 const char *bt_error_cause_get_module_name(const struct bt_error_cause *cause)
 {
        BT_ASSERT_PRE_ERROR_CAUSE_NON_NULL(cause);
        return cause->module_name->str;
 }
 
+BT_EXPORT
 const char *bt_error_cause_get_file_name(const struct bt_error_cause *cause)
 {
        BT_ASSERT_PRE_ERROR_CAUSE_NON_NULL(cause);
        return cause->file_name->str;
 }
 
+BT_EXPORT
 uint64_t bt_error_cause_get_line_number(const bt_error_cause *cause)
 {
        BT_ASSERT_PRE_ERROR_CAUSE_NON_NULL(cause);
        return cause->line_no;
 }
 
+BT_EXPORT
 const char *bt_error_cause_component_actor_get_component_name(
                const struct bt_error_cause *cause)
 {
@@ -678,6 +667,7 @@ const char *bt_error_cause_component_actor_get_component_name(
        return spec_cause->comp_name->str;
 }
 
+BT_EXPORT
 bt_component_class_type bt_error_cause_component_actor_get_component_class_type(
                const struct bt_error_cause *cause)
 {
@@ -690,6 +680,7 @@ bt_component_class_type bt_error_cause_component_actor_get_component_class_type(
        return spec_cause->comp_class_id.type;
 }
 
+BT_EXPORT
 const char *bt_error_cause_component_actor_get_component_class_name(
                const struct bt_error_cause *cause)
 {
@@ -702,6 +693,7 @@ const char *bt_error_cause_component_actor_get_component_class_name(
        return spec_cause->comp_class_id.name->str;
 }
 
+BT_EXPORT
 const char *bt_error_cause_component_actor_get_plugin_name(
                const struct bt_error_cause *cause)
 {
@@ -715,6 +707,7 @@ const char *bt_error_cause_component_actor_get_plugin_name(
                spec_cause->comp_class_id.plugin_name->str : NULL;
 }
 
+BT_EXPORT
 bt_component_class_type
 bt_error_cause_component_class_actor_get_component_class_type(
                const struct bt_error_cause *cause)
@@ -728,6 +721,7 @@ bt_error_cause_component_class_actor_get_component_class_type(
        return spec_cause->comp_class_id.type;
 }
 
+BT_EXPORT
 const char *bt_error_cause_component_class_actor_get_component_class_name(
                const struct bt_error_cause *cause)
 {
@@ -740,6 +734,7 @@ const char *bt_error_cause_component_class_actor_get_component_class_name(
        return spec_cause->comp_class_id.name->str;
 }
 
+BT_EXPORT
 const char *bt_error_cause_component_class_actor_get_plugin_name(
                const struct bt_error_cause *cause)
 {
@@ -753,6 +748,7 @@ const char *bt_error_cause_component_class_actor_get_plugin_name(
                spec_cause->comp_class_id.plugin_name->str : NULL;
 }
 
+BT_EXPORT
 const char *bt_error_cause_message_iterator_actor_get_component_name(
                const struct bt_error_cause *cause)
 {
@@ -765,6 +761,7 @@ const char *bt_error_cause_message_iterator_actor_get_component_name(
        return spec_cause->comp_name->str;
 }
 
+BT_EXPORT
 const char *
 bt_error_cause_message_iterator_actor_get_component_output_port_name(
                const struct bt_error_cause *cause)
@@ -778,6 +775,7 @@ bt_error_cause_message_iterator_actor_get_component_output_port_name(
        return spec_cause->output_port_name->str;
 }
 
+BT_EXPORT
 bt_component_class_type
 bt_error_cause_message_iterator_actor_get_component_class_type(
                const struct bt_error_cause *cause)
@@ -791,6 +789,7 @@ bt_error_cause_message_iterator_actor_get_component_class_type(
        return spec_cause->comp_class_id.type;
 }
 
+BT_EXPORT
 const char *bt_error_cause_message_iterator_actor_get_component_class_name(
                const struct bt_error_cause *cause)
 {
@@ -803,6 +802,7 @@ const char *bt_error_cause_message_iterator_actor_get_component_class_name(
        return spec_cause->comp_class_id.name->str;
 }
 
+BT_EXPORT
 const char *bt_error_cause_message_iterator_actor_get_plugin_name(
                const struct bt_error_cause *cause)
 {
This page took 0.026196 seconds and 4 git commands to generate.