/***********************************************************************\

	Product Number: SC-07-5.7

	Version: rev5.7

	Product Name: Spelling Components - Linguibase

	Filename: lex.h


	This document contains private and confidential information and
	its disclosure does not constitute publication.  Some of the
	information herein also may appear in United States and or
	Foreign Patents Pending.  All rights are reserved by Proximity
	Technology Inc., except those specifically granted by license.

\***********************************************************************/

#ifndef SC_LEX
#define SC_LEX

#ifndef _PROXLIB
#include <proxlib.h>
#endif

#ifndef _PROXIO
#include <proxio.h>
#endif

#ifndef SC_SCDEF
#include "scdef.h"
#endif

#define LEX_REV         ((5 << 8) + 0)  /* Lexicon version level */
#define COPYRBYTES      256     /* size of the copyright area */
#define BLOCKSEGS       7       /* number of segments in a data block */
#define FLAGSIND        0xFF    /* Start of flags byte. */
#define NUMBACK         16      /* number of back space values */
#define SHORTLEX        0x02    /* short lexicon, in lx_prod. */

/* lexicon control structure, holding all relevant integer parameters, 
   string tables and substructures */ 

/* The first LEXHEADER ints of the LEX structure are read directly from the 
   lexicon file */

#define LEXHEADER       8

   /* header values written at start of each compressed lexicon */

extern short Lexenvcode;     /* lexicon's environment code */
extern short Lexscrev;       /* revision of sc compatible with lexicon */
extern short Lexprod;        /* product code (shy, uh, etc.) */
extern short Lexsegwords;    /* number of words in a segment */
extern short Lexnbsd;        /* number of entries in BSD table */
extern short Lexngram;       /* number of entries in di-gram table */
extern short Lexnindex;      /* number of entries in the index table */
extern short Lexnstrings;    /* size of the string area in bytes */

   /* locations of tables used by decompression routines */

extern UCHAR *Lexstrings;    /* actual memory area used for the strings */
extern UCHAR *Lexbs;         /* Backspaces for BSD's */
extern UCHAR **Lexdelta;     /* Deltas for BSD's */
extern UCHAR (*Lexgramtab)[2]; /* di-grams */
extern UCHAR **Lexindextab;  /* block seed words */

   /* minimum indices into compressed data tables */

extern int   Lexminbsd;      /* byte code for first BSD */
extern int   Lexmingrm;      /* byte code for first multi-gram */

   /* miscellaneous */

extern HANDLE  Lexfile;        /* file access handle */
extern char    Lexadjptr;      /* pointers have been adjusted */
extern int     Lexoffset;      /* block offset to first word of lexicon */
extern UCHAR   *Lexblk;        /* location of decompression buffer start */
extern UCHAR   *Lexblkptr;     /* current location in buffer */

#endif
