home *** CD-ROM | disk | FTP | other *** search
- /*********************
- *
- * sy_test.c - system function test program.
- *
- * Purpose: This file contains tests of the system functions.
- *
- * Blackstar C Function Library
- * (c) Copyright 1985 Sterling Castle Software
- *
- *******/
-
- #include <stdio.h>
- #include <stdlib.h>
- #include "blackstr.h"
- #include "sc_head.h"
- #include "kb_head.h"
- #include "ut_head.h"
-
-
- void main()
- {
- int i,vec[3];
- char *ptr;
- extern int hour_,minute_,sec_,hsec_,year_,month_,day_,sy_dosver_,sy_dosrel_;
- extern int sy_drivef_[],sy_prnts_,sy_flpys_,sy_vmod_,sy_memk_;
- extern char *sy_ffdir(),*sy_fdir();
-
- /********************************
- INITIALIZE AND SAY HELLO
- ********************************/
- sc_init(MO_BW80,BLUE,WHITE); /* init screen */
- sc_setcur(20,0);
- sc_puts("Hello from sy_test.\n\n");
- sy_gtime();
- sy_gdate();
- printf("Time is %d:%d:%d.%d\n",hour_,minute_,sec_,hsec_);
- printf("Date is %d/%d/%d\n\n",month_,day_,year_);
-
- /********************************
- DO DIRECTORY SEARCH FOR .EXE
- *********************************/
- sc_setcur(0,6);
- sc_puts("Search for *.*\n");
- sc_puts("Press any key to continue..\n");
- kb_getc();
- sc_puts(sy_ffdir("*.*",0)); /* first directory entry */
- sc_putc('\n');
- while((ptr=sy_fdir()) != NULL) {
- sc_puts(ptr);
- sc_putc('\n');
- }
-
- /************************************************
- GET EQUIPMENT AND MEMORY AND VERSION
- *************************************************/
- printf("\n\n Start of Phase 2 -- push any key to continue...");
- kb_getc();
- sy_getsys();
- printf("\n\nDOS version: %d.%d\n",sy_dosrel_,sy_dosver_);
- printf("# printers : %d\n",sy_prnts_);
- printf("# floppies : %d\n",sy_flpys_);
- printf("video mode : %d\n",sy_vmod_);
- printf("memory : %dk bytes\n",sy_memk_);
-
- /********************************************
- SHOW LOW LEVEL SET/GET INTERRUPT VECTOR
- *********************************************/
- printf("\n\n Interrupt test -- push any key to continue... ");
- kb_getc();
- sy_getintv(05,vec);
- printf("\n\nInterrupt 5 is at %x:%x\n\n",vec[1],vec[0]);
- printf("\n Disk drive test (1 - installed 0 - not installed).\n\n");
- for(i=0;i<4;++i)
- printf("Drive flag %d is %d\n",i,sy_isdrive(i));
-
- printf("\n\nEND OF TEST - Press any key to exit...");
- kb_getc();
- sc_clr();
- }
-