亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? ecostestplatform.cpp

?? 基于ecos的redboot
?? CPP
字號:
//####COPYRIGHTBEGIN####
//                                                                          
// ----------------------------------------------------------------------------
// Copyright (C) 1998, 1999, 2000 Red Hat, Inc.
//
// This program is part of the eCos host tools.
//
// This program is free software; you can redistribute it and/or modify it 
// under the terms of the GNU General Public License as published by the Free 
// Software Foundation; either version 2 of the License, or (at your option) 
// any later version.
// 
// This program is distributed in the hope that it will be useful, but WITHOUT 
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for 
// more details.
// 
// You should have received a copy of the GNU General Public License along with
// this program; if not, write to the Free Software Foundation, Inc., 
// 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
//
// ----------------------------------------------------------------------------
//                                                                          
//####COPYRIGHTEND####
//=================================================================
//
//        eCosTestPlatform.cpp
//
//        platform information implementation
//
//=================================================================
#include "eCosTestPlatform.h"
#include "eCosTestUtils.h"
#include "eCosTrace.h"

std::vector<CeCosTestPlatform> CeCosTestPlatform::arPlatforms;

const CeCosTestPlatform *CeCosTestPlatform::Get(LPCTSTR psz) 
{ 
  for(int i=0;i<(signed)arPlatforms.size();i++){
    const CeCosTestPlatform &t=arPlatforms[i];
    if(0==_tcsicmp(t.Name(),psz)){
      return &t;
    }
  }
  return NULL;
}

CeCosTestPlatform::CeCosTestPlatformProperties::CeCosTestPlatformProperties(CeCosTestPlatform *pti)
{
  Add(_T("platform"),pti->m_strName);
  Add(_T("prefix"),  pti->m_strPrefix);
  Add(_T("commands"),pti->m_strCommands);
  Add(_T("inferior"),pti->m_strInferior);
  Add(_T("prompt"),  pti->m_strPrompt);
  Add(_T("ServerSideGdb"),pti->m_nServerSideGdb);
}

bool CeCosTestPlatform::LoadFromDir(LPCTSTR pszDir)
{
  bool rc=true;
  TRACE(_T("CeCosTestPlatform::LoadFromDir %s\n"),pszDir);
  // Find all the files in directory pszDir and load from each of them
  TCHAR szOrigDir[256];
  _tgetcwd(szOrigDir,sizeof szOrigDir-1);
  if(0==_tchdir(pszDir)){
    String strFile;
    void *pHandle;
    for(bool b=CeCosTestUtils::StartSearch(pHandle,strFile);b;b=CeCosTestUtils::NextFile(pHandle,strFile)){
      if(CeCosTestUtils::IsFile(strFile)){
        CeCosTestPlatform t;
        t.m_strName=strFile;
        CeCosTestPlatformProperties prop(&t);
        if(prop.LoadFromFile(strFile)){
          Add(t);
        } else {
          ERROR(_T("Illegal platform specification in %s%c%s\n"),pszDir,cPathsep,(LPCTSTR)strFile);
          rc=false;
        }
      }
    }
    CeCosTestUtils::EndSearch(pHandle);
  } else {
    ERROR(_T("Failed to change to %s from %s\n"),pszDir,szOrigDir);
  }
  _tchdir(szOrigDir);

  return rc;
}

#ifdef _WIN32
bool CeCosTestPlatform::SaveToRegistry(HKEY hTopKey,LPCTSTR pszKey)
{
  // save target info to the registry

  CProperties::CreateKey(pszKey,hTopKey);
  HKEY hKey;
  bool rc=ERROR_SUCCESS==RegOpenKeyEx (hTopKey, pszKey, 0L, KEY_ALL_ACCESS, &hKey);
  if(rc){
    for(int i=0;i<(signed)arPlatforms.size();i++){
      HKEY hKey2;
      DWORD dwDisp;
      const CeCosTestPlatform &ti=arPlatforms[i];
      rc&=(ERROR_SUCCESS==RegCreateKeyEx(hKey,ti.Name(), 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hKey2, &dwDisp));
      if(rc){
        LPCTSTR pszPrefix=ti.Prefix();
        LPCTSTR pszGdb   =ti.GdbCmds();
        LPCTSTR pszInferior=ti.Inferior();
        LPCTSTR pszPrompt=ti.Prompt();
        DWORD dwServerSideGdb=ti.ServerSideGdb()?1l:0l;
        rc&=(ERROR_SUCCESS==RegSetValueEx(hKey2,_T("Prefix"),0,REG_SZ,   (CONST BYTE *)pszPrefix,(1+_tcslen(pszPrefix))*sizeof TCHAR)) &&
            (ERROR_SUCCESS==RegSetValueEx(hKey2,_T("Commands"),0,REG_SZ,   (CONST BYTE *)pszGdb,(1+_tcslen(pszGdb))*sizeof TCHAR)) &&
            (ERROR_SUCCESS==RegSetValueEx(hKey2,_T("Inferior"),0,REG_SZ,   (CONST BYTE *)pszInferior,(1+_tcslen(pszInferior))*sizeof TCHAR)) &&
            (ERROR_SUCCESS==RegSetValueEx(hKey2,_T("Prompt"),0,REG_SZ,   (CONST BYTE *)pszPrompt,(1+_tcslen(pszPrompt))*sizeof TCHAR)) &&
            (ERROR_SUCCESS==RegSetValueEx(hKey2,_T("ServerSideGdb"),0,REG_DWORD,   (CONST BYTE *)&dwServerSideGdb,sizeof DWORD));
      }
      RegCloseKey(hKey2);
    }
    RegCloseKey(hKey);
  }
  return rc;
}

