Esempio n. 1
0
  void Interpreter::AddRuntimeIncludePaths(const char* argv0) {
    // Add configuration paths to interpreter's include files.
#ifdef CLING_INCLUDE_PATHS
    llvm::StringRef InclPaths(CLING_INCLUDE_PATHS);
    for (std::pair<llvm::StringRef, llvm::StringRef> Split
           = InclPaths.split(':');
         !Split.second.empty(); Split = InclPaths.split(':')) {
      if (llvm::sys::fs::is_directory(Split.first))
        AddIncludePath(Split.first);
      InclPaths = Split.second;
    }
    // Add remaining part
    AddIncludePath(InclPaths);
#endif
    llvm::SmallString<512> P(GetExecutablePath(argv0));
    if (!P.empty()) {
      // Remove /cling from foo/bin/clang
      llvm::StringRef ExeIncl = llvm::sys::path::parent_path(P);
      // Remove /bin   from foo/bin
      ExeIncl = llvm::sys::path::parent_path(ExeIncl);
      P.resize(ExeIncl.size());
      // Get foo/include
      llvm::sys::path::append(P, "include");
      if (llvm::sys::fs::is_directory(P.str()))
        AddIncludePath(P.str());
    }

  }
Esempio n. 2
0
int PP_Init2( const char *filename, unsigned flags, const char *include_path, const char *leadbytes )
{
    FILE        *handle;
    int         hash;

    for( hash = 0; hash < HASH_SIZE; hash++ ) {
        PPHashTable[hash] = NULL;
    }
    NestLevel = 0;
    SkipLevel = 0;
    PPFlags = flags;
    memset( MBCharLen, 0, 256 );
    if( leadbytes != NULL ) {
        PP_SetLeadBytes( leadbytes );
    } else if( flags & PPFLAG_DB_KANJI ) {
        SetRange( 0x81, 0x9f, 1 );
        SetRange( 0xe0, 0xfc, 1 );
    } else if( flags & PPFLAG_DB_CHINESE ) {
        SetRange( 0x81, 0xfc, 1 );
    } else if( flags & PPFLAG_DB_KOREAN ) {
        SetRange( 0x81, 0xfd, 1 );
    } else if( flags & PPFLAG_UTF8 ) {
        SetRange( 0xc0, 0xdf, 1 );
        SetRange( 0xe0, 0xef, 2 );
        SetRange( 0xf0, 0xf7, 3 );
        SetRange( 0xf8, 0xfb, 4 );
        SetRange( 0xfc, 0xfd, 5 );
    }
    IncludePath2 = PP_Malloc( 1 );
    *IncludePath2 = '\0';
    IncludePath2 = AddIncludePath( IncludePath2, include_path );
    if( (PPFlags & PPFLAG_IGNORE_INCLUDE) == 0 ) {
        IncludePath2 = AddIncludePath( IncludePath2, PP_GetEnv( "INCLUDE" ) );
    }
    PP_AddMacro( "__LINE__", 8 );
    PP_AddMacro( "__FILE__", 8 );
    PP_AddMacro( "__DATE__", 8 );
    PP_AddMacro( "__TIME__", 8 );
    PP_AddMacro( "__STDC__", 8 );
    PP_TimeInit();

    handle = PP_Open( filename );
    if( handle == NULL )
        return( -1 );
    PP_GenLine();
    PPSavedChar = '\0';
    PPTokenPtr = PPNextTokenPtr;
    return( 0 );
}
Esempio n. 3
0
void SettingsDialog::InitIncludepathsList()
{
    QSettings settings;
    const QString allPaths = settings.value(SETTINGS_GLOBAL_INCLUDE_PATHS).toString();
    const QStringList paths = allPaths.split(";", QString::SkipEmptyParts);
    foreach(QString path, paths) {
        AddIncludePath(path);
    }
Esempio n. 4
0
SettingsDialog::SettingsDialog(ApplicationList *list,
                               TranslationHandler *translator,
                               QWidget *parent) :
    QDialog(parent),
    mApplications(list),
    mTempApplications(new ApplicationList(this)),
    mTranslator(translator)
{
    mUI.setupUi(this);
    QSettings settings;
    mTempApplications->Copy(list);

    mUI.mJobs->setText(settings.value(SETTINGS_CHECK_THREADS, 1).toString());
    mUI.mForce->setCheckState(BoolToCheckState(settings.value(SETTINGS_CHECK_FORCE, false).toBool()));
    mUI.mShowFullPath->setCheckState(BoolToCheckState(settings.value(SETTINGS_SHOW_FULL_PATH, false).toBool()));
    mUI.mShowNoErrorsMessage->setCheckState(BoolToCheckState(settings.value(SETTINGS_SHOW_NO_ERRORS, false).toBool()));
    mUI.mShowDebugWarnings->setCheckState(BoolToCheckState(settings.value(SETTINGS_SHOW_DEBUG_WARNINGS, false).toBool()));
    mUI.mSaveAllErrors->setCheckState(BoolToCheckState(settings.value(SETTINGS_SAVE_ALL_ERRORS, false).toBool()));
    mUI.mSaveFullPath->setCheckState(BoolToCheckState(settings.value(SETTINGS_SAVE_FULL_PATH, false).toBool()));
    mUI.mInlineSuppressions->setCheckState(BoolToCheckState(settings.value(SETTINGS_INLINE_SUPPRESSIONS, false).toBool()));
    mUI.mEnableInconclusive->setCheckState(BoolToCheckState(settings.value(SETTINGS_INCONCLUSIVE_ERRORS, false).toBool()));
    mUI.mShowErrorId->setCheckState(BoolToCheckState(settings.value(SETTINGS_SHOW_ERROR_ID, false).toBool()));

    connect(mUI.mButtons, SIGNAL(accepted()), this, SLOT(Ok()));
    connect(mUI.mButtons, SIGNAL(rejected()), this, SLOT(reject()));
    connect(mUI.mBtnAddApplication, SIGNAL(clicked()),
            this, SLOT(AddApplication()));
    connect(mUI.mBtnRemoveApplication, SIGNAL(clicked()),
            this, SLOT(RemoveApplication()));
    connect(mUI.mBtnEditApplication, SIGNAL(clicked()),
            this, SLOT(EditApplication()));
    connect(mUI.mBtnDefaultApplication, SIGNAL(clicked()),
            this, SLOT(DefaultApplication()));
    connect(mUI.mListWidget, SIGNAL(itemDoubleClicked(QListWidgetItem *)),
            this, SLOT(EditApplication()));
    connect(mUI.mBtnAddIncludePath, SIGNAL(clicked()),
            this, SLOT(AddIncludePath()));
    connect(mUI.mBtnRemoveIncludePath, SIGNAL(clicked()),
            this, SLOT(RemoveIncludePath()));
    connect(mUI.mBtnEditIncludePath, SIGNAL(clicked()),
            this, SLOT(EditIncludePath()));

    mUI.mListWidget->setSortingEnabled(false);
    PopulateApplicationList();

    const int count = QThread::idealThreadCount();
    if (count != -1)
        mUI.mLblIdealThreads->setText(QString::number(count));
    else
        mUI.mLblIdealThreads->setText(tr("N/A"));

    LoadSettings();
    InitTranslationsList();
    InitIncludepathsList();
}
void CCodeProcessor::SetupIncludePath( const char *sourcetreebase, const char *subdir, const char *gamespecific )
{
	CleanupIncludePath();

	char path[MAX_PATH];
	sprintf( path, "%s\\%s", sourcetreebase, subdir );
	strlwr( path );
	AddIncludePath( path );

	char modsubdir[128];
	if ( !stricmp(subdir, "dlls") )
	{
		sprintf(modsubdir,"%s\\%s_dll", subdir, gamespecific );
	}
	else if ( !stricmp(subdir, "cl_dll") )
	{
		sprintf(modsubdir,"%s\\%s_hud", subdir, gamespecific );
	}
	else
	{
		sprintf(modsubdir,"%s\\%s", subdir, gamespecific );
	}

	sprintf( path, "%s\\%s", sourcetreebase, modsubdir );
	strlwr( path );
	AddIncludePath( path );

	// Game shared
	sprintf( path, "%s\\game_shared", sourcetreebase );
	strlwr( path );
	AddIncludePath( path );

	sprintf( path, "%s\\game_shared\\%s", sourcetreebase, gamespecific );
	strlwr( path );
	AddIncludePath( path );

	sprintf( path, "%s\\public", sourcetreebase );
	strlwr( path );
	AddIncludePath( path );
}
Esempio n. 6
0
void rootlogon()
{
  char* c = getenv("TARTSYS");
  if(c){
    std::string install_dir(c);
  }else{
    std::cout << "set environment variable \"TARTSYS\"" << std::endl;
    std::cout << "quit ROOT" << std::endl;      
    gROOT->ProcessLine(".q");
  } 

  AddIncludePath(install_dir);
  AddLinkedLibs();
  LoadModule(install_dir);

  //Base Style
  //  gROOT->SetStyle("Plain");
  gROOT->SetStyle("Modern");
  //  gROOT->SetStyle("Classic");

  //Force Style
  gStyle->SetHistFillColor(7);
  gStyle->SetHistFillStyle(3002);
  gStyle->SetHistLineColor(kBlue);
  gStyle->SetFuncColor(kRed);
  gStyle->SetFrameLineWidth(2);
  gStyle->SetPadGridX(1);
  gStyle->SetPadGridY(1);
  gStyle->SetCanvasColor(0);
  gStyle->SetTitleFillColor(0);
  gStyle->SetTitleStyle(0);
  gStyle->SetStatColor(0);
  gStyle->SetStatStyle(0);
  gStyle->SetStatX(0.9);  
  gStyle->SetStatY(0.9);  
  gStyle->SetPalette(1);
  gStyle->SetOptLogz(1);
  //  gStyle->SetOptTitle(0);
  gStyle->SetOptFit(1);
  gStyle->SetOptStat(1111111);
  gStyle->SetPadBorderMode(1);
  //  gStyle->SetOptDate(1);

  gStyle->SetLabelFont(132,"XYZ");
  gStyle->SetTitleFont(132,"XYZ");
  gStyle->SetTitleFont(132,"");
  gStyle->SetTextFont(132);
  gStyle->SetStatFont(132);
  
}
Esempio n. 7
0
SettingsDialog::SettingsDialog(QSettings *programSettings,
                               ApplicationList *list,
                               QWidget *parent) :
    QDialog(parent),
    mSettings(programSettings),
    mApplications(list),
    mTempApplications(new ApplicationList(this))
{
    mUI.setupUi(this);
    mTempApplications->Copy(list);

    mUI.mEditIncludePaths->setText(programSettings->value(SETTINGS_GLOBAL_INCLUDE_PATHS).toString());
    mUI.mJobs->setText(programSettings->value(SETTINGS_CHECK_THREADS, 1).toString());
    mUI.mForce->setCheckState(BoolToCheckState(programSettings->value(SETTINGS_CHECK_FORCE, false).toBool()));
    mUI.mShowFullPath->setCheckState(BoolToCheckState(programSettings->value(SETTINGS_SHOW_FULL_PATH, false).toBool()));
    mUI.mShowNoErrorsMessage->setCheckState(BoolToCheckState(programSettings->value(SETTINGS_SHOW_NO_ERRORS, false).toBool()));
    mUI.mShowDebugWarnings->setCheckState(BoolToCheckState(programSettings->value(SETTINGS_SHOW_DEBUG_WARNINGS, false).toBool()));
    mUI.mSaveAllErrors->setCheckState(BoolToCheckState(programSettings->value(SETTINGS_SAVE_ALL_ERRORS, false).toBool()));
    mUI.mSaveFullPath->setCheckState(BoolToCheckState(programSettings->value(SETTINGS_SAVE_FULL_PATH, false).toBool()));
    mUI.mInlineSuppressions->setCheckState(BoolToCheckState(programSettings->value(SETTINGS_INLINE_SUPPRESSIONS, false).toBool()));

    connect(mUI.mButtons, SIGNAL(accepted()), this, SLOT(Ok()));
    connect(mUI.mButtons, SIGNAL(rejected()), this, SLOT(reject()));
    connect(mUI.mButtonAdd, SIGNAL(clicked()),
            this, SLOT(AddApplication()));
    connect(mUI.mButtonDelete, SIGNAL(clicked()),
            this, SLOT(DeleteApplication()));
    connect(mUI.mButtonModify, SIGNAL(clicked()),
            this, SLOT(ModifyApplication()));
    connect(mUI.mButtonDefault, SIGNAL(clicked()),
            this, SLOT(DefaultApplication()));
    connect(mUI.mListWidget, SIGNAL(itemDoubleClicked(QListWidgetItem *)),
            this, SLOT(ModifyApplication()));
    connect(mUI.mBtnAddIncludePath, SIGNAL(clicked()),
            this, SLOT(AddIncludePath()));

    mUI.mListWidget->setSortingEnabled(false);
    PopulateListWidget();

    const int count = QThread::idealThreadCount();
    if (count != -1)
        mUI.mLblIdealThreads->setText(QString::number(count));
    else
        mUI.mLblIdealThreads->setText(tr("N/A"));

    LoadSettings();
}
Esempio n. 8
0
void PP_AddIncludePath( const char *path_list )
{
    IncludePath1 = AddIncludePath( IncludePath1, path_list );
}