#include "math.h" #include "stdlib.h" #include "conio.h" #include "stdio.h" #include "ctype.h" #include "programs\types.h" #include "programs\io.h" #include "programs\menu.h" #define TRUE 1 #define FALSE 0 /**************************************************************************/ /* Department of Commerce National Oceanic and Atmospheric Administration National Ocean Service National Geodetic Servery - Gravity, Astronomy and Space Geodesy Author: James F. Maloney, Jr. Date: August 1, 1988 DISCLAIMER: This program and supporting information are furnished by the government of the United States of America, and accepted and used by the recipient iwht the understanding that the United States government makes no warranties, expressed or implied, concerning the accuracy of its constituent parts or of any supporting data. The government of the United States of America shall be under no liability whatsoever resulting from any use of this program. This program should not be relied uplon as the sole basis for solving a problem whose incorrect solution could result in injury to person or property. This program is property of the government of the United States of America. Therefore, the recipient further agrees not to assert property rights therein and not to represent this program to anyone as being other than a government program. Any questions should be directed to James Maloney or Dave Minkel at the National Geodetic Survey in Rockville. ***************************************************************************/ main () { /* Variable Declaration */ char infile[13]; /* G-file name */ char answer[4]; /* Y or N answer holder */ int DONE; /* Boolean variable to tell whether to continue */ /* Function Declaration */ void banner (); FILE *fopen(), *fp; /* Initialize variables */ DONE = FALSE; banner (); /* Get name of input file */ gotoxy(1,24); printf("Enter G-file name: "); gotoxy(20,24); scanf("%s", infile); if(access("default.fil",0) != 0) { fp = fopen("default.fil", "w"); Menu_Control(5,fp); fclose(fp); } else { clrscr(); gotoxy(04,11); printf("A default file aready exists, do you wish to use this file (Y)es or (N)o"); gotoxy(40,12); scanf("%s",answer); strupr(answer); if(!(strcmp(answer,"N")) || !(strcmp(answer, "NO"))) { fp = fopen("default.fil", "w"); Menu_Control(5,fp); fclose(fp); } } Initialize_Menus (); /* Open the g-file */ if(access(infile, 0) != 0) { fp = fopen(infile, "w"); Menu_Control (1,fp); } else fp = fopen(infile, "a+t"); /* Continue to process unitil the user does not want to add */ /* to the g-file anymore */ while(!DONE) { Menu_Control(2,fp); Menu_Control(3,fp); Menu_Control(4,fp); /* Does the user wish to continue with the input */ clrscr(); gotoxy(16,10); printf("Do you wish to continue updating the g-file? (Y)es or (N)o"); gotoxy(40,11); scanf("%s",answer); strupr(answer); if(!strcmp(answer, "Y") || !strcmp(answer, "YES")) DONE = FALSE; else { DONE = TRUE; fclose(fp); } } } void banner () { clrscr (); gotoxy(33,4); printf("CR8G"); gotoxy(25,5); printf("Standard G-file Maker"); gotoxy(19,11); printf("National Geodetic Survey, N/CG142"); gotoxy(23,12); printf("Rockville, Maryland 20852"); gotoxy(22,20); printf("Version 1.10 December 27, 1988"); }