void DebugMain( void ) { bool save; GrabHandlers(); SysFileInit(); WndMemInit(); InitLiterals(); InitLocalInfo(); ProcCmd(); Spawn( DebugInit ); DUIFingOpen(); DUIFreshAll(); LoadProg(); save = DUIStopRefresh( TRUE ); FreezeInpStack(); _SwitchOn( SW_RUNNING_PROFILE ); Spawn( Profile ); /* run profile command file */ _SwitchOff( SW_RUNNING_PROFILE ); PushInitCmdList(); DUIStopRefresh( save ); DUIFingClose(); DUIShow(); }
void FiniTrap( void ) { disconnect_req in_mx; in_mx.req = REQ_DISCONNECT; TrapSimpAccess( sizeof( in_mx ), &in_mx, 0, NULL ); RestoreHandlers(); KillTrap(); GrabHandlers(); #if !defined( BUILD_RFX ) FiniSuppServices(); #endif #ifdef ENABLE_TRAP_LOGGING CloseTrapTraceFile(); #endif }
void InitTrap( char *trap_file ) { mx_entry in[1]; mx_entry out[2]; connect_req in_mx; connect_ret out_mx; char *error; trap_version ver; char buff[ TXT_LEN ]; #ifdef ENABLE_TRAP_LOGGING if( TrpDebugFile ) OpenTrapTraceFile( TrpDebugFile, TrpDebugFileFlush ); #endif /* Don't use TxtBuff except for error -- it may have a Finger message in it */ #if !defined( BUILD_RFX ) TrapSetFailCallBack( TrapFailed ); #endif InitTrapError = FALSE; RestoreHandlers(); ver.remote = FALSE; #if !defined( BUILD_RFX ) if( stricmp( trap_file, "dumb" ) == 0 ) { error = LoadDumbTrap( &ver ); } else { #endif error = LoadTrap( trap_file, buff, &ver ); #if !defined( BUILD_RFX ) } #endif GrabHandlers(); if( error != NULL ) { strcpy( buff, error ); InitTrapError = TRUE; StartupErr( buff ); } in_mx.req = REQ_CONNECT; in_mx.ver.major = TRAP_MAJOR_VERSION; in_mx.ver.minor = TRAP_MINOR_VERSION; in_mx.ver.remote = FALSE; in[0].ptr = &in_mx; in[0].len = sizeof( in_mx ); out[0].ptr = &out_mx; out[0].len = sizeof( out_mx ); buff[0] = '\0'; out[1].ptr = buff; out[1].len = MAX_ERR_MSG_SIZE; TrapAccess( 1, in, 2, out ); MaxPacketLen = out_mx.max_msg_size; if( buff[0] != '\0' ) { KillTrap(); InitTrapError = TRUE; StartupErr( buff ); } #if !defined( BUILD_RFX ) if( !InitTrapError ) { InitSuppServices(); } #endif if( ver.remote ) { _SwitchOn( SW_REMOTE_LINK ); } else { _SwitchOff( SW_REMOTE_LINK ); } }