lib: make public reference count functions have strict types
[babeltrace.git] / include / babeltrace / graph / component-class-sink-const.h
index 613b91635e7cd2c664d27e670037753109343dd9..4cfa7b7aa0fb3ec01cc20ada33524f646dc65558 100644 (file)
@@ -39,6 +39,25 @@ bt_component_class_sink_as_component_class_const(
        return (const void *) comp_cls_sink;
 }
 
+extern void bt_component_class_sink_get_ref(
+               const struct bt_component_class_sink *component_class_sink);
+
+extern void bt_component_class_sink_put_ref(
+               const struct bt_component_class_sink *component_class_sink);
+
+#define BT_COMPONENT_CLASS_SINK_PUT_REF_AND_RESET(_var)                \
+       do {                                                    \
+               bt_component_class_sink_put_ref(_var);          \
+               (_var) = NULL;                                  \
+       } while (0)
+
+#define BT_COMPONENT_CLASS_SINK_MOVE_REF(_var_dst, _var_src)   \
+       do {                                                    \
+               bt_component_class_sink_put_ref(_var_dst);      \
+               (_var_dst) = (_var_src);                        \
+               (_var_src) = NULL;                              \
+       } while (0)
+
 #ifdef __cplusplus
 }
 #endif
This page took 0.023973 seconds and 4 git commands to generate.