X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=include%2Fbabeltrace%2Fgraph%2Fself-component-sink.h;h=04b8d206a19d639582f0f918175415eaf7ba9735;hb=005f1204d7620018bb2c1406b6194940f0ee119f;hp=b98e764b71535deaa14d93e1b805ff5c8bdf75cb;hpb=d94d92ac6656fd252a5d7bb4f6c76935ba18e62e;p=babeltrace.git diff --git a/include/babeltrace/graph/self-component-sink.h b/include/babeltrace/graph/self-component-sink.h index b98e764b..04b8d206 100644 --- a/include/babeltrace/graph/self-component-sink.h +++ b/include/babeltrace/graph/self-component-sink.h @@ -2,7 +2,7 @@ #define BABELTRACE_GRAPH_SELF_COMPONENT_SINK_H /* - * Copyright 2017 Philippe Proulx + * Copyright 2017-2018 Philippe Proulx * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -25,47 +25,48 @@ #include -/* For enum bt_self_component_status */ +/* For bt_self_component_status */ #include +/* + * For bt_component_sink, bt_self_component, bt_self_component_sink, + * bt_self_component_port_input, __BT_UPCAST, __BT_UPCAST_CONST + */ +#include + #ifdef __cplusplus extern "C" { #endif -struct bt_component_sink; -struct bt_self_component; -struct bt_self_component_sink; -struct bt_self_component_port_input; - static inline -struct bt_self_component *bt_self_component_sink_borrow_self_component( - struct bt_self_component_sink *self_comp_sink) +bt_self_component *bt_self_component_sink_as_self_component( + bt_self_component_sink *self_comp_sink) { - return (void *) self_comp_sink; + return __BT_UPCAST(bt_self_component, self_comp_sink); } static inline -struct bt_component_sink * -bt_self_component_sink_borrow_component_sink( - struct bt_self_component_sink *self_comp_sink) +const bt_component_sink * +bt_self_component_sink_as_component_sink( + bt_self_component_sink *self_comp_sink) { - return (void *) self_comp_sink; + return __BT_UPCAST_CONST(bt_component_sink, self_comp_sink); } -extern struct bt_self_component_port_input * +extern bt_self_component_port_input * bt_self_component_sink_borrow_input_port_by_name( - struct bt_self_component_sink *self_component, + bt_self_component_sink *self_component, const char *name); -extern struct bt_self_component_port_input * +extern bt_self_component_port_input * bt_self_component_sink_borrow_input_port_by_index( - struct bt_self_component_sink *self_component, uint64_t index); + bt_self_component_sink *self_component, uint64_t index); -extern enum bt_self_component_status +extern bt_self_component_status bt_self_component_sink_add_input_port( - struct bt_self_component_sink *self_component, + bt_self_component_sink *self_component, const char *name, void *user_data, - struct bt_self_component_port_input **self_component_port); + bt_self_component_port_input **self_component_port); #ifdef __cplusplus }