]>
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.
10 static void (*altexit
)(int) NORETURN
= exit
;
12 /* set_done changes the path of done() from exit(3), or back to exit(3).
13 * Anything else will work, but a standard-error warning will report the
14 * old non-exit() value has been trampled. */
16 set_done(void (*new)(int) NORETURN
)
18 generic_pointer gpo
, gpn
;
20 if (altexit
!= exit
&& new != exit
) {
21 gpo
.f
= (void (*)(void))altexit
;
22 gpn
.f
= (void (*)(void))new;
23 inform("altexit trampled: %p %p", gpo
.v
, gpn
.v
);