Move to kernel style SPDX license identifiers
[babeltrace.git] / src / bindings / python / bt2 / bt2 / native_bt_message_iterator.i.h
index 76b2c876d26a03bbd2d42d15d633c318d4a6be1b..35c2612aac07409c38fc480c276af78f587d26e2 100644 (file)
@@ -1,59 +1,43 @@
 /*
- * The MIT License (MIT)
+ * SPDX-License-Identifier: MIT
  *
  * Copyright (c) 2017 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
- * 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:
- *
- * 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.
  */
 
-bt_self_component_port_input_message_iterator_create_from_message_iterator_status
-bt_bt2_self_component_port_input_message_iterator_create_from_message_iterator(
+static
+bt_message_iterator_create_from_message_iterator_status
+bt_bt2_message_iterator_create_from_message_iterator(
                bt_self_message_iterator *self_msg_iter,
                bt_self_component_port_input *input_port,
-               bt_self_component_port_input_message_iterator **message_iterator)
+               bt_message_iterator **message_iterator)
 {
-       bt_self_component_port_input_message_iterator_create_from_message_iterator_status
+       bt_message_iterator_create_from_message_iterator_status
                status;
 
-       status = bt_self_component_port_input_message_iterator_create_from_message_iterator(
+       status = bt_message_iterator_create_from_message_iterator(
                self_msg_iter, input_port, message_iterator);
 
-       if (status != BT_SELF_COMPONENT_PORT_INPUT_MESSAGE_ITERATOR_CREATE_FROM_MESSAGE_ITERATOR_STATUS_OK) {
+       if (status != BT_MESSAGE_ITERATOR_CREATE_FROM_MESSAGE_ITERATOR_STATUS_OK) {
                *message_iterator = NULL;
        }
 
        return status;
 }
 
-bt_self_component_port_input_message_iterator_create_from_sink_component_status
-bt_bt2_self_component_port_input_message_iterator_create_from_sink_component(
+static
+bt_message_iterator_create_from_sink_component_status
+bt_bt2_message_iterator_create_from_sink_component(
                bt_self_component_sink *self_comp,
                bt_self_component_port_input *input_port,
-               bt_self_component_port_input_message_iterator **message_iterator)
+               bt_message_iterator **message_iterator)
 {
-       bt_self_component_port_input_message_iterator_create_from_sink_component_status
+       bt_message_iterator_create_from_sink_component_status
                status;
 
-       status = bt_self_component_port_input_message_iterator_create_from_sink_component(
+       status = bt_message_iterator_create_from_sink_component(
                self_comp, input_port, message_iterator);
 
-       if (status != BT_SELF_COMPONENT_PORT_INPUT_MESSAGE_ITERATOR_CREATE_FROM_SINK_COMPONENT_STATUS_OK) {
+       if (status != BT_MESSAGE_ITERATOR_CREATE_FROM_SINK_COMPONENT_STATUS_OK) {
                *message_iterator = NULL;
        }
 
@@ -66,9 +50,9 @@ static PyObject *bt_bt2_get_user_component_from_user_msg_iter(
        bt_self_component *self_component = bt_self_message_iterator_borrow_component(self_message_iterator);
        PyObject *py_comp;
 
-       BT_ASSERT(self_component);
+       BT_ASSERT_DBG(self_component);
        py_comp = bt_self_component_get_data(self_component);
-       BT_ASSERT(py_comp);
+       BT_ASSERT_DBG(py_comp);
 
        /* Return new reference */
        Py_INCREF(py_comp);
@@ -122,13 +106,13 @@ PyObject *get_msg_range_common(bt_message_iterator_next_status status,
 }
 
 static PyObject *bt_bt2_self_component_port_input_get_msg_range(
-               bt_self_component_port_input_message_iterator *iter)
+               bt_message_iterator *iter)
 {
        bt_message_array_const messages;
        uint64_t message_count = 0;
        bt_message_iterator_next_status status;
 
-       status = bt_self_component_port_input_message_iterator_next(iter,
+       status = bt_message_iterator_next(iter,
                &messages, &message_count);
        return get_msg_range_common(status, messages, message_count);
 }
This page took 0.025842 seconds and 4 git commands to generate.