const String CeCosTestPlatform::GetGreatestSubkey (LPCTSTR pszKey)
{
  String strSubkey;
  HKEY hKey;
  
  if (ERROR_SUCCESS == RegOpenKeyEx (HKEY_LOCAL_MACHINE, pszKey, 0L, KEY_READ, &hKey)) {
    DWORD dwIndex = 0;
    TCHAR pszBuffer [MAX_PATH + 1];
    
    while (ERROR_SUCCESS == RegEnumKey (hKey, dwIndex++, (LPTSTR) pszBuffer, sizeof (pszBuffer))) {
      if (strSubkey.compare (pszBuffer) < 0) {
        strSubkey = pszBuffer;
      }
    }
    
    RegCloseKey (hKey);
  }
  
  TRACE (_T("CeCosTestPlatform::GetGreatestSubkey(\"%s\"): %s\n"), pszKey, (LPCTSTR)strSubkey);
  return strSubkey;
}
#endif

bool CeCosTestPlatform::Load()
{
  TRACE(_T("CeCosTestPlatform::Load\n"));
  srand( (unsigned)time( NULL ) );
  
#ifdef _WIN32

  // get target info from the registry
  String strPlatformsKey = _T("Software\\Red Hat\\eCos\\");
  strPlatformsKey += GetGreatestSubkey (_T("Software\\Red Hat\\eCos"));
  strPlatformsKey += _T("\\Platforms");

  HKEY hKey;
  bool rc=ERROR_SUCCESS==RegOpenKeyEx (HKEY_LOCAL_MACHINE, strPlatformsKey, 0L, KEY_READ, &hKey);
  DWORD dwSubKeys=0;
  if(rc){
    // Found the given key.
    // Subkeys' names are the target image names:
    // Subkeys's values are:
    //      Prefix  String
    //      Type    String 
    //      GdbCmd  String [optional]
    FILETIME ftLastWriteTime;
    DWORD dwMaxSubKeyLen;
    if(ERROR_SUCCESS==RegQueryInfoKey(hKey,NULL,NULL,NULL,&dwSubKeys,&dwMaxSubKeyLen,NULL,NULL,NULL,NULL,NULL,NULL)){
      TCHAR *szName=new TCHAR[1+dwMaxSubKeyLen];
      DWORD dwSizeName=dwMaxSubKeyLen;
      for(DWORD dwIndex=0;ERROR_SUCCESS==RegEnumKeyEx(hKey, dwIndex, szName, &dwSizeName, NULL, NULL, NULL, &ftLastWriteTime); dwIndex++){
        CeCosTestPlatform t;
        if(t.LoadFromRegistry(hKey,szName)){
          t.m_strName=szName;
          CeCosTestPlatform::Add(t);
        }
        dwSizeName=dwMaxSubKeyLen;
      }
      delete [] szName;
    }
    RegCloseKey(hKey);
  }
#endif
  const String strDir(CeCosTestUtils::HomeFile(_T(".eCosPlatforms")));
#ifdef _WIN32
  if(!CeCosTestUtils::Exists(strDir)){
    return rc;
  }
#endif
  LoadFromDir(strDir);
  if(0==Count()){
    ERROR(_T("Failed to initialize any targets\n"));
  }
  return true;
}

