home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c017 / 2.ddi / FUNCLIB.ZIP / TEST.C < prev   
Encoding:
C/C++ Source or Header  |  1988-06-05  |  1.8 KB  |  59 lines

  1. #include <stdio.h>
  2. #include <conio.h>
  3. #include "resident.h"
  4.  
  5. int window_one_buff [ (39 + 2) * (4 + 2) ]; 
  6. int run_once = 0, low_color = MONOCHROME, hi_color; 
  7. int pass_buffer [ 35 * 2 + 1 ]; 
  8.  
  9. struct WINDOW window_one; 
  10.  
  11. void test_box (void) 
  12.    { 
  13.       int key; 
  14.  
  15.       if (run_once)  
  16.          exch_window (&window_one); 
  17.       else { 
  18.          make_window (&window_one); 
  19.          dis_str (11, 21, " Test of Memory Resident Library V2.03 ", low_color); 
  20.          dis_str (12, 21, " Press the arrow & paging keys to move ", low_color); 
  21.          dis_str (13, 21, " Press ESC to uninstall the test Prog. ", low_color); 
  22.          dis_str (14, 25,     "Press any other key to exit.", low_color); 
  23.          run_once = 1; 
  24.       } 
  25.       hidecur (); 
  26.       while (!(key = getch ())) 
  27.          key_window (getch (), &window_one);  
  28.       keystrokes ("Test Passed!", pass_buffer);  
  29.       exch_window (&window_one); 
  30.       normalcur (); 
  31.       if (key == 27) 
  32.          drop_tsr (); 
  33.    } 
  34.  
  35. void main (void) 
  36.    { 
  37.       if (loaded ()) 
  38.          printf ("The test program has already been loaded"); 
  39.       else { 
  40.          if (iscolor ()) 
  41.             low_color = color (GREEN, BLACK); 
  42.          hi_color = 10; 
  43.          STACK_SIZE = 200; 
  44.          window_one.row = 10; 
  45.          window_one.col = 20; 
  46.          window_one.hlen = 39; 
  47.          window_one.vlen = 4; 
  48.          window_one.color = hi_color; 
  49.          window_one.buffer = window_one_buff; 
  50.          window_one.vtype = DOUBLE_LINE; 
  51.          window_one.htype = DOUBLE_LINE; 
  52.          printf ("\n"); 
  53.          printf ("Memory Resident Library V2.03 Test Program\n"); 
  54.          printf ("Press Ctrl - Alt - T to call up.\n"); 
  55.          go_resident (test_box, KEY_T, KEY_ALT, KEY_CTRL);  
  56.       } 
  57.    } 
  58.  
  59.