/[gnats]/gnats/libiberty/xatexit.c
ViewVC logotype

Diff of /gnats/libiberty/xatexit.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1.1.1 by brendan, Thu Nov 5 19:54:16 1998 UTC revision 1.2 by chewie, Sat Nov 13 05:14:17 2004 UTC
# Line 5  Line 5 
5   * %sccs.include.redist.c%   * %sccs.include.redist.c%
6   */   */
7    
8    
9    /*
10    
11    @deftypefun int xatexit (void (*@var{fn}) (void))
12    
13    Behaves as the standard @code{atexit} function, but with no limit on
14    the number of registered functions.  Returns 0 on success, or @minus{}1 on
15    failure.  If you use @code{xatexit} to register functions, you must use
16    @code{xexit} to terminate your program.
17    
18    @end deftypefun
19    
20    */
21    
22  /* Adapted from newlib/libc/stdlib/{,at}exit.[ch].  /* Adapted from newlib/libc/stdlib/{,at}exit.[ch].
23     If you use xatexit, you must call xexit instead of exit.  */     If you use xatexit, you must call xexit instead of exit.  */
24    
# Line 13  Line 27 
27    
28  #include <stdio.h>  #include <stdio.h>
29    
30  #ifdef __STDC__  #ifdef ANSI_PROTOTYPES
31  #include <stddef.h>  #include <stddef.h>
32  #else  #else
33  #define size_t unsigned long  #define size_t unsigned long
34  #endif  #endif
35    
36    #if VMS
37    #include <stdlib.h>
38    #include <unixlib.h>
39    #else
40  /* For systems with larger pointers than ints, this must be declared.  */  /* For systems with larger pointers than ints, this must be declared.  */
41  PTR malloc PARAMS ((size_t));  PTR malloc PARAMS ((size_t));
42    #endif
43    
44  static void xatexit_cleanup PARAMS ((void));  static void xatexit_cleanup PARAMS ((void));
45    

Legend:
Removed from v.1.1.1.1  
changed lines
  Added in v.1.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26