/* file build_key3.c */

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

char *build_key3(char *key, char *le, char *tg, char *re, char tgbound)
/************************************************************/
/* Builds a rule key into *key, returning *key, based on    */
/* the input character strings le, tg, and re, using tgbound*/
/* to delimit the target part of the rules.                 */
/************************************************************/
 {char *proc = "build_key3";
  char stbx[LINE_LENGTH], *str_tgbound = &stbx[0];
db_enter_msg(proc,1); /* debug only */
  strcpy(str_tgbound,".");
  str_tgbound[0] = tgbound;
 /* build key */
  key = strcpy(key,"");
  key = strcat(key,le);
  key = strcat(key,str_tgbound);
  key = strcat(key,tg);
  key = strcat(key,str_tgbound);
  key = strcat(key,re);
 /* make sure key is one token */
  key = strmap1(key," ","_");

if (db_level > 2) printf("%s key='%s'\n",pdb,key);

db_leave_msg(proc,1); /* debug only */
  return key;
 }