int CeCosTestPlatform::Add(const CeCosTestPlatform &t)
{
  for(std::vector<CeCosTestPlatform>::iterator it=arPlatforms.begin();it!=arPlatforms.end();){
    if(0==_tcsicmp(it->Name(),t.Name())){
      // Careful - there's already something here with this name:
      ERROR(_T("Warning: duplicate target info %s\n"),it->Name());
      it=arPlatforms.erase(it);
    } else {
      it++;
    }
  }
  arPlatforms.push_back(t);
  return arPlatforms.size()-1;
}

void CeCosTestPlatform::RemoveAllPlatforms()
{
  arPlatforms.clear();
}

bool CeCosTestPlatform::LoadFromCommandString(LPCTSTR psz)
{
  CeCosTestPlatformProperties prop(this);
  return prop.LoadFromCommandString(psz);
}

#ifdef _WIN32
bool CeCosTestPlatform::LoadFromRegistry(HKEY hKey,LPCTSTR pszKey)
{
  CeCosTestPlatformProperties prop(this);
  return prop.LoadFromRegistry(hKey,pszKey);
}
#endif

bool CeCosTestPlatform::Save()
{
  const String strDir(CeCosTestUtils::HomeFile(_T(".eCosPlatforms")));
#ifdef _WIN32
  if(!CeCosTestUtils::Exists(strDir)){
    String strPlatformsKey = _T("Software\\Red Hat\\eCos\\");
    strPlatformsKey += GetGreatestSubkey (_T("Software\\Red Hat\\eCos"));
    strPlatformsKey += _T("\\Platforms");

    return SaveToRegistry(HKEY_LOCAL_MACHINE,strPlatformsKey);
  }
#endif
  return SaveToDir(strDir);
}

bool CeCosTestPlatform::SaveToDir (LPCTSTR pszDir)
{
  bool rc=false;
  void *pHandle;
  TCHAR szOrigDir[256];
  _tgetcwd(szOrigDir,sizeof szOrigDir-1);
  if(0==_tchdir(pszDir)){
    // Delete all the files under directory "pszDir"
    String strFile;
    for(bool b=CeCosTestUtils::StartSearch(pHandle,strFile);b;b=CeCosTestUtils::NextFile(pHandle,strFile)){
      if(CeCosTestUtils::IsFile(strFile)){
        _tunlink(strFile);
      }
    }
    CeCosTestUtils::EndSearch(pHandle);
    rc=true;
    // Rewrite the files
    for(int i=0;i<(signed)arPlatforms.size();i++){
      CeCosTestPlatform &t=arPlatforms[i];
      CeCosTestPlatformProperties prop(&t);
      rc&=prop.SaveToFile(t.Name());
    }
  } else {
    ERROR(_T("Failed to change to %s from %s\n"),pszDir,szOrigDir);
  }
  
  return rc;
}


