logical cMainFunctionEdit :: Link ( )
{
  CTX_Project        *proj_ctx        = GetProjectContext();
  PropertyHandle     *prophdl         = GetPropertyHandle();    
  NBuffer             comp_out;
  int32               curidx          = UNDEF;
  int32               rc              = ERIC;
  logical             reserve_project = YES;
  logical             term            = NO;
BEGINSEQ
//  if ( (curidx = StartClassAction(YES,reserve_project)) == ERIC) 
//                                                     ERROR
  SetupOutput("",YES);
  if ( Compile() )                                   ERROR
  SetupOutput("...Link executable ...\n",NO);
  
  if ( prophdl->ExecuteInstanceAction("GetLinkCommand",NULL) )
    SetupOutput("Error: providing link command\n",NO);
  else
  {
    rc = ExecuteCommand(prophdl->GetActionResult(),comp_out,YES,NO);
    SetupOutput(comp_out,NO);
  }


RECOVER
  term = YES;
ENDSEQ
//  StopClassAction(reserve_project,curidx);
  return(term);
}
logical cMainFunctionEdit :: ErrorLookup ( )
{
  CTX_Project        *proj_ctx        = GetProjectContext();
  PropertyHandle     *prophdl         = GetPropertyHandle();    
  NString             command;
  NBuffer             buffer;
  logical             term            = NO;
BEGINSEQ
  if ( !prophdl->GetInstanceContext() )             ERROR
  if ( prophdl->ExecuteInstanceAction("GetProjectPath","ERC_Batch") )
    SetupOutput("Error providing command path\n",NO);
  else
  {
    command = prophdl->GetActionResult();
    command += "ShowErrors.bat";
    command += ' ';
    command += prophdl->GetString("sys_ident");
    ExecuteCommand(command,buffer,YES,NO);
    SetupOutput(buffer,YES);
  }


RECOVER
  term = YES;
ENDSEQ
  return(term);
}
void OutputArea :: MessageOutput (char *string, Error *pError )
{

  SetupOutput(string,NO);
  if ( pError )
    SetupOutput(pError->GetText(),NO);
  SetupOutput("\n",NO);


}
logical cMainFunctionEdit :: Compile ( )
{
  CTX_Project        *proj_ctx        = GetProjectContext();
  PropertyHandle     *prophdl         = GetPropertyHandle();    
  NBuffer             comp_out;
  int32               curidx          = UNDEF;
  int32               rc              = ERIC;
  logical             reserve_project = YES;
  logical             term            = NO;
BEGINSEQ
//  if ( (curidx = StartClassAction(YES,reserve_project)) == ERIC) 
//                                                     ERROR
  SetupOutput("...Creating source code file ...",NO);
  if ( prophdl->ExecuteExpression(GetRESDB(),"SourceCode()").IsValid() )
    SetupOutput("...  done.\n",NO);
  else
  {
    SetupOutput("...  terminated with errors, compile not started\n",NO);
    ERROR
  }
  
  if ( prophdl->ExecuteInstanceAction("GetCompileCommand",NULL) )
    SetupOutput("Error: providing compile command\n",NO);
  else
  {
    rc = ExecuteCommand(prophdl->GetActionResult(),comp_out,YES,NO);
    SetupOutput(comp_out,NO);
    if ( !rc && strstr(comp_out,"ERROR") )
      rc = ERIC;
      
    if ( rc )
    {
      *prophdl->GPH("req_compile") = (char*)(rc ? "CPS_failed" : "CPS_ready");
      term = YES;
    }
    prophdl->ExecuteInstanceAction("SetupModLevel",NULL);
  }


RECOVER
  term = YES;
ENDSEQ
//  StopClassAction(reserve_project,curidx);
  return(term);
}
Exemple #5
0
void
Debug::SetOutputFile(const uni_char* filename)
{
	if (!g_dbg_filename || !uni_str_eq(filename, g_dbg_filename))
	{
		op_free(g_dbg_filename);
		g_dbg_filename = uni_down_strdup(filename);
		if ( g_dbg_filename == 0 )
		{
			g_dbg_use_file = FALSE;
			return;
		}

		g_dbg_use_file = TRUE;
		SetupOutput();
	}
}
Exemple #6
0
void
Debug::PrintToFile(const uni_char* str)
{
	if (g_dbg_out == NULL)
		SetupOutput();

	if (g_dbg_out == NULL)
		return;

	//FIXME: This is not the way to go.

	char* singlebyte_str = uni_down_strdup(str);
	if (singlebyte_str == NULL)
		return;

	g_dbg_out->Write(singlebyte_str, op_strlen(singlebyte_str));
	Sync();

	op_free(singlebyte_str);
}