int main(int argc, char **argv) { char textName[MAXPATH]; char symbName[MAXPATH]; fpstream* helpStrm; // Banner messages char initialText[] = "Help Compiler Version 1.0 Copyright (c) 1991" " Borland International.\n"; char helpText[] = "\n Syntax TVHC <Help text>[.TXT] [<Help file>[.HLP] [<Symbol file>[.H]]\n" "\n" " Help text = Help file source\n" " Help file = Compiled help file\n" " Symbol file = An include file containing all the screen names as const's\n"; char bufStr[MAXSTRSIZE]; cout << initialText; if (argc < 2) { cout << helpText; exit(1); } // Calculate file names strcpy(textName,replaceExt(argv[1], ".TXT", False)); if (!fExists(textName)) { strcpy(bufStr,"File "); strcat(bufStr,textName); strcat(bufStr," not found."); error(bufStr); } if (argc >= 3) strcpy(helpName, replaceExt(argv[2], ".HLP", False)); else strcpy(helpName, replaceExt(textName, ".HLP", True)); checkOverwrite( helpName ); if (argc >= 4) strcpy(symbName, replaceExt(argv[3], ".H", False)); else strcpy(symbName, replaceExt(helpName, ".H", True)); checkOverwrite( symbName ); TProtectedStream textStrm(textName, ios::in); TProtectedStream symbStrm(symbName, ios::out); helpStrm = new fpstream(helpName, ios::out|ios::binary); processText(textStrm, *helpStrm, symbStrm); return 0; }
int main(int argc, char **argv) { AppOptions appopt; appopt.cmd=CmdWorld; appopt.parse(argc, argv); msglevel=appopt.msglevel; appopt.welcome(); if(appopt.sgdump_only) { dump_sg_tables(); } else if(appopt.listobj_only) { ASEParser p(appopt.ase_name); p.parse(NULL, NULL, NULL); } else { char iname[200], ncpname[200]; ASEMaterialList *mats=new ASEMaterialList(); MEM(mats); ASEMeshList *meshes=new ASEMeshList(); MEM(meshes); ASEParser p(appopt.ase_name); p.parse(meshes, mats, appopt.names); World *w=meshes->createWorld(mats, appopt.wmode); strcpy(iname, appopt.out_name); replaceExt(iname, SUFFIX_W_IM); strcpy(ncpname, appopt.out_name); replaceExt(ncpname, SUFFIX_NCP); w->write_w(appopt.out_name, iname, ncpname); delete w; appopt.warn_untouched(); delete mats; delete meshes; } return 0; }
bool isFileExtExists( const char * oldName, const char * ext ) { char * p_Name; bool val; p_Name = (char *)malloc( LINE_SIZE ); assert( p_Name != NULL ); strcpy( p_Name, oldName ); replaceExt( p_Name, ext ); val = isFileExists( p_Name ); //free( p_Name ); return val; }