/***************************************************************************
 *									   *
 *              WILLOW(tm) Information Retrieval Software		   *
 *     (Washington Information Looker-upper Layered Over Windows)	   *
 * 									   *
 *             Copyright 1992 University of Washington			   *
 *       Willow is a trademark of the University of Washington		   *
 * 									   *
 * Permission to use, copy, modify, and distribute Willow(tm) software	   *
 * and its documentation for any purpose and without fee is hereby	   *
 * granted, provided that the above copyright notice appears in all	   *
 * copies and that both the above copyright notice and this permission	   *
 * notice appear in supporting documentation, and that the name of the	   *
 * University of Washington not be used in advertising or publicity	   *
 * pertaining to distribution of the software without specific, written	   *
 * prior permission.  This software is made available "as is", and	   *
 * 									   *
 * THE UNIVERSITY OF WASHINGTON DISCLAIMS ALL WARRANTIES, EXPRESS OR	   *
 * IMPLIED, WITH REGARD TO THIS SOFTWARE, INCLUDING WITHOUT LIMITATION	   *
 * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR  *
 * PURPOSE, AND IN NO EVENT SHALL THE UNIVERSITY OF WASHINGTON BE LIABLE   *
 * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES	   *
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN   *
 * ACTION OF CONTRACT, TORT (INCLUDING NEGLIGENCE) OR STRICT LIABILITY,	   *
 * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS	   *
 * SOFTWARE.								   *
 * 									   *
 * For further information please contact:				   *
 * 									   *
 * Matthew Freedman							   *
 * Information Systems							   *
 * Computing and Communications						   *
 * University of Washington						   *
 * 4545 15th, 4th Floor JE-41						   *
 * Seattle, Washington, 98195, USA					   *
 * Internet: mattf@cac.washington.edu					   *
 ***************************************************************************/

/************************************************
 * driver.h
 * Contains definitions used by all drivers. Host
 * specific defs should be somewhere else.
 ************************************************/

#define FALSE 0
#define TRUE  1
#define MAX_LINE 130
#define MAX_TITLE_LEN 256
#define PARSE_BUF_SIZE 8192 
#define IN_BUF_SIZE 2048
#define QUIT_TIMEOUT          150


/*#define	FIRST_PASSWORD "rhob.lein\n"	temporary kludge 
#define	FIRST_PASSWORD "vacation\n"	
 #define FIRST_SERVER "sneetch.mit.edu" 
##define FIRST_SERVER "epic.prod.oclc.org"
#define FIRST_SERVER "132.174.100.3"
#define FIRST_ACCT "100-058-010\n"
#define FIRST_ACCT "100-089-681\n"
#define LOGOFF_CMD      "bye\n"
*/

#define THIRD_PASSWORD "rhob.lein\n"
#define SECOND_PASSWORD "caste%car\n"
#define FIRST_PASSWORD "txn3husky\n"
#define THIRD_ACCT "100-089-681\n"
#define SECOND_ACCT "100-105-441\n"
#define FIRST_ACCT "100-105-443\n"
#define FIRST_SERVER "fscat.oclc.org"
#define LOGOFF_CMD "bye\n"

/* databases */
#define SET_ONE 1
#define SET_TWO 2
#define SET_THREE 3

/* Define a record type for keeping state/string info in */
typedef struct _transition_rec {
    char    *in_string;
    char    *out_string;
    int      next_state;
    int     (*action)();
} transition_rec;

/* Define a two dimensional array to describe a state table. Each state
   can have up to 10 inputs */
#define MAX_TRANSITIONS 10
#define MAX_STATES      50
typedef transition_rec state_table[MAX_STATES][MAX_TRANSITIONS];

/* Define a structure for building linked lists of search elements. */
typedef struct _search_desc_rec {  /* describe a single field */
  char *text;     /* Not used for limit searches */
  char *command;
  struct _search_desc_rec *next;
} search_desc_rec;

/* Define a structure for building linked list of hilite points */
typedef struct _hl_rec {
  int   start, end;
  struct _hl_rec *next;
} hl_rec;
 
#define NO_CON          0
#define AWAIT_LOGIN     1
#define AWAIT_PW	2
#define AWAIT_SHELL     3
#define	AWAIT_DB	4
#define	READY		5
#define	QUITTING	6

#define R 0
#define W 1

/* File descriptors for willow<==>driver pipe */
#define TO_DRIVER_FD   0
#define FROM_DRIVER_FD 1


#ifdef MAIN
char *password,*account;
#else
extern char *password,*account;
#endif

