extern void BECloseFiles() { int i; if( Actions != FStdOut() ) { FShut( Actions ); } if( SymDebug != 0 ) { FShut( SymDebug ); } if( TypDebug != 0 ) { FShut( TypDebug ); } for( i = 0; i < MAX_SEG; ++i ) { if( Files[i].hdl != 0 ) { FShut( Files[i].hdl ); } } }
extern void BECloseFiles() { int i; if( Actions != FStdOut() ) { FShut( Actions ); } if( SymDebug != 0 ) { FShut( SymDebug ); } if( TypDebug != 0 ) { FShut( TypDebug ); } i = 0; while( i < MAX_SEG ) { if( Files[ i ].hdl != 0 ) { FShut( Files[ i ].hdl ); } ++i; } }
extern cg_init_info BEInit( cg_switches cg_data, cg_target_switches tg_data, uint opt_size, proc_revision proc ) { //=================================================================== cg_init_info info; int i; Model = cg_data; if( EnvVar( "ACTION_STDOUT" ) ) { Actions = FStdOut(); } else { Actions = FCreate( "ACTIONS" ); } ++FilesOpen; Action( "BEInit switches==" ); Action( "%h %h", cg_data, tg_data ); Action( ", opt_size==%d, proc_rev=%h%n", opt_size, proc ); SymDebug = 0; TypDebug = 0; if( cg_data & DBG_LOCALS ) { SymDebug = FCreate( "DBGSYM" ); ++FilesOpen; } if( cg_data & DBG_TYPES ) { TypDebug = FCreate( "DBGTYP" ); ++FilesOpen; } TypeIdx = 0; InitDbgInfo(); TypeInit(); TypeDef( TY_DEFAULT, 0 ); Inlines = NULL; NodeList = NULL; AutoList = NULL; LblList = NULL; BackList = NULL; TempList = NULL; StaticList = NULL; LabelId = 0; NodeId = 0; BackId = 0; TempId = 0; SelId = 0; SegDefs = NULL; CGState = S_INIT; InProc = NULL; FilesOpen = 0; for( i = 0; i < MAX_SEG; ++i ) { Locs[i] = 0; Files[i].hdl = 0; Files[i].name = NULL; Files[i].exists = false; SegOk[i] = false; } CurSeg = 0; Out = Files[CurSeg].hdl; CodeSeg = -1; TargTypeInit(); Action( "BEInit%n" ); info.version.is_large = true; info.version.revision = II_REVISION; #if _TARGET & _TARG_IAPX86 info.version.target = II_TARG_8086; #elif _TARGET & _TARG_80386 info.version.target = II_TARG_80386; #elif _TARGET & _TARG_AXP info.version.target = II_TARG_AXP; #elif _TARGET & _TARG_PPC info.version.target = II_TARG_PPC; #else #error UNKNOWN TARGET #endif return( info ); }