/* file decode3_prot.c */

#if !defined(COMPILE_ENVIRONMENT)
#include <gp/stdcenvf.h> /* std compile environment for functions */
#endif


   void decode3_prot(PROTECTED_CHR_STR *sex, pcodeset *pc1,
     PROTECTED_INT_STR *sin, int *perr)

  /******************************************************************/
  /*  Converts sin to sex, according to pcode "pc1".                */
  /*  sex is a protected character string, external;                */
  /*  sin is a protected integer string of internal numeric codes.  */
  /*  On return, *perr indicates exception:                         */
  /*    *perr  condition                                            */
  /*      0     a.o.k.                                              */
  /******************************************************************/
  {
/* local data */
   char *proc = " decode3_prot";
   int i, n_symbols;
 /* coding */
 db_enter_msg(proc,3); /* debug only */
   *perr = 0;
   strcpy_prot_s(sex,"");
   n_symbols = sin->str[0];
   for (i = 1; i <= n_symbols; i++)
     {if ( (pc1->separated) && (i>1) ) strcat_prot_s(sex," ");
      strcat_prot_s(sex,pc1->pc[sin->str[i]].ac);
     }
 db_leave_msg(proc,3); /* debug only */
   return;
  } /* end of decode3_prot */
