void DoTestFiles(const char *filelist, const char *environment) { if (!GetTestFiles(filelist)) { printf("No Files to test!\r\n"); return; } Results.SetSize(IsapiFileList.GetSize()); ReadGlobalEnvironment(environment); DoThreads(); printf("\r\nRESULTS:\r\n"); // show results: DWORD r = Results.GetSize(); for (DWORD i=0; i< r; i++) { TResults result = Results.GetAt(i); printf("%s\r\nOK: %d FAILED: %d\r\n", TestNames.GetAt(i), result.ok, result.bad); } // delete temp files printf("Deleting Temp Files\r\n"); DeleteTempFiles("exp.*"); DeleteTempFiles("pht.*"); printf("Done\r\n"); }
void wxcXmlResourceCmp::CompileRes() { wxArrayString files = PrepareTempFiles(); wxRemoveFile(m_outputCppFile); if(!m_retCode) { MakePackageCPP(files); } DeleteTempFiles(files); }
void BindExec() { int n; char temppath[128]; // passed as *path argument char tempname[128]; // passed as *argv[0] char tempparm[128]; // -UN name of file char tempparm2[128]; // -BN name of file char temptype[8]; // action type, either "-R" or "-RS" const char *path=temppath; const char *arg0=bindname; const char *arg1=temptype; const char *arg2="/S"; const char *arg3=tempparm; const char *arg4=tempparm2; const char *arg5=tempname2; if(bindtype==0) strcpy(temptype,"/R"); else if(bindtype==1) strcpy(temptype,"/RS"); else if(bindtype==2) strcpy(temptype,"/RC"); strcpy(temppath,bindname); strcpy(tempname,bindname); strcpy(tempparm,"/UN"); strcat(tempparm,tempname2); strcpy(tempparm2,"/BN"); strcat(tempparm2,newfilename); n=spawnle(P_WAIT, path, arg0,arg1,arg2,arg3,arg4,arg5, NULL, NULL); if(n==-1) { GetDOS32APath(); strcpy(temppath,dos32apath); strcat(temppath,bindname); strcpy(tempname,dos32apath); strcat(tempname,bindname); n=spawnle(P_WAIT, path, arg0,arg1,arg2,arg3,arg4,arg5, NULL, NULL); if(n==-1) { strcpy(temppath,bindname); strcpy(tempname,bindname); n=spawnlpe(P_WAIT, path, arg0,arg1,arg2,arg3,arg4,arg5, NULL, NULL); if(n==-1) err_nosb(); } } if(n!=0) { if(n==127) err_support(tempname2); else { DeleteTempFiles(); exit(1); } } }
void UnbindExec() { int n; char temppath[128]; // passed as *path argument char tempname[128]; // passed as *argv[0] char tempparm[128]; // name of file to be processed const char *path=temppath; const char *arg0=bindname; const char *arg1="/U"; const char *arg2="/O"; const char *arg3="/S"; const char *arg4=tempparm; const char *arg5=oldfilename; strcpy(temppath,bindname); strcpy(tempname,bindname); strcpy(tempparm,"/UN"); strcat(tempparm,tempname1); n=spawnle(P_WAIT, path, arg0,arg1,arg2,arg3,arg4,arg5, NULL, NULL); if(n==-1) { GetDOS32APath(); strcpy(temppath,dos32apath); strcat(temppath,bindname); strcpy(tempname,dos32apath); strcat(tempname,bindname); n=spawnle(P_WAIT, path, arg0,arg1,arg2,arg3,arg4,arg5, NULL, NULL); if(n==-1) { strcpy(temppath,bindname); strcpy(tempname,bindname); n=spawnlpe(P_WAIT, path, arg0,arg1,arg2,arg3,arg4,arg5, NULL, NULL); if(n==-1) err_nosb(); } } if(n!=0) { if(n==127) err_support(oldfilename); else { DeleteTempFiles(); exit(1); } } }
void XmlResApp::CompileRes() { wxArrayString files = PrepareTempFiles(); wxRemoveFile(parOutput); if (!retCode) { if (flagCPP){ MakePackageCPP(files); if (flagH) GenCPPHeader(); } else if (flagPython) MakePackagePython(files); else MakePackageZIP(files); } DeleteTempFiles(files); }
void main(int argc, char *argv[]) { int n; // Debug_Init(); setbuf(stdout,NULL); CheckEnvironment(); ArgInit(argc, argv); DeleteTempFiles(); CreateD32AEnvVar(); CheckExec(argv); oldfilesize=GetFileSize(oldfilename); UnbindExec(); OpenExec(); Exec_Type=FindExecType(); Print("\n"); if(!verbose) Print("+ Unbinding Exec : Ok.\n"); else Print("+ Unbinding Exec : Ok. (%s-style)\n",execstyle[Exec_Type-1]); CloseExec(); if(advanced) { if(!quiet) printf("+ Preprocessing Exec : "); n=relocate_exec(tempname1); if(n!=0) { Print("Error! \n"); err_relocator(n); } if(!verbose) Print("Ok.\n"); else Print("Ok. (%d fixups)\n",relocated_fixups); } OpenExec(); CompressExec(); CloseExec(); if(bind) { BindExec(); if(!verbose) Print("+ Binding Exec : Ok.\n"); else Print("+ Binding Exec : Ok. (Stub file used: \"%s\")\n",stubnames[bindtype]); } else { unlink(newfilename); copy_file(tempname2,newfilename); unlink(tempname2); } newfilesize=GetFileSize(newfilename); DeleteTempFiles(); if(!quiet) { printf("\n Original Exec Stats: \"%s\", %s-style, %d bytes\n", oldfilename, execstyle[Exec_Type-1], oldfilesize); printf("Compressed Exec Stats: \"%s\", %s-style, %d bytes (%1.1f%%)\n", newfilename, execstyle[2], newfilesize, (float)(newfilesize+0.01)/(float)(oldfilesize+0.01) *100); } else { if(!silent) printf("SC/32A: File \"%s\" has been successfully compressed\n", oldfilename); } exit(0); }
void err_relocator(int n) { printf("%s an error (#%04X) had occured while preprocessing exec\n",errstr,n); DeleteTempFiles(); exit(1); }
void err_objects(char *str) { printf("%s too many Objects in application \"%s\"\n",errstr,str); DeleteTempFiles(); exit(1); }
void err_lcobjhdr(char *str) { printf("%s overflow in object header when encoding \"%s\"\n",errstr,str); DeleteTempFiles(); exit(1); }
void err_write(char *str) { printf("%s error writing to file \"%s\"\n",errstr,str); DeleteTempFiles(); exit(1); }
void err_seek(char *str) { printf("%s error seeking in file \"%s\"\n",errstr,str); DeleteTempFiles(); exit(1); }
void err_formlc(char *str) { printf("%s application \"%s\" is already LC-encoded\n",errstr,str); DeleteTempFiles(); exit(1); }
void err_nosb(void) { printf("%s cannot spawn SUNSYS Bind Utility \"%s\"\n",errstr,bindname); DeleteTempFiles(); exit(1); }
void err_arg(char *str) { printf("%s invalid or misplaced command or option \"%s\"\n",errstr,str); DeleteTempFiles(); exit(1); }
void err_support(char *str) { printf("%s unsupported exec format in file \"%s\"\n",errstr,str); DeleteTempFiles(); exit(1); }
void err_mem() { printf("%s not enough extended memory\n",errstr); DeleteTempFiles(); exit(1); }
void err_open(char *str) { printf("%s cannot open file \"%s\"\n",errstr,str); DeleteTempFiles(); exit(1); }
void err_formpe(char *str) { printf("%s compression of PE-style application \"%s\" is not supported\n",errstr,str); DeleteTempFiles(); exit(1); }
void err_read(char *str) { printf("%s error reading from file \"%s\"\n",errstr,str); DeleteTempFiles(); exit(1); }
void err_formpmw1(char *str) { printf("%s cannot compress PMW1-compressed application \"%s\"\n",errstr,str); DeleteTempFiles(); exit(1); }
void err_temp(char *str) { printf("%s error creating temp file \"%s\"\n",errstr,str); DeleteTempFiles(); exit(1); }
void err_linker(char *str) { printf("%s application \"%s\" was incorrectly linked\n",errstr,str); DeleteTempFiles(); exit(1); }