/*****************************************************************/
/**                                                             **/
/**             (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; 

Names 
   Integer(4) cat 55, 
   Integer(2) dog 4095; 
 
Names 
   Integer(3) mouse 0; 
 
   Invoke ike 52 
	dog; 
 
   Invoke jfk 60 
	cat,mouse; 
End; 
  

main(argc,argv) 
   int argc; 
   char *argv[]; 
{ 
   static struct {  
      Integer(2) i2; 
      Integer(2) j2; 
   } is = {75,2010};  
   Integer(4) tmp = -17,*i4 = &tmp; 
   Integer(3) i3; 
   Integer(2) r4096; 
   Integer(4) r1,r2; 
 
   Control (sample) inst; 
  
   char o[64],a[64]; 
   i3 = 1451132; 
 
   if (argc != 2) 
      exit(1);    
  
/***************** send it out ************************/

   Bind_STUB(inst,argv[1],"w",Asn_1_ber); 
   Give inst 
   { 
      jfk(cat:*i4,mouse:i3); 
      jfk(mouse:i3,cat: *i4); 
   } 
   Unbind(inst); 
  
/***************** receive it back ********************/

   Bind_STUB(inst,argv[1],"r",Asn_1_ber); 
 
   Accept inst 
   { 
      On jfk(...); 
   } 
   Exceptions 
   { 
      On Missing_op(o) 
      { 
        printf("###missing op taken incorrectly o:'%s', \n",o); 
	exit(1); 
	 
      }  
   } 
 
   Accept inst 
   { 
      On ike() 
      { 
	printf("###ike didn't do exceptions \n"); 
   	exit(1); 
      }  
   } 
   Exceptions 
   { 
      On Missing_op(o) 
      { 
        goto success; 
      }  
   } 
 
   printf("###should never EVER get here\n"); 
   exit(1); 
 
success: 
  
   Unbind(inst); 

   printf("test completed\n");
   exit(0); 
} 
  
