home *** CD-ROM | disk | FTP | other *** search
/ PC Extra Super CD 1998 January / PCPLUS131.iso / DJGPP / V2 / DJLSR201.ZIP / src / libc / ansi / stdlib / atexit.txh < prev    next >
Encoding:
Text File  |  1995-07-10  |  714 b   |  37 lines

  1. @node atexit, process
  2. @subheading Syntax
  3.  
  4. @example
  5. #include <stdlib.h>
  6.  
  7. int atexit(void (*func)(void));
  8. @end example
  9.  
  10. @subheading Description
  11.  
  12. This function places the specified function @var{func} on a list of
  13. functions to be called when @code{exit} is called.  These functions are
  14. called as if a last-in-first-out queue is used, that is, the last
  15. function registered with @code{atexit} will be the first function called
  16. by @code{exit}.
  17.  
  18. At least 32 functions can be registered this way.
  19.  
  20. @subheading Return Value
  21.  
  22. Zero on success, non-zero on error.
  23.  
  24. @subheading Example
  25.  
  26. @example
  27. void exit_func()
  28. @{
  29.   remove("file.tmp");
  30. @}
  31.  
  32. @dots{}
  33. atexit(exit_func);
  34. @dots{}
  35. @end example
  36.  
  37.