ctf: append error causes when returning errors
[babeltrace.git] / src / plugins / ctf / common / metadata / visitor-parent-links.c
index bfa3f0cf8c322066ed3f26f4c1fdd4ccfa4b10a6..5afcb0e6e19e6e21724baf0e169b1ca3d04f6799 100644 (file)
@@ -1,33 +1,15 @@
 /*
- * ctf-visitor-parent-links.c
+ * SPDX-License-Identifier: MIT
  *
- * Common Trace Format Metadata Parent Link Creator.
- *
- * Copyright 2010 - Mathieu Desnoyers <mathieu.desnoyers@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
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
+ * Copyright 2010 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
  *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
+ * Common Trace Format Metadata Parent Link Creator.
  */
 
 #define BT_COMP_LOG_SELF_COMP (log_cfg->self_comp)
 #define BT_LOG_OUTPUT_LEVEL (log_cfg->log_level)
 #define BT_LOG_TAG "PLUGIN/CTF/META/PARENT-LINKS-VISITOR"
-#include "plugins/comp-logging.h"
+#include "logging/comp-logging.h"
 
 #include <stdio.h>
 #include <unistd.h>
@@ -40,7 +22,6 @@
 #include "common/macros.h"
 #include "common/list.h"
 #include "scanner.h"
-#include "parser.h"
 #include "ast.h"
 #include "logging.h"
 
@@ -57,7 +38,7 @@ int ctf_visitor_unary_expression(int depth, struct ctf_node *node,
        case UNARY_DOTDOTDOT:
                break;
        default:
-               _BT_COMP_LOGE_LINENO(node->lineno,
+               _BT_COMP_LOGE_APPEND_CAUSE_LINENO(node->lineno,
                        "Unknown expression link type: type=%d\n",
                        node->u.unary_expression.link);
                return -EINVAL;
@@ -79,7 +60,7 @@ int ctf_visitor_unary_expression(int depth, struct ctf_node *node,
 
        case UNARY_UNKNOWN:
        default:
-               _BT_COMP_LOGE_LINENO(node->lineno,
+               _BT_COMP_LOGE_APPEND_CAUSE_LINENO(node->lineno,
                        "Unknown expression link type: type=%d\n",
                        node->u.unary_expression.link);
                return -EINVAL;
@@ -125,7 +106,7 @@ int ctf_visitor_type_specifier(int depth, struct ctf_node *node,
 
        case TYPESPEC_UNKNOWN:
        default:
-               _BT_COMP_LOGE_LINENO(node->lineno,
+               _BT_COMP_LOGE_APPEND_CAUSE_LINENO(node->lineno,
                        "Unknown type specifier: type=%d\n",
                        node->u.field_class_specifier.type);
                return -EINVAL;
@@ -183,7 +164,7 @@ int ctf_visitor_field_class_declarator(int depth, struct ctf_node *node,
                break;
        case TYPEDEC_UNKNOWN:
        default:
-               _BT_COMP_LOGE_LINENO(node->lineno,
+               _BT_COMP_LOGE_APPEND_CAUSE_LINENO(node->lineno,
                        "Unknown type declarator: type=%d\n",
                        node->u.field_class_declarator.type);
                return -EINVAL;
@@ -509,7 +490,7 @@ int ctf_visitor_parent_links(int depth, struct ctf_node *node,
 
        case NODE_UNKNOWN:
        default:
-               _BT_COMP_LOGE_LINENO(node->lineno,
+               _BT_COMP_LOGE_APPEND_CAUSE_LINENO(node->lineno,
                        "Unknown node type: type=%d\n", node->type);
                return -EINVAL;
        }
This page took 0.024644 seconds and 4 git commands to generate.