[Babel-users] Source stream

Lorenzo Ghiro lorenzo.ghiro at studenti.unitn.it
Thu Jan 12 15:10:53 UTC 2017


Hi everybody!

I need your help in developing the proper method to iterate over sources :)
For instance for routes, some time ago M. Boutier helped me highlighting
this piece of code


> You must iterate over all the routing entries with "route streams" and
> search
> the one you want (or write your own function). For example:
>     struct babel_route * rt = NULL;
>     struct route_stream * stream = NULL;
>     stream = route_stream (ROUTE_INSTALLED); / * Or _ALL, or _SS_INSTALLED
> * /
>     while (1) {
>         rt = route_stream_next (stream);
>         if (rt == NULL) break;
>         / * Your code * /
>         min = min_route (rt, min);
>     }
>     route_stream_done (stream);


Now I need something very similar but for sources, even better if it is
possible to iterate over ALL_KNOWN sources and INSTALLED sources. With
INSTALLED sources I mean only sources related to INSTALLED routes.

I tried to get all the "installed sources" iterating over installed routes
and retrieving the related src, but I got lots of duplicates (when
different routes share the same src). I would like to avoid duplicates and
write a more elegant method consistent with the rest of the code :)

Any advice?

Thank you and regards,

Lorenzo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/babel-users/attachments/20170112/ea776234/attachment.html>


More information about the Babel-users mailing list