English
Language : 

CC78K4 Datasheet, PDF (204/523 Pages) NEC – CC78K4 Ver.2.30 or Later, C Compiler Language
CHAPTER 10 LIBRARY FUNCTIONS
5-8 atexit,
exit
Utility Functions
FUNCTION
atexit registers the function called at the normal termination.
exit terminates a program.
HEADER
stdlib. h
FUNCTION PROTOTYPE
int atexit (void(*func) (void));
void exit (int status);
Function
atexit
exit
Arguments
func ... Pointer to function to
be registered
status ... Status value
indicating termination
Return Value
• 0 if function is registered as
wrap-up function
• 1 if function cannot be
registered
exit can never return.
EXPLANATION
atexit
• The atexit function registers the wrap-up function pointed to by func so that it is called without argument upon
normal program termination by calling exit or returning from main.
• Up to 32 wrap-up functions may be established. If the wrap-up function can be registered, atexit returns 0. If
no more wrap-up functions can be registered because 32 wrap-up functions have already been registered, the
function returns 1.
exit
• The exit function causes immediate, normal termination of a program.
• This function calls the wrap-up functions in the reverse of the order in which they were registered with atexit.
• The exit function loops and can never return to its caller.
• The user must create the exit processing routine.
204
User’s Manual U15556EJ1V0UM