/**
 *  Header defining various user-defined types used
 *  in the cryptogram solver.
 *
 *  Author: Ramkumar Natarajan (nrk@cs.purdue.edu)
 **/

#ifndef TYPES_H__
#define TYPES_H__

#include "constants.h"

typedef int Bool;

struct st_cw__ {
    char  *word;
    char   len;
    char **possiblewords;
    int    npossibles;
    Bool   isIgnored;

    int    nonalphapos;

    int    map[ALPHA_SZ_];
    int    curmatch;
};

typedef struct st_cw__ CipherWord;

struct st_cc__ {
    int          plainmap;
    char         plainchar;
    Bool         isPresent;
};

typedef struct st_cc__ CipherChar;

struct st_ct__ {
    char        *ociphertxt;
    char        *plaintxt;
    char        *ciphertxt;
    CipherWord **cipherwords;
    int          ncipherwords;
    CipherWord  *longest;
    CipherChar   ciphermap[ALPHA_SZ_];
    int          plainmap[ALPHA_SZ_];
    char         plainchars[ALPHA_SZ_];
};

typedef struct st_ct__ CipherText;

struct st_dict__ {
    char  *filename;
    char  *words;
    char   isRead;
    int    nwords;
    int    wordlen;
};

typedef struct st_dict__ Dictionary;

#endif
