+int gl_search (search_info_t *si, /* {{{ */
+ graph_inst_callback_t callback, void *user_data)
+{
+ size_t i;
+ graph_ident_t *ident;
+
+ if ((si == NULL) || (callback == NULL))
+ return (EINVAL);
+
+ if (search_has_selector (si))
+ {
+ ident = search_to_ident (si);
+ if (ident == NULL)
+ {
+ fprintf (stderr, "gl_search: search_to_ident failed\n");
+ return (-1);
+ }
+ }
+ else
+ {
+ ident = NULL;
+ }
+
+ for (i = 0; i < gl_active_num; i++)
+ {
+ int status;
+
+ if ((ident != NULL) && !graph_ident_intersect (gl_active[i], ident))
+ continue;
+
+ status = graph_search_inst (gl_active[i], si,
+ /* callback = */ callback,
+ /* user data = */ user_data);
+ if (status != 0)
+ return (status);
+ }
+
+ for (i = 0; i < gl_dynamic_num; i++)
+ {
+ int status;
+
+ if ((ident != NULL) && !graph_ident_intersect (gl_dynamic[i], ident))
+ continue;
+
+ status = graph_search_inst (gl_dynamic[i], si,
+ /* callback = */ callback,
+ /* user data = */ user_data);
+ if (status != 0)
+ return (status);
+ }
+
+ return (0);
+} /* }}} int gl_search */
+