]>
diplodocus.org Git - nmh/blob - sbr/done.c
1 /* done.c -- terminate the program
3 * This code is Copyright (c) 2002, by the authors of nmh. See the
4 * COPYRIGHT file in the root directory of the nmh distribution for
5 * complete copyright information.
11 static void (*altexit
)(int) NORETURN
= exit
;
13 /* set_done changes the path of done() from exit(3), or back to exit(3).
14 * Anything else will work, but a standard-error warning will report the
15 * old non-exit() value has been trampled. */
17 set_done(void (*new)(int) NORETURN
)
19 generic_pointer gpo
, gpn
;
21 if (altexit
!= exit
&& new != exit
) {
22 gpo
.f
= (void (*)(void))altexit
;
23 gpn
.f
= (void (*)(void))new;
24 inform("altexit trampled: %p %p", gpo
.v
, gpn
.v
);