update for HEAD-2003091401
[reactos.git] / lib / crtdll / stdlib / atexit.c
1 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
2 #include <msvcrt/stdlib.h>
3 #include <msvcrt/internal/atexit.h>
4
5 /*
6  * @implemented
7  */
8 int
9 atexit(void (*a)(void))
10 {
11   struct __atexit *ap;
12   if (a == 0)
13     return -1;
14   ap = (struct __atexit *)malloc(sizeof(struct __atexit));
15   if (!ap)
16     return -1;
17   ap->__next = __atexit_ptr;
18   ap->__function = a;
19   __atexit_ptr = ap;
20   return 0;
21 }