?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产人伦精品一区二区| 国内偷窥港台综合视频在线播放| 国产伦精品一区二区三区在线观看| 欧美欧美午夜aⅴ在线观看| 一区二区欧美视频| 欧美丝袜丝交足nylons| 午夜电影久久久| 日韩午夜中文字幕| 国产一区视频网站| 国产精品美女一区二区三区| 91丨九色丨尤物| 亚洲综合成人在线视频| 在线电影院国产精品| 奇米影视7777精品一区二区| 久久只精品国产| 色拍拍在线精品视频8848| 天天av天天翘天天综合网| 精品卡一卡二卡三卡四在线| 不卡的电影网站| 亚洲一本大道在线| 欧美成人精品福利| 9久草视频在线视频精品| 亚洲国产日韩一级| 久久久天堂av| 日本国产一区二区| 久久精品国产久精国产爱| 欧美国产日本韩| 欧美日韩高清在线| 成人丝袜高跟foot| 日韩国产欧美在线观看| 久久久久久亚洲综合影院红桃| 91蜜桃在线观看| 六月丁香婷婷色狠狠久久| 亚洲色图.com| 欧美精品一区二区三区蜜桃| 95精品视频在线| 精品一区二区三区久久| 亚洲美女精品一区| 亚洲美女在线国产| 久久色成人在线| 欧美午夜精品久久久久久超碰| 国产在线精品一区二区夜色 | 国产女人水真多18毛片18精品视频| 色视频欧美一区二区三区| 激情五月播播久久久精品| 亚洲精品中文字幕乱码三区 | 欧美美女bb生活片| 国产一区二区三区日韩| 99国产精品99久久久久久| 国产精品国产三级国产a | 欧美三级日韩三级国产三级| 久久精品国产一区二区三 | 欧美日韩精品一区二区在线播放| 国产一区二区91| 亚洲第一会所有码转帖| 国产欧美日韩不卡免费| 精品久久国产字幕高潮| 欧美视频中文字幕| 成人a免费在线看| 国产乱码一区二区三区| 另类成人小视频在线| 亚洲一级在线观看| 一区二区三区在线播| 国产精品丝袜91| 国产日韩欧美综合在线| 日韩免费电影网站| 欧美一区二区三区婷婷月色| 在线观看av一区二区| av不卡一区二区三区| 国产aⅴ精品一区二区三区色成熟| 日韩av在线播放中文字幕| 五月天网站亚洲| 视频在线观看一区| 视频一区在线播放| 污片在线观看一区二区| 亚洲国产成人tv| 亚洲电影第三页| 天天操天天色综合| 日韩有码一区二区三区| 日本最新不卡在线| 日本少妇一区二区| 激情综合网天天干| 黑人巨大精品欧美一区| 国产一区二区三区久久久| 久久福利视频一区二区| 久久69国产一区二区蜜臀| 精品一区二区三区免费| 国产一区二区三区精品欧美日韩一区二区三区| 免费成人你懂的| 精品一区二区三区久久久| 国产一区免费电影| www.日韩在线| 一本大道av伊人久久综合| 在线观看免费一区| 日韩视频一区在线观看| 久久久777精品电影网影网| 国产精品素人视频| 一区二区三区欧美日韩| 狠狠色丁香久久婷婷综合丁香| 国产一区二区免费看| 成人自拍视频在线| 在线精品视频免费播放| 911精品国产一区二区在线| 4438x成人网最大色成网站| 欧美精品一区二区三区四区| 国产精品美女久久久久av爽李琼| 亚洲乱码日产精品bd| 日韩经典一区二区| 国产成人av资源| 欧美中文字幕一二三区视频| 欧美r级电影在线观看| 国产精品福利av| 日韩精品一二三区| 成人亚洲一区二区一| 日本精品一区二区三区高清| 91麻豆精品国产91久久久| 欧美国产一区二区在线观看| 一二三四社区欧美黄| 九色综合狠狠综合久久| 91黄色免费观看| 欧美r级在线观看| 一区二区三区不卡视频在线观看 | 蜜臀精品久久久久久蜜臀 | 91女厕偷拍女厕偷拍高清| 777色狠狠一区二区三区| 国产亚洲污的网站| 亚洲aaa精品| 成人午夜看片网址| 欧美一区二区三区视频在线| 亚洲色图.com| 国产真实乱偷精品视频免| 在线观看中文字幕不卡| 久久中文字幕电影| 天天综合天天做天天综合| av不卡一区二区三区| 久久综合资源网| 日精品一区二区三区| 97久久超碰国产精品电影| 久久亚洲二区三区| 午夜欧美电影在线观看| 99久久久国产精品免费蜜臀| 久久久久国产精品人| 婷婷丁香激情综合| 91老师片黄在线观看| 久久久91精品国产一区二区三区| 日本不卡一二三| 欧美午夜电影在线播放| 亚洲少妇最新在线视频| 国产福利一区二区三区视频在线| 在线不卡a资源高清| 一区二区三区成人| 99久久精品国产毛片| 国产精品视频一二三| 国产另类ts人妖一区二区| 日韩一级片在线观看| 性做久久久久久免费观看欧美| 91麻豆国产精品久久| 中文字幕一区二区在线播放| 成人性生交大合| 国产午夜精品一区二区| 国产盗摄一区二区三区| 久久精品一级爱片| 国产麻豆91精品| 国产日产精品一区| 国产精品综合网| 国产日韩av一区| 国产91精品露脸国语对白| 国产免费成人在线视频| 国产91高潮流白浆在线麻豆 | 日本不卡视频在线| 91精品国产综合久久精品| 亚洲国产精品久久久久秋霞影院| 欧美人牲a欧美精品| 午夜欧美电影在线观看| 91精品免费观看| 免费观看成人av| 欧美成人一区二区三区在线观看| 久久精品国产99久久6| 精品国产免费一区二区三区香蕉| 精品一区二区影视| 国产亚洲精品福利| 成人h动漫精品| 亚洲一二三区不卡| 日韩欧美卡一卡二| 国产成人一区在线| 1024亚洲合集| 欧美日韩亚洲综合在线 | 亚洲天堂a在线| 欧美视频在线一区| 男男gaygay亚洲| 久久久久久99久久久精品网站| 成人网在线免费视频| 亚洲精品久久久蜜桃| 欧美二区三区的天堂| 国产高清在线精品| 一区二区三区免费看视频| 日韩一区二区三区高清免费看看| 国产丶欧美丶日本不卡视频| 一区二区三区精品在线| 日韩三级在线观看|