OSI/AS Programming Manual
Example 1: Session Layer
Sample Programs
E–24 056783 Tandem Computers Incorporated
} /* proc wait_for_event */
#pragma PAGE
/*--------------------------------------------------------*/
/* */
/* initialize APS. */
/* */
/*--------------------------------------------------------*/
void initialize_appl()
{
 /* */
 /* Ask APS to allocate and initialize a reserved */
 /* extended segment for this process. */
 /* */
 error = APS_INITIALIZE_( (int *) &swapvol );
 if ( error != ZAPS_ERR_OK )
 display_aps_error( error_initialize_proc );
} /* proc initialize_appl */
#pragma PAGE
/*--------------------------------------------------------*/
/* */
/* Main procedure of Example 1. */
/* */
/*--------------------------------------------------------*/
main()
{
 /* */
 /* read startup message, open output, and initialize APS*/
 /* */
 initialize_appl();
 /* */
 /* Set the OSI manager process name. */
 /* */
 memcpy( api_environment.zend_system_name.u_zc.zb
 , "$OMGR "
 , 24
 );
 api_environment.zwaitmode = ZAPS_VAL_WAITED;
 /* */
 /* Set the local and remote application names. */
 /* */
 local_appl_1.zpsap.zpsel.zlen = 0; /* not used */
 local_appl_1.zpsap.zssel.zlen = 0; /* not used */
 local_appl_1.zpsap.ztsel.zlen = 0; /* not used */
 local_appl_1.zpsap.znsap.zlen = 0; /* not used */
 local_appl_1.zappl_name.zlen = 5;
 memcpy( local_appl_1.zappl_name.u_zc.zb, "APPL1", 5 );










