Move to kernel style SPDX license identifiers
[babeltrace.git] / src / python-plugin-provider / python-plugin-provider.c
index 5bb4e33b729085ea080d887750ca817fafd54da3..78026d6a1fd87e6ddb6883c0ff61fae4eecc964b 100644 (file)
@@ -1,40 +1,25 @@
 /*
- * python-plugin-provider.c
- *
- * Babeltrace Python plugin provider
+ * SPDX-License-Identifier: MIT
  *
  * Copyright 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.
+ * Babeltrace Python plugin provider
  */
 
 #define BT_LOG_TAG "LIB/PLUGIN-PY"
-
 #include "lib/logging.h"
+
+#include "python-plugin-provider.h"
+
 #include "common/macros.h"
 #include "compat/compiler.h"
-#include <babeltrace2/plugin/plugin-const.h>
+#include <babeltrace2/plugin/plugin-loading.h>
 #include "lib/plugin/plugin.h"
 #include <babeltrace2/graph/component-class.h>
-#include <babeltrace2/current-thread.h>
+#include <babeltrace2/error-reporting.h>
 #include "lib/graph/component-class.h"
 #include "py-common/py-common.h"
+#include <stdbool.h>
 #include <stdlib.h>
 #include <signal.h>
 #include <Python.h>
@@ -46,7 +31,7 @@
 #define PYTHON_PLUGIN_FILE_EXT         ".py"
 #define PYTHON_PLUGIN_FILE_EXT_LEN     (sizeof(PYTHON_PLUGIN_FILE_EXT) - 1)
 
-enum python_state {
+static enum python_state {
        /* init_python() not called yet */
        PYTHON_STATE_NOT_INITED,
 
@@ -79,7 +64,7 @@ void append_python_traceback_error_cause(void)
                }
 
                (void) BT_CURRENT_THREAD_ERROR_APPEND_CAUSE_FROM_UNKNOWN(
-                       "Babeltrace library", "%s", exc->str);
+                       BT_LIB_LOG_LIBBABELTRACE2_NAME, "%s", exc->str);
        }
 
 end:
@@ -101,7 +86,7 @@ void log_python_traceback(int log_level)
                }
 
                BT_LOG_WRITE(log_level, BT_LOG_TAG,
-                       "Exception occured: Python traceback:\n%s", exc->str);
+                       "Exception occurred: Python traceback:\n%s", exc->str);
        }
 
 end:
@@ -140,7 +125,7 @@ int init_python(void)
                ret = BT_FUNC_STATUS_ERROR;
                goto end;
        default:
-               abort();
+               bt_common_abort();
        }
 
        /*
This page took 0.028296 seconds and 4 git commands to generate.