lib: make bt_value_map_foreach_entry_{const_}func() return a status code
[babeltrace.git] / src / plugins / common / param-validation / param-validation.c
index b52332bcaac106cb6a8f4f2b44947abd43f45cc5..216f274241dd9c3f62e56dbb84fa73499c190737 100644 (file)
@@ -25,6 +25,7 @@
 #include <babeltrace2/babeltrace.h>
 #include <glib.h>
 #include <inttypes.h>
+#include <stdbool.h>
 
 #include "common/common.h"
 
@@ -95,7 +96,7 @@ void append_scope_to_string(GString *str,
                g_string_append_printf(str, "[%" PRIu64 "]", elem->array_index);
                break;
        default:
-               abort();
+               bt_common_abort();
        }
 }
 
@@ -155,8 +156,8 @@ enum bt_param_validation_status validate_value(
                struct bt_param_validation_context *ctx);
 
 static
-bt_bool validate_map_value_entry(const char *key,
-               const bt_value *value, void *v_data)
+bt_value_map_foreach_entry_const_func_status validate_map_value_entry(
+               const char *key, const bt_value *value, void *v_data)
 {
        struct validate_map_value_data *data = v_data;
        const struct bt_param_validation_map_value_entry_descr *entry = NULL;
@@ -191,7 +192,9 @@ bt_bool validate_map_value_entry(const char *key,
        }
 
        /* Continue iterating if everything is good so far. */
-       return data->status == BT_PARAM_VALIDATION_STATUS_OK;
+       return data->status == BT_PARAM_VALIDATION_STATUS_OK ?
+               BT_VALUE_MAP_FOREACH_ENTRY_CONST_FUNC_STATUS_OK :
+               BT_VALUE_MAP_FOREACH_ENTRY_CONST_FUNC_STATUS_INTERRUPT;
 }
 
 static
This page took 0.024501 seconds and 4 git commands to generate.