[Errata corrige] I am sorry to have asked the above silly question and to have disturbed all the readers of this mailing list. I had a wrong concept of Source in my mind and therefore did a mistake.
I apologize for the inconvenience. Best regards, Lorenzo 2017-01-12 16:10 GMT+01:00 Lorenzo Ghiro <[email protected]>: > 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 >
_______________________________________________ Babel-users mailing list [email protected] http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/babel-users

