X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=include%2Fbabeltrace%2Fgraph%2Fport-input-const.h;fp=include%2Fbabeltrace%2Fgraph%2Fport-input-const.h;h=1f13de9dd10a3a6b6b3732272ea8fc2ae3cc2087;hb=c5b9b4417bedfbec9b5dd23b8395ccdd4eeffc44;hp=d23fd558053c46e6d756af78f8cf2d4bb1b7dd7b;hpb=e2f7325d1e58710ee928373592adcee466f93d06;p=babeltrace.git diff --git a/include/babeltrace/graph/port-input-const.h b/include/babeltrace/graph/port-input-const.h index d23fd558..1f13de9d 100644 --- a/include/babeltrace/graph/port-input-const.h +++ b/include/babeltrace/graph/port-input-const.h @@ -40,6 +40,23 @@ const struct bt_port *bt_port_input_as_port_const( return (const void *) port_input; } +extern void bt_port_input_get_ref(const struct bt_port_input *port_input); + +extern void bt_port_input_put_ref(const struct bt_port_input *port_input); + +#define BT_PORT_INPUT_PUT_REF_AND_RESET(_var) \ + do { \ + bt_port_input_put_ref(_var); \ + (_var) = NULL; \ + } while (0) + +#define BT_PORT_INPUT_MOVE_REF(_var_dst, _var_src) \ + do { \ + bt_port_input_put_ref(_var_dst); \ + (_var_dst) = (_var_src); \ + (_var_src) = NULL; \ + } while (0) + #ifdef __cplusplus } #endif