This functions walks through the list of all registered log domains and
calls a callback on it. It can be used to print the list of domains for
a user.
}
return 0;
}
+
+void ul_logreg_for_each_domain(ul_logreg_domain_cb_t *callback, void *context)
+{
+ ul_log_domains_it_t it;
+ ul_log_domain_t *domain;
+ ul_for_each_it(ul_log_domains, &ul_log_domains, it) {
+ domain=ul_log_domains_it2item(&it);
+ if (callback) {
+ int ret;
+ ret = callback(domain, context);
+ if (ret)
+ break;
+ }
+ }
+}
static void function_name##_on_init(void) UL_ATTR_CONSTRUCTOR; \
static void function_name##_on_init(void) { function_name(); }
+typedef int (ul_logreg_domain_cb_t)(ul_log_domain_t *domain, void *context);
+void ul_logreg_for_each_domain(ul_logreg_domain_cb_t *callback, void *context);
+
#ifdef __cplusplus
} /* extern "C"*/
#endif