Main Page   Modules   Data Structures   File List   Data Fields   Globals   Related Pages  

gm_on_exit.c File Reference

#include "gm.h"
#include "gm_call_trace.h"
#include "gm_config.h"
#include "gm_internal_funcs.h"

Data Structures

struct  gm_on_exit_record

Typedefs

typedef gm_on_exit_record gm_on_exit_record_t

Functions

GM_ENTRY_POINT gm_status_t gm_on_exit (gm_on_exit_callback_t callback, void *arg)

Detailed Description

This file contains the GM API function gm_on_exit().


Typedef Documentation

typedef struct gm_on_exit_record gm_on_exit_record_t
 

List element storing the details of a callback that should be called upon exit.


Function Documentation

GM_ENTRY_POINT gm_status_t gm_on_exit gm_on_exit_callback_t    callback,
void *    arg
 

gm_on_exit() is like Linux on_exit(). This function registers a callback so that `CALLBACK(STATUS,ARG)' is called when the program exits. Callbacks are called in the reverse of the order of registration. This function is also somewhat similar to BSD `atexit()'.

Call the callbacks in the reverse order registered inside gm_exit(), passing GM exit status and registered argument to the callback.

Return values:
GM_SUCCESS  Operation completed successfully.
GM_OUT_OF_MEMORY 
Parameters:
callback 
arg 
Author:
Glenn Brown
Version:
GM_API_VERSION (as defined in gm.h)


Generated on Mon Nov 3 15:39:26 2003 for GM by doxygen1.2.15