#include <stdio.h>
#include <stdlib.h>

main(argc,argv)
char **argv;
int argc;
{
  char *trigram(),*un_trigram();
  char *s,*repl,*t;
  char key;
  int len;

  key = *argv[1];
  s = argv[2];
  repl = argv[3];

  t = trigram(s,repl,key,&len);
  if (t == NULL) printf ("*** trigram error\n");
  else {
    printf("trigram ==>%s<== (length %d)\n",t,len);
    s = un_trigram(t,key,&len);
    if (s == NULL) 
      if (len < 0) printf ("*** Could not allocate un_trigram buffer\n");
      else printf("*** un_trigram error at %s\n",t+len);
    else printf("un_trigram ==>%s<== (length %d)\n\n",s,len);
  }
  exit(0);
}
