lib: make public reference count functions have strict types
[babeltrace.git] / include / babeltrace / graph / query-executor-const.h
index c5cfd9370c699df50594a94973cfae7b29a4bd0e..d2e846cedf7ad25824afce8b054c1c53773027c9 100644 (file)
@@ -2,7 +2,7 @@
 #define BABELTRACE_GRAPH_QUERY_EXECUTOR_CONST_H
 
 /*
- * Copyright 2017 Philippe Proulx <pproulx@efficios.com>
+ * Copyright 2017-2018 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
@@ -47,6 +47,25 @@ extern
 bt_bool bt_query_executor_is_canceled(
                const struct bt_query_executor *query_executor);
 
+extern void bt_query_executor_get_ref(
+               const struct bt_query_executor *query_executor);
+
+extern void bt_query_executor_put_ref(
+               const struct bt_query_executor *query_executor);
+
+#define BT_QUERY_EXECUTOR_PUT_REF_AND_RESET(_var)              \
+       do {                                                    \
+               bt_query_executor_put_ref(_var);                \
+               (_var) = NULL;                                  \
+       } while (0)
+
+#define BT_QUERY_EXECUTOR_MOVE_REF(_var_dst, _var_src)         \
+       do {                                                    \
+               bt_query_executor_put_ref(_var_dst);            \
+               (_var_dst) = (_var_src);                        \
+               (_var_src) = NULL;                              \
+       } while (0)
+
 #ifdef __cplusplus
 }
 #endif
This page took 0.024967 seconds and 4 git commands to generate.