lib: add bt_{graph,query_executor}_add_interrupter()
[babeltrace.git] / include / babeltrace2 / graph / query-executor.h
index bc5e5b86929b94658a7b0e5901c11d5e8a71714b..ef250462cc5fa79776291468c608110a07780012 100644 (file)
@@ -1,8 +1,8 @@
-#ifndef BABELTRACE_GRAPH_QUERY_EXECUTOR_H
-#define BABELTRACE_GRAPH_QUERY_EXECUTOR_H
+#ifndef BABELTRACE2_GRAPH_QUERY_EXECUTOR_H
+#define BABELTRACE2_GRAPH_QUERY_EXECUTOR_H
 
 /*
- * Copyright 2017-2018 Philippe Proulx <pproulx@efficios.com>
+ * Copyright (c) 2010-2019 EfficiOS Inc. and Linux Foundation
  *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this software and associated documentation files (the "Software"), to deal
  * SOFTWARE.
  */
 
-/* For bt_query_executor_status */
-#include <babeltrace2/graph/query-executor.h>
+#ifndef __BT_IN_BABELTRACE_H
+# error "Please include <babeltrace2/babeltrace.h> instead."
+#endif
 
-/* For bt_query_executor, bt_component_class, bt_value */
 #include <babeltrace2/types.h>
+#include <babeltrace2/logging.h>
 
 #ifdef __cplusplus
 extern "C" {
@@ -36,19 +37,35 @@ extern "C" {
 extern
 bt_query_executor *bt_query_executor_create(void);
 
+typedef enum bt_query_executor_query_status {
+       BT_QUERY_EXECUTOR_QUERY_STATUS_OK               = __BT_FUNC_STATUS_OK,
+       BT_QUERY_EXECUTOR_QUERY_STATUS_AGAIN            = __BT_FUNC_STATUS_AGAIN,
+       BT_QUERY_EXECUTOR_QUERY_STATUS_ERROR            = __BT_FUNC_STATUS_ERROR,
+       BT_QUERY_EXECUTOR_QUERY_STATUS_MEMORY_ERROR     = __BT_FUNC_STATUS_MEMORY_ERROR,
+       BT_QUERY_EXECUTOR_QUERY_STATUS_INVALID_OBJECT   = __BT_FUNC_STATUS_INVALID_OBJECT,
+       BT_QUERY_EXECUTOR_QUERY_STATUS_INVALID_PARAMS   = __BT_FUNC_STATUS_INVALID_PARAMS,
+} bt_query_executor_query_status;
+
 extern
-bt_query_executor_status bt_query_executor_query(
+bt_query_executor_query_status bt_query_executor_query(
                bt_query_executor *query_executor,
                const bt_component_class *component_class,
                const char *object, const bt_value *params,
-               const bt_value **result);
+               bt_logging_level logging_level, const bt_value **result);
 
-extern
-bt_query_executor_status bt_query_executor_cancel(
-               bt_query_executor *query_executor);
+typedef enum bt_query_executor_add_interrupter_status {
+       BT_QUERY_EXECUTOR_ADD_INTERRUPTER_STATUS_OK     = __BT_FUNC_STATUS_OK,
+       BT_QUERY_EXECUTOR_ADD_INTERRUPTER_MEMORY_ERROR  = __BT_FUNC_STATUS_MEMORY_ERROR,
+} bt_query_executor_add_interrupter_status;
+
+extern bt_query_executor_add_interrupter_status
+bt_query_executor_add_interrupter(bt_query_executor *query_executor,
+               const bt_interrupter *interrupter);
+
+extern void bt_query_executor_interrupt(bt_query_executor *query_executor);
 
 #ifdef __cplusplus
 }
 #endif
 
-#endif /* BABELTRACE_GRAPH_QUERY_EXECUTOR_H */
+#endif /* BABELTRACE2_GRAPH_QUERY_EXECUTOR_H */
This page took 0.023795 seconds and 4 git commands to generate.