32 static struct handler *handlers;
34 static int num_handlers;
35 static int max_handlers;
37 static struct handler *alloc_handler(
void)
41 for (i = 0; i < num_handlers; i++) {
42 struct handler *h = &handlers[i];
47 if (num_handlers >= max_handlers) {
49 handlers =
G_realloc(handlers, max_handlers *
sizeof(
struct handler));
52 return &handlers[num_handlers++];
72 struct handler *h = alloc_handler();
88 for (i = 0; i < num_handlers; i++) {
89 struct handler *h = &handlers[i];
91 if (h->func == func && h->closure == closure) {
105 for (i = 0; i < num_handlers; i++) {
106 struct handler *h = &handlers[i];
108 (*h->func)(h->closure);
void G_add_error_handler(void(*func)(void *), void *closure)
Add new error handler.
void G_remove_error_handler(void(*func)(void *), void *closure)
Remove existing error handler.
void G__call_error_handlers(void)
Call available error handlers (internal use only)