home *** CD-ROM | disk | FTP | other *** search
- /*
- xcstatus.c - XCOMMS TSR status program
-
- Executing XCSTATUS.EXE will report the status of the
- TSR version of XCOMMS resident program. DO NOT EXECUTE
- WITH THE BUNDLED XCOMMS KERNAL!
-
- To execute, execute the following:
- C>XCSTATUS
- --------
-
- (C) Copyright 1989, South Mountain Software Incorporated
- All Rights Reserved
-
- */
-
- #include "xc.h"
- extern long xc_test(); /* All others are int's */
- extern unsigned int xc_vectr; /* The resultant XCOMMS vector */
-
- char copyr[] = "(C) Copyright 1991 South Mountain Software, Inc.\n";
-
- main()
- {
- int major_rev, minor_rev;
- int total_buffers, buffers_avail;
- char string1[22], string2[22];
- int ports;
- int i;
-
- if (xc_entr(1) == 0) {
- xc_vers(&major_rev, &minor_rev, &total_buffers, &buffers_avail);
- printf("\nXCSTATUS - XCOMMS status summary\n");
- printf("Revision of XCOMMS is %d.%d, ", major_rev, minor_rev);
- printf("vector is %x hex\n\n", xc_vectr);
- printf("%d Buffers allocated by XCOMMS\n", total_buffers);
- printf("%d Buffers currently used\n", total_buffers - buffers_avail);
- printf("%d Buffers currently available\n\n", buffers_avail);
- printf("Maximum number of ports=%d\n", ports = xc_gport());
-
- printf("Ctrl-Break monitoring is ");
- if (xck_stat())
- printf("enabled\n");
- else
- printf("disabled\n");
- printf("Timer services are ");
- if (xct_stat())
- printf("enabled\n\n");
- else
- printf("disabled\n\n");
-
- for (i = 0; (i < ports); ++i) {
- printf("COM%1d = ", i + 1);
- if (xc_tport(i) == 1) {
- printf("Not installed");
- } else {
- if (xc_stat(i))
- printf( "Interrupt driven, ");
- else
- printf( "Polled, ");
- printf("Received %ld bytes, ", xc_test(i));
- printf("Signals are ");
- if (xc_dtr(i, 2))
- printf("DTR ");
- if (xc_rts(i, 2))
- printf("RTS ");
- if (xc_dcd(i))
- printf("DCD ");
- if (xc_cts(i))
- printf("CTS ");
- if (xc_dsr(i))
- printf("DSR ");
- }
- printf("\n");
- }
- } else
- printf("XCOMMS is not installed???\n");
- }
-