home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD2.mdf
/
c
/
worldmap
/
demo
/
setopt.c
< prev
Wrap
Text File
|
1986-01-21
|
1KB
|
45 lines
/* setopt - set the graphics driver and print device in the option file.
Copyright 1986 John B. Allison */
setopt(){
#include "\lc\stdio.h"
FILE *fp;
char gfilename[40], pfilename[40];
static char *fname = "demo.opt";
static char *form = "Format error in the contents of options file \"%s\"\n";
/* Choose the display device (e.g., IBM graphics card)
for Multi Halo */
if((fp = fopen(fname, "ra")) == 0){
printf("Error opening options file %s\n", fname);
exit();
}
if(fscanf(fp, "%s", gfilename) != 1){
printf(form, fname);
printf("Expecting \"FILENAME for graphics driver\"\n");
printf("where FILENAME is, for example, \\halo\\haloibm.dev\n");
exit();
}
if(fscanf(fp, "%s", pfilename) != 1){
printf(form, fname);
printf("Expecting \"FILENAME for print device\"\n");
printf("where FILENAME is, for example, \\halo\\haloepsn.prn\n");
exit();
}
fclose(fp);
setprn(pfilename); /* Use this Halo print device */
setdev(gfilename); /* Use this Halo graphics driver */
}