Move to kernel style SPDX license identifiers
[babeltrace.git] / src / bindings / python / bt2 / bt2 / native_bt_value.i
index 8072614d4f7f756a4ae724df11bff65f576953b8..28bec6bbb9c956c68648487d206d3575e33d5c42 100644 (file)
@@ -1,74 +1,13 @@
 /*
- * The MIT License (MIT)
+ * SPDX-License-Identifier: MIT
  *
  * Copyright (c) 2016 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.
  */
 
-%include <babeltrace2/value-const.h>
 %include <babeltrace2/value.h>
 
 %{
-struct bt_value_map_get_keys_data {
-       struct bt_value *keys;
-};
-
-static int bt_value_map_get_keys_cb(const char *key, const struct bt_value *object, void *data)
-{
-       enum bt_value_status status;
-       struct bt_value_map_get_keys_data *priv_data = data;
-
-       status = bt_value_array_append_string_element(priv_data->keys, key);
-       if (status != BT_VALUE_STATUS_OK) {
-               return BT_FALSE;
-       }
-
-       return BT_TRUE;
-}
-
-static struct bt_value *bt_value_map_get_keys(const struct bt_value *map_obj)
-{
-       enum bt_value_status status;
-       struct bt_value_map_get_keys_data data;
-
-       data.keys = bt_value_array_create();
-       if (!data.keys) {
-               return NULL;
-       }
-
-       status = bt_value_map_foreach_entry_const(map_obj, bt_value_map_get_keys_cb,
-               &data);
-       if (status != BT_VALUE_STATUS_OK) {
-               goto error;
-       }
-
-       goto end;
-
-error:
-       if (data.keys) {
-               BT_VALUE_PUT_REF_AND_RESET(data.keys);
-       }
-
-end:
-       return data.keys;
-}
+#include "native_bt_value.i.h"
 %}
 
 struct bt_value *bt_value_map_get_keys(const struct bt_value *map_obj);
This page took 0.041066 seconds and 4 git commands to generate.