home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c222 / 1.ddi / DEMOS / SY_TEST.C < prev    next >
Encoding:
C/C++ Source or Header  |  1990-05-22  |  2.4 KB  |  80 lines

  1. /*********************
  2.  *
  3.  *  sy_test.c - system function test program.
  4.  *
  5.  *  Purpose: This file contains tests of the system functions.
  6.  *
  7.  *  Blackstar C Function Library
  8.  *  (c) Copyright 1985 Sterling Castle Software
  9.  *
  10.  *******/
  11.  
  12. #include <stdio.h>
  13. #include <stdlib.h>
  14. #include "blackstr.h"
  15. #include "sc_head.h"
  16. #include "kb_head.h"
  17. #include "ut_head.h"
  18.  
  19.  
  20. void main()
  21. {
  22.     int i,vec[3];
  23.     char *ptr;
  24.     extern int hour_,minute_,sec_,hsec_,year_,month_,day_,sy_dosver_,sy_dosrel_;
  25.     extern int sy_drivef_[],sy_prnts_,sy_flpys_,sy_vmod_,sy_memk_;
  26.     extern char *sy_ffdir(),*sy_fdir();
  27.  
  28.     /********************************
  29.      INITIALIZE AND SAY HELLO
  30.     ********************************/
  31.     sc_init(MO_BW80,BLUE,WHITE);            /* init screen */
  32.     sc_setcur(20,0);
  33.     sc_puts("Hello from sy_test.\n\n");
  34.     sy_gtime();
  35.     sy_gdate();
  36.     printf("Time is %d:%d:%d.%d\n",hour_,minute_,sec_,hsec_);
  37.     printf("Date is %d/%d/%d\n\n",month_,day_,year_);
  38.  
  39.     /********************************
  40.      DO DIRECTORY SEARCH FOR .EXE
  41.     *********************************/
  42.     sc_setcur(0,6);
  43.     sc_puts("Search for *.*\n");
  44.     sc_puts("Press any key to continue..\n");
  45.     kb_getc();
  46.     sc_puts(sy_ffdir("*.*",0));   /* first directory entry */
  47.     sc_putc('\n');
  48.     while((ptr=sy_fdir()) != NULL) {
  49.     sc_puts(ptr);
  50.     sc_putc('\n');
  51.     }
  52.  
  53.     /************************************************
  54.      GET EQUIPMENT AND MEMORY AND VERSION
  55.     *************************************************/
  56.     printf("\n\n Start of Phase 2 -- push any key to continue...");
  57.     kb_getc();
  58.     sy_getsys();
  59.     printf("\n\nDOS version: %d.%d\n",sy_dosrel_,sy_dosver_);
  60.     printf("# printers : %d\n",sy_prnts_);
  61.     printf("# floppies : %d\n",sy_flpys_);
  62.     printf("video mode : %d\n",sy_vmod_);
  63.     printf("memory     : %dk bytes\n",sy_memk_);
  64.  
  65.     /********************************************
  66.      SHOW LOW LEVEL SET/GET INTERRUPT VECTOR
  67.     *********************************************/
  68.     printf("\n\n Interrupt test -- push any key to continue... ");
  69.     kb_getc();
  70.     sy_getintv(05,vec);
  71.     printf("\n\nInterrupt 5 is at %x:%x\n\n",vec[1],vec[0]);
  72.     printf("\n Disk drive test (1 - installed  0 - not installed).\n\n");
  73.     for(i=0;i<4;++i)
  74.     printf("Drive flag %d is %d\n",i,sy_isdrive(i));
  75.  
  76.     printf("\n\nEND OF TEST - Press any key to exit...");
  77.     kb_getc();
  78.     sc_clr();
  79. }
  80.