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];
48 if (num_handlers >= max_handlers) {
50 handlers =
G_realloc(handlers, max_handlers *
sizeof(
struct handler));
53 return &handlers[num_handlers++];
73 struct handler *h = alloc_handler();
89 for (i = 0; i < num_handlers; i++) {
90 struct handler *h = &handlers[i];
92 if (h->func == func && h->closure == closure) {
106 for (i = 0; i < num_handlers; i++) {
107 struct handler *h = &handlers[i];
110 (*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.