/* ----------------------------------------------------------- */ int main (int argc, char *argv[]) { LINE str; LINE word; long num; long cnt=0L; int rc; if (Open_Files(argc, argv)) return -1; current_word[0]='\0'; while (fgets (str, MAX_LEN_LINE, f_wnums) != NULL) { cnt++; rc = sscanf (str, "%s %ld", word, &num); if (rc!=2) { printf ("str #%ld: failed sscanf from '%s'\n", cnt, str); break; } if (!strcmp(word, "вася")) cnt=cnt; Find_Save(word, num); } Close_Files (); return 0; }
wrpStats::wrpStats(int argc, char *argv[]) { Open_Files(argc, argv); Read_Signature(); // 8WVR, ArmA style if (strcmp (sig, "8WVR") == 0) Read_8WVR(); // 4WVR, OFP style if (strcmp (sig, "4WVR") == 0) Read_4WVR(); }
seaLevel::seaLevel(int argc, char *argv[]) { Open_Files(argc, argv); Read_Signature(); Read_Elevations(); Read_Textures(); Write_Elevations(); Write_Textures(); Read_Objects(); Close_Files(); }
int main (int argc, char *argv[]) { unsigned int i; unsigned long words_cnt=0L; int rc; LINE str, res; init_ascii_table (); if (Open_Files(argc, argv)) return -1; /***************************************************************************/ /* the main loop: find required blocks */ /***************************************************************************/ while (fgets (str, MAX_LEN_LINE, f_src) != NULL) { koi8_string_tolower (str, res); printf ("%s\n", res); //fprintf (f_dst, "%s\n", res); } /**************************************************************************/ Close_Files(); return 0; }
int main() { struct solarSystem system; unsigned int ID = 0,//Starting ID and current ID maxID = 0,//Maximum ID to generate choice = 0;//Output selection printf("Written by Craig Comberbach.\nCreated in 2011\nVersion %0.1f\n\n", REVISION); //Start ID Sentry while(ID < 1)//0 is an illegal ID { //Gather the starting ID from the user printf("Generate from ID: "); scanf("%d", &ID); } //Max ID Sentry while(maxID < ID)//The value has to be at least equal to the minimum ID, but also, not below it! { //Gather the maximum starting ID from the user printf("Generate to ID: "); scanf("%d", &maxID); } //Choice Sentry while((choice < 1) || (choice > 3))//It has to be either a 1, 2 or a 3 { //Gather the user O/P choice printf("\n1: Database capable output (*.csv)"); printf("\n2: Single spreadsheet output (*.csv)"); printf("\n3: Onscreen display\n"); printf("\nChoose output format: "); scanf("%d", &choice); }//*/ //Formating printf("\n\n\n\n"); //Open the files for edditing Open_Files(choice); for(; ID <= maxID; ++ID) { //Create the system from scratch system = initializeStars(system);//Remove any previous data system = generateSystem(system, ID);//Create new data //How to display the newly created system switch(choice) { case 1: print_DB_file(system); break; case 2: print_CSV_file(system); break; case 3: displaySystem(system); getch();//Pause for the user to preview the output break; default: printf("Whoops, I need to fix that!\n"); } //Display the currently finished ID of the printf("ID = %d\r",ID); } //Close all open files Close_Files(); //Sign off for now printf("\n\n\n\nThanks for using the GURPS Solar System Builder\n\n\n"); //Bye for now return 0; }
csv2Ext::csv2Ext(int argc, char *argv[]) { Open_Files(argc, argv); Read_Lines(); Close_Files(); }