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

   Integer(4) I4;

   Invoke inv 5
      Any;

End;


main(argc,argv)
   int argc;
   char *argv[];
{
   Control (sample) inst1;
   I4 i_s,i_r;
   Any encoded_any, decoded_any;

   if (argc != 2)
      exit(1);

/**************** initialization **********************/

   i_s = 123;

/***************** send it out ************************/

   EncodeAny(sample, I4, encoded_any, i_s);
   Bind_STUB(inst1,argv[1],"w",Asn_1_ber);
   Give inst1
      inv(encoded_any);
   Unbind(inst1);

/***************** receive it back ********************/

   Bind_STUB(inst1,argv[1],"r",Asn_1_ber);
   Accept inst1
   {
      On inv(decoded_any);
   }
   Unbind(inst1);
   DecodeAny(sample, I4, i_r, decoded_any);

/***************** report results *********************/

   if (i_s != i_r) {
      printf("   i_r value was bad\n");
      exit(1);
   }

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