2 * Subject to the GPL, version 2.
9 void (*on_panic
)(void *arg
);
10 struct panic_func
*next
;
13 static struct panic_func
*panic_funcs
;
15 void panic_func_add(void (*on_panic
)(void *arg
), void *arg
)
17 struct panic_func
*handler
= xmallocz(sizeof(*handler
));
20 handler
->on_panic
= on_panic
;
21 handler
->next
= panic_funcs
;
22 panic_funcs
= handler
;
25 void call_on_panic_funcs(void)
27 struct panic_func
*it
;
29 for (it
= panic_funcs
; it
; it
= it
->next
)
30 it
->on_panic(it
->arg
);