int16 FUNC_BINARYFORMATCHECK(qbs*_FUNC_BINARYFORMATCHECK_STRING_PATHTOCHECK,qbs*_FUNC_BINARYFORMATCHECK_STRING_PATHSEPTOCHECK,qbs*_FUNC_BINARYFORMATCHECK_STRING_FILETOCHECK){
qbs *tqbs;
ptrszint tmp_long;
int32 tmp_fileno;
uint32 qbs_tmp_base=qbs_tmp_list_nexti;
uint8 *tmp_mem_static_pointer=mem_static_pointer;
uint32 tmp_cmem_sp=cmem_sp;
#include "data461.txt"
mem_lock *sf_mem_lock;
new_mem_lock();
sf_mem_lock=mem_lock_tmp;
sf_mem_lock->type=3;
libqb_check_stack();
if (is_error_pending()) goto exit_subfunc;
do{
qbs_set(__STRING_FILE,qbs_add(qbs_add(_FUNC_BINARYFORMATCHECK_STRING_PATHTOCHECK,_FUNC_BINARYFORMATCHECK_STRING_PATHSEPTOCHECK),_FUNC_BINARYFORMATCHECK_STRING_FILETOCHECK));
qbs_cleanup(qbs_tmp_base,0);
if(!qbevent)break;evnt(28182,4,"ide_converters.bas");}while(r);
do{
*_FUNC_BINARYFORMATCHECK_LONG_FH=func_freefile();
if(!qbevent)break;evnt(28182,6,"ide_converters.bas");}while(r);
do{
sub_open(__STRING_FILE, 2 ,NULL,NULL,*_FUNC_BINARYFORMATCHECK_LONG_FH,NULL,0);
qbs_cleanup(qbs_tmp_base,0);
if(!qbevent)break;evnt(28182,7,"ide_converters.bas");}while(r);
do{
qbs_set(_FUNC_BINARYFORMATCHECK_STRING_A,func_space(func_lof(*_FUNC_BINARYFORMATCHECK_LONG_FH)));
qbs_cleanup(qbs_tmp_base,0);
if(!qbevent)break;evnt(28182,8,"ide_converters.bas");}while(r);
do{
sub_get2(*_FUNC_BINARYFORMATCHECK_LONG_FH, 1 ,_FUNC_BINARYFORMATCHECK_STRING_A,1);
qbs_cleanup(qbs_tmp_base,0);
if(!qbevent)break;evnt(28182,9,"ide_converters.bas");}while(r);
S_69445:;
if ((qbs_cleanup(qbs_tmp_base,-(func_instr(NULL,_FUNC_BINARYFORMATCHECK_STRING_A,func_chr( 0 ),0)== 0 )))||is_error_pending()){
if(qbevent){evnt(28182,10,"ide_converters.bas");if(r)goto S_69445;}
do{
sub_close(*_FUNC_BINARYFORMATCHECK_LONG_FH,1);
if(!qbevent)break;evnt(28182,10,"ide_converters.bas");}while(r);
do{
goto exit_subfunc;
if(!qbevent)break;evnt(28182,10,"ide_converters.bas");}while(r);
}
do{
qbs_set(_FUNC_BINARYFORMATCHECK_STRING_A,qbs_new_txt_len("",0));
qbs_cleanup(qbs_tmp_base,0);
if(!qbevent)break;evnt(28182,11,"ide_converters.bas");}while(r);
do{
sub_get(*_FUNC_BINARYFORMATCHECK_LONG_FH, 1 ,byte_element((uint64)_FUNC_BINARYFORMATCHECK_INTEGER_FORMAT,2,byte_element_8089),1);
if(!qbevent)break;evnt(28182,12,"ide_converters.bas");}while(r);
do{
sub_get(*_FUNC_BINARYFORMATCHECK_LONG_FH,NULL,byte_element((uint64)_FUNC_BINARYFORMATCHECK_INTEGER_VERSION,2,byte_element_8090),0);
if(!qbevent)break;evnt(28182,13,"ide_converters.bas");}while(r);
do{
sub_close(*_FUNC_BINARYFORMATCHECK_LONG_FH,1);
if(!qbevent)break;evnt(28182,14,"ide_converters.bas");}while(r);
S_69453:;
if(qbevent){evnt(28182,16,"ide_converters.bas");if(r)goto S_69453;}
S_69454:;
if (((*_FUNC_BINARYFORMATCHECK_INTEGER_FORMAT==( 2300 )))||is_error_pending()){
if(qbevent){evnt(28182,17,"ide_converters.bas");if(r)goto S_69454;}
do{
*_FUNC_BINARYFORMATCHECK_LONG_RESULT=FUNC_IDEMESSAGEBOX(qbs_new_txt_len("Invalid format",14),qbs_new_txt_len("VBDOS binary format not supported.",34),qbs_new_txt_len("",0));
qbs_cleanup(qbs_tmp_base,0);
if(!qbevent)break;evnt(28182,18,"ide_converters.bas");}while(r);
do{
*_FUNC_BINARYFORMATCHECK_INTEGER_BINARYFORMATCHECK= 1 ;
if(!qbevent)break;evnt(28182,19,"ide_converters.bas");}while(r);
sc_ec_486_end:;
goto sc_8091_end;
}
S_69457:;
if (((*_FUNC_BINARYFORMATCHECK_INTEGER_FORMAT==( 764 )))||is_error_pending()){
if(qbevent){evnt(28182,20,"ide_converters.bas");if(r)goto S_69457;}
do{
*_FUNC_BINARYFORMATCHECK_LONG_RESULT=FUNC_IDEMESSAGEBOX(qbs_new_txt_len("Invalid format",14),qbs_new_txt_len("QBX 7.1 binary format not supported.",36),qbs_new_txt_len("",0));
qbs_cleanup(qbs_tmp_base,0);
if(!qbevent)break;evnt(28182,21,"ide_converters.bas");}while(r);
do{
*_FUNC_BINARYFORMATCHECK_INTEGER_BINARYFORMATCHECK= 1 ;
if(!qbevent)break;evnt(28182,22,"ide_converters.bas");}while(r);
sc_ec_487_end:;
goto sc_8091_end;
}
S_69460:;
if (((*_FUNC_BINARYFORMATCHECK_INTEGER_FORMAT==( 252 )))||is_error_pending()){
if(qbevent){evnt(28182,23,"ide_converters.bas");if(r)goto S_69460;}
S_69461:;
if ((qbs_cleanup(qbs_tmp_base,func_instr(NULL,func__os(),qbs_new_txt_len("WIN",3),0)))||is_error_pending()){
if(qbevent){evnt(28182,24,"ide_converters.bas");if(r)goto S_69461;}
do{
qbs_set(_FUNC_BINARYFORMATCHECK_STRING_CONVERTUTILITY,qbs_new_txt_len("internal\\utilities\\QB45BIN.exe",30));
qbs_cleanup(qbs_tmp_base,0);
if(!qbevent)break;evnt(28182,25,"ide_converters.bas");}while(r);
}else{
do{
qbs_set(_FUNC_BINARYFORMATCHECK_STRING_CONVERTUTILITY,qbs_new_txt_len("./internal/utilities/QB45BIN",28));
qbs_cleanup(qbs_tmp_base,0);
if(!qbevent)break;evnt(28182,27,"ide_converters.bas");}while(r);
}
S_69466:;
if ((qbs_cleanup(qbs_tmp_base,func__fileexists(_FUNC_BINARYFORMATCHECK_STRING_CONVERTUTILITY)))||is_error_pending()){
if(qbevent){evnt(28182,29,"ide_converters.bas");if(r)goto S_69466;}
do{
qbs_set(_FUNC_BINARYFORMATCHECK_STRING_WHAT,FUNC_IDEYESNOBOX(qbs_new_txt_len("Binary format",13),qbs_new_txt_len("QuickBASIC 4.5 binary format detected. Convert to plain text?",61)));
qbs_cleanup(qbs_tmp_base,0);
if(!qbevent)break;evnt(28182,30,"ide_converters.bas");}while(r);
S_69468:;
if ((qbs_cleanup(qbs_tmp_base,qbs_equal(_FUNC_BINARYFORMATCHECK_STRING_WHAT,qbs_new_txt_len("Y",1))))||is_error_pending()){
if(qbevent){evnt(28182,31,"ide_converters.bas");if(r)goto S_69468;}
LABEL_CONVERTIT:;
if(qbevent){evnt(28182,32,"ide_converters.bas");r=0;}
S_69469:;
if ((qbs_cleanup(qbs_tmp_base,FUNC_FILEHASEXTENSION(__STRING_FILE)))||is_error_pending()){
if(qbevent){evnt(28182,33,"ide_converters.bas");if(r)goto S_69469;}
S_69470:;
fornext_value8093=__STRING_FILE->len;
fornext_finalvalue8093= 1 ;
fornext_step8093= -1 ;
if (fornext_step8093<0) fornext_step_negative8093=1; else fornext_step_negative8093=0;
if (is_error_pending()) goto fornext_error8093;
goto fornext_entrylabel8093;
while(1){
fornext_value8093=fornext_step8093+(*_FUNC_BINARYFORMATCHECK_LONG_I);
fornext_entrylabel8093:
*_FUNC_BINARYFORMATCHECK_LONG_I=fornext_value8093;
qbs_cleanup(qbs_tmp_base,0);
if (fornext_step_negative8093){
if (fornext_value8093<fornext_finalvalue8093) break;
}else{
if (fornext_value8093>fornext_finalvalue8093) break;
}
fornext_error8093:;
if(qbevent){evnt(28182,34,"ide_converters.bas");if(r)goto S_69470;}
S_69471:;
if ((qbs_cleanup(qbs_tmp_base,-(qbs_asc(__STRING_FILE,*_FUNC_BINARYFORMATCHECK_LONG_I)== 46 )))||is_error_pending()){
if(qbevent){evnt(28182,35,"ide_converters.bas");if(r)goto S_69471;}
do{
qbs_set(_FUNC_BINARYFORMATCHECK_STRING_OFILE,qbs_add(qbs_add(qbs_left(__STRING_FILE,*_FUNC_BINARYFORMATCHECK_LONG_I- 1 ),qbs_new_txt_len(" (converted)",12)),func_mid(__STRING_FILE,*_FUNC_BINARYFORMATCHECK_LONG_I,NULL,0)));
qbs_cleanup(qbs_tmp_base,0);
if(!qbevent)break;evnt(28182,37,"ide_converters.bas");}while(r);
do{
goto fornext_exit_8092;
if(!qbevent)break;evnt(28182,38,"ide_converters.bas");}while(r);
}
fornext_continue_8092:;
}
fornext_exit_8092:;
}else{
do{
qbs_set(_FUNC_BINARYFORMATCHECK_STRING_OFILE,qbs_add(__STRING_FILE,qbs_new_txt_len(" (converted).bas",16)));
qbs_cleanup(qbs_tmp_base,0);
if(!qbevent)break;evnt(28182,42,"ide_converters.bas");}while(r);
}
do{
qbg_screen(NULL,NULL, 3 , 0 ,NULL,12);
if(!qbevent)break;evnt(28182,45,"ide_converters.bas");}while(r);
do{
*_FUNC_BINARYFORMATCHECK_LONG_DUMMY=FUNC_DARKENFGBG(&(pass8095= 1 ));
if(!qbevent)break;evnt(28182,46,"ide_converters.bas");}while(r);
do{
SUB_CLEARSTATUSWINDOW(&(pass8096= 0 ));
if(!qbevent)break;evnt(28182,47,"ide_converters.bas");}while(r);
do{
qbg_sub_color( 15 , 1 ,NULL,NULL,3);
if(!qbevent)break;evnt(28182,48,"ide_converters.bas");}while(r);
do{
sub__printstring( 2 ,*__LONG_IDEWY- 3 ,qbs_new_txt_len("Converting...          ",23),NULL,0);
qbs_cleanup(qbs_tmp_base,0);
if(!qbevent)break;evnt(28182,49,"ide_converters.bas");}while(r);
do{
sub_pcopy( 3 , 0 );
if(!qbevent)break;evnt(28182,50,"ide_converters.bas");}while(r);
do{
qbs_set(_FUNC_BINARYFORMATCHECK_STRING_CONVERTLINE,qbs_add(qbs_add(qbs_add(qbs_add(_FUNC_BINARYFORMATCHECK_STRING_CONVERTUTILITY,qbs_new_txt_len(" ",1)),FUNC_QUOTEDFILENAME(__STRING_FILE)),qbs_new_txt_len(" -o ",4)),FUNC_QUOTEDFILENAME(_FUNC_BINARYFORMATCHECK_STRING_OFILE)));
qbs_cleanup(qbs_tmp_base,0);
if(!qbevent)break;evnt(28182,52,"ide_converters.bas");}while(r);
do{
sub_shell2(_FUNC_BINARYFORMATCHECK_STRING_CONVERTLINE,2);
qbs_cleanup(qbs_tmp_base,0);
if(!qbevent)break;evnt(28182,53,"ide_converters.bas");}while(r);
do{
SUB_CLEARSTATUSWINDOW(&(pass8097= 0 ));
if(!qbevent)break;evnt(28182,55,"ide_converters.bas");}while(r);
do{
*_FUNC_BINARYFORMATCHECK_LONG_DUMMY=FUNC_DARKENFGBG(&(pass8098= 0 ));
if(!qbevent)break;evnt(28182,56,"ide_converters.bas");}while(r);
do{
sub_pcopy( 3 , 0 );
if(!qbevent)break;evnt(28182,57,"ide_converters.bas");}while(r);
S_69490:;
if ((qbs_cleanup(qbs_tmp_base,-(func__fileexists(_FUNC_BINARYFORMATCHECK_STRING_OFILE)== 0 )))||is_error_pending()){
if(qbevent){evnt(28182,59,"ide_converters.bas");if(r)goto S_69490;}
do{
*_FUNC_BINARYFORMATCHECK_LONG_RESULT=FUNC_IDEMESSAGEBOX(qbs_new_txt_len("Binary format",13),qbs_new_txt_len("Conversion failed.",18),qbs_new_txt_len("",0));
qbs_cleanup(qbs_tmp_base,0);
if(!qbevent)break;evnt(28182,60,"ide_converters.bas");}while(r);
do{
*_FUNC_BINARYFORMATCHECK_INTEGER_BINARYFORMATCHECK= 2 ;
if(!qbevent)break;evnt(28182,61,"ide_converters.bas");}while(r);
}else{
do{
qbs_set(_FUNC_BINARYFORMATCHECK_STRING_PATHTOCHECK,FUNC_GETFILEPATH(_FUNC_BINARYFORMATCHECK_STRING_OFILE));
qbs_cleanup(qbs_tmp_base,0);
if(!qbevent)break;evnt(28182,63,"ide_converters.bas");}while(r);
S_69495:;
if ((qbs_cleanup(qbs_tmp_base,_FUNC_BINARYFORMATCHECK_STRING_PATHTOCHECK->len))||is_error_pending()){
if(qbevent){evnt(28182,64,"ide_converters.bas");if(r)goto S_69495;}
do{
qbs_set(_FUNC_BINARYFORMATCHECK_STRING_FILETOCHECK,func_mid(_FUNC_BINARYFORMATCHECK_STRING_OFILE,_FUNC_BINARYFORMATCHECK_STRING_PATHTOCHECK->len+ 1 ,NULL,0));
qbs_cleanup(qbs_tmp_base,0);
if(!qbevent)break;evnt(28182,65,"ide_converters.bas");}while(r);
do{
qbs_set(_FUNC_BINARYFORMATCHECK_STRING_PATHTOCHECK,qbs_left(_FUNC_BINARYFORMATCHECK_STRING_PATHTOCHECK,_FUNC_BINARYFORMATCHECK_STRING_PATHTOCHECK->len- 1 ));
qbs_cleanup(qbs_tmp_base,0);
if(!qbevent)break;evnt(28182,66,"ide_converters.bas");}while(r);
}else{
do{
qbs_set(_FUNC_BINARYFORMATCHECK_STRING_FILETOCHECK,_FUNC_BINARYFORMATCHECK_STRING_OFILE);
qbs_cleanup(qbs_tmp_base,0);
if(!qbevent)break;evnt(28182,68,"ide_converters.bas");}while(r);
}
}
}else{
do{
*_FUNC_BINARYFORMATCHECK_INTEGER_BINARYFORMATCHECK= 1 ;
if(!qbevent)break;evnt(28182,72,"ide_converters.bas");}while(r);
}
}else{
S_69506:;
if ((qbs_cleanup(qbs_tmp_base,-(func__fileexists(qbs_new_txt_len("internal/support/converter/QB45BIN.bas",38))== 0 )))||is_error_pending()){
if(qbevent){evnt(28182,75,"ide_converters.bas");if(r)goto S_69506;}
do{
*_FUNC_BINARYFORMATCHECK_LONG_RESULT=FUNC_IDEMESSAGEBOX(qbs_new_txt_len("Binary format",13),qbs_new_txt_len("Conversion utility not found. Cannot open QuickBASIC 4.5 binary format.",71),qbs_new_txt_len("",0));
qbs_cleanup(qbs_tmp_base,0);
if(!qbevent)break;evnt(28182,76,"ide_converters.bas");}while(r);
do{
*_FUNC_BINARYFORMATCHECK_INTEGER_BINARYFORMATCHECK= 1 ;
if(!qbevent)break;evnt(28182,77,"ide_converters.bas");}while(r);
do{
goto exit_subfunc;
if(!qbevent)break;evnt(28182,78,"ide_converters.bas");}while(r);
}
do{
qbs_set(_FUNC_BINARYFORMATCHECK_STRING_WHAT,FUNC_IDEYESNOBOX(qbs_new_txt_len("Binary format",13),qbs_new_txt_len("QuickBASIC 4.5 binary format detected. Convert to plain text?",61)));
qbs_cleanup(qbs_tmp_base,0);
if(!qbevent)break;evnt(28182,80,"ide_converters.bas");}while(r);
S_69512:;
if ((qbs_cleanup(qbs_tmp_base,qbs_equal(_FUNC_BINARYFORMATCHECK_STRING_WHAT,qbs_new_txt_len("Y",1))))||is_error_pending()){
if(qbevent){evnt(28182,81,"ide_converters.bas");if(r)goto S_69512;}
S_69513:;
if ((qbs_cleanup(qbs_tmp_base,-(func__direxists(qbs_new_txt_len("./internal/utilities",20))== 0 )))||is_error_pending()){
if(qbevent){evnt(28182,83,"ide_converters.bas");if(r)goto S_69513;}
do{
sub_mkdir(qbs_new_txt_len("./internal/utilities",20));
qbs_cleanup(qbs_tmp_base,0);
if(!qbevent)break;evnt(28182,83,"ide_converters.bas");}while(r);
}
do{
sub_pcopy( 3 , 0 );
if(!qbevent)break;evnt(28182,84,"ide_converters.bas");}while(r);
do{
qbg_screen(NULL,NULL, 3 , 0 ,NULL,12);
if(!qbevent)break;evnt(28182,85,"ide_converters.bas");}while(r);
do{
*_FUNC_BINARYFORMATCHECK_LONG_DUMMY=FUNC_DARKENFGBG(&(pass8102= 1 ));
if(!qbevent)break;evnt(28182,86,"ide_converters.bas");}while(r);
do{
SUB_CLEARSTATUSWINDOW(&(pass8103= 0 ));
if(!qbevent)break;evnt(28182,87,"ide_converters.bas");}while(r);
do{
qbg_sub_color( 15 , 1 ,NULL,NULL,3);
if(!qbevent)break;evnt(28182,88,"ide_converters.bas");}while(r);
do{
sub__printstring( 2 ,*__LONG_IDEWY- 3 ,qbs_new_txt_len("Preparing to convert...",23),NULL,0);
qbs_cleanup(qbs_tmp_base,0);
if(!qbevent)break;evnt(28182,89,"ide_converters.bas");}while(r);
do{
sub_pcopy( 3 , 0 );
if(!qbevent)break;evnt(28182,90,"ide_converters.bas");}while(r);
S_69523:;
if ((qbs_cleanup(qbs_tmp_base,func_instr(NULL,func__os(),qbs_new_txt_len("WIN",3),0)))||is_error_pending()){
if(qbevent){evnt(28182,91,"ide_converters.bas");if(r)goto S_69523;}
do{
sub_shell2(qbs_new_txt_len("qb64pe -x internal/support/converter/QB45BIN.bas -o internal/utilities/QB45BIN",78),2);
qbs_cleanup(qbs_tmp_base,0);
if(!qbevent)break;evnt(28182,92,"ide_converters.bas");}while(r);
}else{
do{
sub_shell2(qbs_new_txt_len("./qb64pe -x ./internal/support/converter/QB45BIN.bas -o ./internal/utilities/QB45BIN",84),2);
qbs_cleanup(qbs_tmp_base,0);
if(!qbevent)break;evnt(28182,94,"ide_converters.bas");}while(r);
}
S_69528:;
if ((qbs_cleanup(qbs_tmp_base,func__fileexists(_FUNC_BINARYFORMATCHECK_STRING_CONVERTUTILITY)))||is_error_pending()){
if(qbevent){evnt(28182,96,"ide_converters.bas");if(r)goto S_69528;}
do{
goto LABEL_CONVERTIT;
if(!qbevent)break;evnt(28182,96,"ide_converters.bas");}while(r);
}
do{
SUB_CLEARSTATUSWINDOW(&(pass8104= 0 ));
if(!qbevent)break;evnt(28182,97,"ide_converters.bas");}while(r);
do{
*_FUNC_BINARYFORMATCHECK_LONG_DUMMY=FUNC_DARKENFGBG(&(pass8105= 0 ));
if(!qbevent)break;evnt(28182,98,"ide_converters.bas");}while(r);
do{
sub_pcopy( 3 , 0 );
if(!qbevent)break;evnt(28182,99,"ide_converters.bas");}while(r);
do{
*_FUNC_BINARYFORMATCHECK_LONG_RESULT=FUNC_IDEMESSAGEBOX(qbs_new_txt_len("Binary format",13),qbs_new_txt_len("Error launching conversion utility.",35),qbs_new_txt_len("",0));
qbs_cleanup(qbs_tmp_base,0);
if(!qbevent)break;evnt(28182,100,"ide_converters.bas");}while(r);
}
do{
*_FUNC_BINARYFORMATCHECK_INTEGER_BINARYFORMATCHECK= 1 ;
if(!qbevent)break;evnt(28182,102,"ide_converters.bas");}while(r);
}
sc_ec_488_end:;
goto sc_8091_end;
}
sc_8091_end:;
exit_subfunc:;
free_mem_lock(sf_mem_lock);
#include "free461.txt"
if ((tmp_mem_static_pointer>=mem_static)&&(tmp_mem_static_pointer<=mem_static_limit)) mem_static_pointer=tmp_mem_static_pointer; else mem_static_pointer=mem_static;
cmem_sp=tmp_cmem_sp;
return *_FUNC_BINARYFORMATCHECK_INTEGER_BINARYFORMATCHECK;
}
