29static struct handler *handlers;
31static int num_handlers;
32static int max_handlers;
34static struct handler *alloc_handler(
void)
38 for (i = 0; i < num_handlers; i++) {
39 struct handler *h = &handlers[i];
45 if (num_handlers >= max_handlers) {
47 handlers =
G_realloc(handlers, max_handlers *
sizeof(
struct handler));
50 return &handlers[num_handlers++];
70 struct handler *h = alloc_handler();
86 for (i = 0; i < num_handlers; i++) {
87 struct handler *h = &handlers[i];
89 if (h->func == func && h->closure == closure) {
103 for (i = 0; i < num_handlers; i++) {
104 struct handler *h = &handlers[i];
107 (*h->func)(h->closure);
void G_add_error_handler(void(*func)(void *), void *closure)
Add new error handler.
void G__call_error_handlers(void)
Call available error handlers (internal use only)
void G_remove_error_handler(void(*func)(void *), void *closure)
Remove existing error handler.