#include <resident.h>

int window_one_buff [ (37 + 2) * (3 + 2) ];
int run_once = 0, low_color = 2, hi_color = 12;
int pass_buffer [ 20 ], extkey, extended = 0;

struct WINDOW window_one;

void test_box ()
   {
      if (run_once) 
         exch_window (&window_one);
      else {
         make_window (&window_one);
         dis_str (11, 21, "Test of Memory Resident Library V1.00", low_color);
         dis_str (12, 21, "Press the arrow & paging keys to move", low_color);
         dis_str (13, 25,     "Press any other key to exit.", low_color);
         run_once = 1;
      }
      hidecur ();
      while (!getch ())
         key_window (getch (), &window_one); 
      exch_window (&window_one);
      normalcur ();
      keystrokes ("Test Passed!", pass_buffer); 
   }

main ()
   {
      if (loaded (test_box))
         printf ("The test program has already been loaded");
      else {
         SCREEN_SPEED = SCREEN_DIRECT;
			STACK_SIZE = 200;
         window_one.row = 10;
         window_one.col = 20;
         window_one.hlen = 37;
         window_one.vlen = 3;
         window_one.color = hi_color;
         window_one.buffer = window_one_buff;
         window_one.vtype = DOUBLE_LINE;
         window_one.htype = DOUBLE_LINE;
			printf ("\n");
         printf ("Memory Resident Library V1.00 Test Program\n");
         printf ("Press Ctrl - Alt - T to call up.\n");
         go_resident (test_box, KEY_T, KEY_ALT, KEY_CTRL); 
      }
   }

