/*****************************************************************/
/**                                                             **/
/**             (C) Copyright 1992 the Regents of the           **/
/**        University of California.  All Rights Reserved.      **/
/**                                                             **/
/**        This work was produced under the sponsorship of      **/
/**         the U.S. Department of Energy.  The Government      **/
/**                retains certain rights therein.              **/
/**                                                             **/
/**                         Written by                          **/
/**         Distributed Programming Environments Project        **/
/**           Computer Software and Networking Division,        **/
/**                   Livermore Computer Center,                **/
/**            Lawrence Livermore National Laboratory           **/
/**                                                             **/
/*****************************************************************/
 
Interface sample; 
 
   Reject r1 1 3; 
   Reject r2 0 8; 
   Reject r3 2 7; 
   Reject r4 1 18; 
 
End; 
  

main(argc,argv) 
   int argc; 
   char *argv[]; 
{ 
   Integer(4) x; 
 
   Control (sample) inst; 
  
   long *iv,*lv; 
   int i,j; 
 
   if (argc != 2) 
      exit(1);    
  
/***************** send it out ************************/

   Bind_STUB(inst,argv[1],"w",Asn_1_ber); 
   Give inst 
   { 
      r1[6](); 
      r2[7](); 
      r3[8](); 
      r4(); 
   } 
   Unbind(inst); 
  
/***************** receive it back ********************/

   Bind_STUB(inst,argv[1],"r",Asn_1_ber); 
   Accept [iv,lv] inst 
   { 
      On r1() 
        if (*iv != 6) 
	   printf("###wrong reject 1 id %d\n",*iv); 
        
   } 
   Accept [iv,lv] inst 
   { 
      On r2() 
        if (*iv != 7) 
	   printf("###wrong reject 2 id %d\n",*iv); 
        
   } 
   Accept [iv,lv] inst 
   { 
      On r3() 
        if (*iv != 8) 
	   printf("###wrong reject 3 id %d\n",*iv); 
        
   } 
   Accept [iv,lv] inst 
   { 
      On r4() 
        if (iv != NULL) 
	   printf("###wrong reject 4 id %d, should be NULL\n",*iv); 
        
   } 
   Unbind(inst); 
 
   printf("test completed\n");
   return(0); 
} 
