Administrator's Guide


Sample User Exit Program

Figure 81. Sample User Exit Program

/***********************************************************************
 * Name:            userExitSample.c
 * Description:     Example user-exit program invoked by the ADSM V3 Server
 * Environment:     AIX 4.1.4+ on RS/6000  
 ***********************************************************************/
 
#include <stdio.h>
#include "userExitSample.h"
 
/**************************************
 *** Do not modify below this line. ***
 **************************************/
 
extern void adsmV3UserExit( void *anEvent );
 
/************
 *** Main ***
 ************/
 
int main(int argc, char *argv[])
{
/* Do nothing, main() is never invoked, but stub is needed */
 
exit(0);  /* For picky compilers */
 
} /* End of main() */
 
/******************************************************************
 * Procedure:  adsmV3UserExit
 * If the user-exit is specified on the server, a valid and
 * appropriate event causes an elEventRecvData structure (see
 * userExitSample.h) to be passed to adsmV3UserExit that returns a void.
 * INPUT :   A (void *) to the elEventRecvData structure
 * RETURNS:  Nothing
 ******************************************************************/
 
void adsmV3UserExit( void *anEvent )
{
/* Typecast the event data passed */
elEventRecvData *eventData = (elEventRecvData *)anEvent;
 

 /**************************************
 *** Do not modify above this line. ***
 **************************************/
 
if( ( eventData->eventNum == USEREXIT_END_EVENTNUM     ) ||
    ( eventData->eventNum == END_ALL_RECEIVER_EVENTNUM ) )
  {
   /* Server says to end this user-exit.  Perform any cleanup, *
    * but do NOT exit() !!!                                    */
   return;
  }
 
/* Field Access:  eventData->.... */
/* Your code here ... */
 
return; /* For picky compilers */
} /* End of adsmV3UserExit() */
 


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]