/**************************************************
**                                                *
**                                                *
**                                                *
** File: substitute.h                             *
** Purpose: This is the declaration file used for *
** the Substitution cipher utility program.       *
***************************************************/

#define MAX_LINE_LEN 80              /* max line length */
#define MAX_NUM_SUBSTITUTIONS 500    /* max num substitutions */

/* the following are used globally because of the extent of use */

char input_file[MAX_LINE_LEN + 1];   /* holds input file name */
int ciphertext_count = 0;	     /* holds # chars of cipher */	
int cipher_size = 0;		     /* holds size of cipher array */

struct sub {                         /* structure to hold substitution info */
  char char1;                        /* first char of substitution */
  char char2;                        /* replacement character */
};

struct sub substitutions[MAX_NUM_SUBSTITUTIONS+1]; /* holds substitutions */
int num_substitutions = 0;	     /* holds # substitutions stored */

int orig_counts[27];               /* holds upper case counts of input */
int modified_lower_counts[27];     /* holds lower case counts of modified */
int modified_upper_counts[27];     /* holds upper case counts of modified */


char *cipher;                     /* holds original cipher */
char *modified_cipher;            /* holds modified cipher */

int *orig_loc[27];          /* holds original locations of uppercase chars */
int *mod_lower_loc[27];     /* holds modified locations of lowercase chars */
int *mod_upper_loc[27];     /* holds modified locations of uppercase chars */

/* statistics for english characters */
static float english_counts[] = { 8.167, 1.492, 2.782, 4.253,
12.702,2.228,2.015,6.094,6.966,0.153,0.772,4.025,2.406,
6.749,7.507,1.929,0.095,5.987,6.327,9.056,2.758,0.978,
2.360,0.150,1.974,0.074 };





