/* These are the includes and globals peculiar to the IBM version of teach1*/

#define IBM
#include <stdio.h>
#include <ctype.h>
#include <time.h>	/* Needed for date and time functions*/
#include <stdlib.h>
#include "teach1.h"

#define AFFIXES	6	/* Choose affix mode  */
#define Boolean short
#define BRUSHUP	24	/*Moves cards on top to rung 3 for current mode */
#define BYE		26	/*Quit without saving stats and ladder*/
#define CLOSE		21	/*Close current file*/
#define DRILL		19	/*Change error box count*/
#define ERRORBOX	12	/*Select error box*/
#define EXIT		3	/*Quit teach*/
#define FALSE		0	/*Needed for IBM version*/
#define HELP		22	/*Display command list*/
#define LOOKUP	17	/*Look up English, prim or affixes*/
#define MAXCMD	27	/*Maximum number of commands.  Must be kept current*/
#define MAXMESS	 9	/*Maximum message (for error messages)*/
#define OPEN		1	/*Open file command*/
#define OVERWRITE	2	/*Save, overwriting original file (default)*/
#define PRIMITIVES	7	/*Select primitive mode*/
#define QUIT		25	/*Quit teach, same as exit*/
#define RECOGNIZE	 4	/*Select recognition mode*/
#define RECALL	 5	/*Select recall mode*/
#define REVIEW	14	/*Select review mode*/
#define RUNG1	8	/*Select rung 1*/
#define RUNG2	9	/*Select rung 2*/
#define RUNG3	10	/*Select rung 3*/
#define SAVEAS	23	/*Save under a new name*/
#define SELECT	13	/*Select command*/
#define RESET		0	/*Reset all cards to deck*/
#define SHUFFLE	16	/*Toggle the shuffle flag*/
#define STATS	18	/*Show current cumulative statistics*/
#define TEST		15	/*Enter test mode*/
#define TIMESUP	20	/*Set threshold time*/
#define TOP		11	/*Select top rung*/
#define TRUE		1
#ifdef MAC
#define PAR 6
#else
#define PAR
#endif

	/* The following is the set of long command names */


extern short cmd;						/*command being executed*/

// Prototypes

void alert(short n,short m);
void cmdMes(void);
void commands(void);
void demote(short n);
void display(void);
short doTime(void);
void promote(short n);
void doSeek(void);
void doTeach(short argc,char **argv);
short getCommand(void);
void getDrill(void);
void getTimeOut(void);
void iOpen(char *fname);
void myWrite(char *string);
void openDo(short argc,char **argv);
void quitDo(void);
void saveAsDo(void); 
short screenchr(void);
void sessions(void);
void setRung(short n);
void show4(short n);
void show5(short n);
void show611(short n);
void show7(short n);
short showSel(short n);
void showStat(void);
short showTest(short n);
#ifdef IBM
void SysBeep(void);
#else
Boolean kbhit(void);
#endif
Boolean testIn(void);
void writeStat(void);

