/* file ipcdrls.c */

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

void init_pcdrls(pcodeset *pcdrls, int max_ncodes, boolean hashed)
 /**********************************************/
 /* Initializes the pcodeset *pcdrls.          */
 /**********************************************/
 {char *proc = "init_pcdrls";
db_enter_msg(proc,0); /* debug only */
  pcdrls->file_name = strdup_safe("pcdrls",proc);
  pcdrls->name      = strdup_safe("pcdrls",proc);
  pcdrls->directory = strdup_safe("",proc);
  pcdrls->desc      = strdup_safe("Pcodeset encoding a TTP ruleset.",proc);
  pcdrls->format    = strdup_safe("NIST2",proc);
  pcdrls->order     = strdup_safe("arbitrary",proc);
  pcdrls->max_ncodes = max_ncodes;
  pcdrls->hashed = hashed;
  pcdrls->hash_pars = NULL;
  if (pcdrls->hashed)
    {pcdrls->hash_pars = (HASH_PARAMETERS*)malloc_safe(sizeof(HASH_PARAMETERS),proc);
     hash_init(pcdrls->hash_pars);
if (db_level > 3) dump_hash_pars(pcdrls->hash_pars);
    }
  make_pc_table(pcdrls);
  init_pc_table(pcdrls);
/* now make sure (null) element 0 is defined */
  pcdrls->pc[0].ac = strdup_safe("*",proc);   /* the null symbol     */
  pcdrls->pc[0].lc_ext = EMPTY_STRING; /* its lower code rep  */
  pcdrls->pc[0].lc_int = EMPTY_INT_STRING;
  pcdrls->type_case = strdup_safe("lower",proc);
  pcdrls->comment_flag = strdup_safe("##",proc);
  pcdrls->separated = T;
  pcdrls->sep_codes = strdup_safe(" ",proc);
  pcdrls->compositional = F;
  pcdrls->element_type = strdup_safe("word",proc);
  pcdrls->lower_code_fname = strdup_safe("",proc);
  pcdrls->lower_code = NULL;
  pcdrls->ppf_fname = strdup_safe("",proc);
  pcdrls->ppf = NULL;
  pcdrls->from_stn_rules_fname = strdup_safe("",proc);
  pcdrls->from_stn_rules = NULL;
  pcdrls->to_stn_rules_fname = strdup_safe("",proc);
  pcdrls->to_stn_rules = NULL;
  pcdrls->highest_code_value = 0;
  pcdrls->ncodes = 0;
db_leave_msg(proc,0); /* debug only */
  return;
 }
