home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The C Users' Group Library 1994 August
/
wc-cdrom-cusersgrouplibrary-1994-08.iso
/
listings
/
v_08_08
/
8n08114a
< prev
next >
Wrap
Text File
|
1990-07-18
|
3KB
|
88 lines
/*----------------------------------------------------------------------\
| Marcus W. Johnson 1990 |
| |
| Code to demonstrate IdentifyVideo() |
\----------------------------------------------------------------------*/
#include <stdio.h>
#include "video.h"
/* Print the name of the adaptor and the display device */
static void Name(struct video *v)
{
switch (v->VideoAdaptor)
{
case UnknownAdaptor:
puts("No Video Adaptor Detected");
break;
case MDA:
puts("Monochrome Display Adaptor");
break;
case CGA:
puts("Color Graphics Adaptor");
break;
case EGA:
puts("Enhanced Graphics Adaptor");
break;
case MCGA:
puts("Multi-Color Graphics Array");
break;
case VGA:
puts("Video Graphics Array");
break;
case HGC:
puts("Hercules Graphics Card");
break;
case HGCPlus:
puts("Hercules Graphics Card Plus");
break;
case HerculesInColor:
puts("Hercules InColor Card");
break;
default:
puts("Program Error: Unidentified Video Adaptor");
break;
}
switch (v->VideoMonitor)
{
case UnknownMonitor:
puts("No Monitor Detected");
break;
case MDAMonochrome:
puts("Monochrome Monitor");
break;
case CGAColor:
puts("CGA Color Monitor");
break;
case EGAColor:
puts("EGA Color Monitor");
break;
case PS2Monochrome:
puts("PS/2 Monochrome Monitor");
break;
case PS2Color:
puts("PS/2 Color Monitor");
break;
default:
puts("Program Error: Unidentified Video Monitor");
break;
}
}
/* Demonstates use of IdentifyVideo() */
void main()
{
struct video *v;
v = IdentifyVideo();
if (v->VideoAdaptor != UnknownAdaptor)
{
Name(v++);
if (v->VideoAdaptor != UnknownAdaptor)
Name(v);
}
else
puts("No known video adaptor or monitor");
}