X-Git-Url: https://git.efficios.com/?a=blobdiff_plain;ds=sidebyside;f=lib%2Fcomponent%2Fcomponent-class.c;h=cf164832522daaf47d72de2044cfb023852a795f;hb=72b913fbad1753b5b122bfb54c1e7936eaf9d0ef;hp=0843e0c25d71030ff327fefb6bf4ccaf79bbd59f;hpb=6fbd4105b92d0da8b3c5818a5b7c5b07850f4a01;p=babeltrace.git diff --git a/lib/component/component-class.c b/lib/component/component-class.c index 0843e0c2..cf164832 100644 --- a/lib/component/component-class.c +++ b/lib/component/component-class.c @@ -245,19 +245,35 @@ end: return ret; } -int bt_component_class_set_new_connection_method( +int bt_component_class_set_accept_port_connection_method( struct bt_component_class *component_class, - bt_component_class_new_connection_method new_connection_method) + bt_component_class_accept_port_connection_method method) { int ret = 0; - if (!component_class || component_class->frozen || - !new_connection_method) { + if (!component_class || component_class->frozen || !method) { + ret = -1; + goto end; + } + + component_class->methods.accept_port_connection = method; + +end: + return ret; +} + +int bt_component_class_set_port_disconnected_method( + struct bt_component_class *component_class, + bt_component_class_port_disconnected_method method) +{ + int ret = 0; + + if (!component_class || component_class->frozen || !method) { ret = -1; goto end; } - component_class->methods.new_connection_method = new_connection_method; + component_class->methods.port_disconnected = method; end: return ret;