• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ FindEntry函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中FindEntry函数的典型用法代码示例。如果您正苦于以下问题:C++ FindEntry函数的具体用法?C++ FindEntry怎么用?C++ FindEntry使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了FindEntry函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: CPUGetPiece

static mad_status       CPUGetPiece( unsigned piece,
                                const char **descript_p,
                                size_t *max_descript_p,
                                const mad_reg_info **reg,
                                mad_type_handle *disp_type,
                                size_t *max_value )
{
    unsigned    idx;

    if( !FindEntry( CPUNumeric, piece, &idx, disp_type ) )
        return( MS_FAIL );
    *reg = &RegList[idx].info;
    if( !(MADState->reg_state[CPU_REG_SET] & CT_EXTENDED) ) {
        if( *disp_type == PPCT_H_DWORD ) {
            *disp_type = PPCT_H_WORD;
            *reg = &RegListHalf[idx - IDX_r0].info;
        }
    }
    //NYI: if extended & ~ 64 bit mode, downshift to 32-bit display.
    //     Also, if 64 <=> 32 bit switch, tell client to redraw window
    if( !(MADState->reg_state[CPU_REG_SET] & CT_HEX) ) {
        switch( *disp_type ) {
        case PPCT_H_DWORD:
            *disp_type = PPCT_H_UINT64;
            break;
        case PPCT_H_WORD:
            *disp_type = PPCT_H_ULONG;
            break;
        }
    }
    *descript_p = (*reg)->name;
    *max_descript_p = 0;
    *max_value = 0;
    return( MS_OK );
}
开发者ID:Azarien,项目名称:open-watcom-v2,代码行数:35,代码来源:ppcreg.c


示例2: strlen

RAMDISK_DIR_ENTRY * RAMDISK_PARTITION::FindPath(const char* path, const char **basename)
{
	int pathLen = strlen(path);
	char dirfilename[pathLen+1]; 					// to hold a full path 
	const char *cptr = path+pathLen;				// find the end...
	const char *filename = NULL;					// to hold filename
	while(cptr-->path)								//search till start
	{
		if((*cptr=='/') || (*cptr==':'))				// split at either / or : (whichever comes first form the end!)
		{
			cptr++;
			strlcpy(dirfilename, path, 1+cptr-path);	//copy string up till and including / or :
			filename = cptr;									//filename = now remainder of string
			break;
		}
	} 
	
	if(!filename)
	{
		filename		= path;				//filename = complete path
		dirfilename[0]	= 0;				//make directory path ""
	}
	RAMDISK_BASE_ENTRY *entry = FindEntry(dirfilename);
	if(entry)
	{
		if(basename) *basename = filename;
		return entry->IsDir();
	}
	return NULL;
}
开发者ID:gnils,项目名称:usbloader-gx,代码行数:30,代码来源:ramdisk.cpp


示例3: AttachL

void DSession::AttachL(DThread& aClient)
{
  if(FindEntry(aClient)) return;
  if(!iServer) User::Leave(KErrServerTerminated);
  DSessionShare** shares=iShares;
  TInt top=iClients;
  if(top==iAlloc)
  {
    if(top>(EMaxShares-EShareGranularity)) User::Leave(KErrNotSupported);
    TInt newClients=top+EShareGranularity;
    shares=(DSessionShare**)User::ReAllocL(shares,newClients*sizeof(DSessionShare*));
    iShares=shares;
    iAlloc=newClients;
  }
  TInt i=0;
  while(i<top)
  {
    TUint index=(i+top)>>1;
    DThread* item=shares[index]->iClient;
    if(&aClient<item)
    {
      top=index;
      continue;
    }
    i=index+1;
  }
  DSessionShare* share=DSessionShare::NewL(*this,aClient,*iServer);
  Mem::Move(shares+i+1,shares+i,(iClients++-i)*sizeof(DSessionShare*));
  shares[i]=share;
}
开发者ID:flaithbheartaigh,项目名称:almalert,代码行数:30,代码来源:ekern_dsession.cpp


示例4: TEST_F

TEST_F(DlExtTest, ExtInfoUseFdWithOffset) {
  const std::string lib_path = std::string(getenv("ANDROID_DATA")) + LIBZIPPATH;

  android_dlextinfo extinfo;
  extinfo.flags = ANDROID_DLEXT_USE_LIBRARY_FD | ANDROID_DLEXT_USE_LIBRARY_FD_OFFSET;
  extinfo.library_fd = TEMP_FAILURE_RETRY(open(lib_path.c_str(), O_RDONLY | O_CLOEXEC));

  // Find the offset of the shared library in the zip.
  ZipArchiveHandle handle;
  ASSERT_EQ(0, OpenArchive(lib_path.c_str(), &handle));
  ZipEntry zip_entry;
  ZipString zip_name;
  zip_name.name = reinterpret_cast<const uint8_t*>(LIBZIP_SIMPLE_ZIP);
  zip_name.name_length = sizeof(LIBZIP_SIMPLE_ZIP) - 1;
  ASSERT_EQ(0, FindEntry(handle, zip_name, &zip_entry));
  extinfo.library_fd_offset = zip_entry.offset;
  CloseArchive(handle);

  handle_ = android_dlopen_ext(lib_path.c_str(), RTLD_NOW, &extinfo);
  ASSERT_DL_NOTNULL(handle_);

  uint32_t* taxicab_number = reinterpret_cast<uint32_t*>(dlsym(handle_, "dlopen_testlib_taxicab_number"));
  ASSERT_DL_NOTNULL(taxicab_number);
  EXPECT_EQ(1729U, *taxicab_number);
}
开发者ID:tornado76,项目名称:platform_bionic,代码行数:25,代码来源:dlext_test.cpp


示例5: SetFocus

void wxsToolSpace::OnMouseClick(wxMouseEvent& event)
{
    SetFocus();

    if ( m_Unstable ) return;

    // Finding out which tool has been clicked
    int PosX = event.GetX();
    int PosY = event.GetY();

    Entry* Tool = FindEntry(PosX,PosY);

    if ( Tool )
    {
        if ( !Tool->m_Tool->GetIsSelected() )
        {
            m_Data->SelectItem(Tool->m_Tool,!event.ControlDown());
        }
        else
        {
            m_Data->SelectItem(Tool->m_Tool,false);
        }

        Tool->m_Tool->MouseClick(0,PosX,PosY);
    }
}
开发者ID:DowerChest,项目名称:codeblocks,代码行数:26,代码来源:wxstoolspace.cpp


示例6: FindEntry

otError Filter::Apply(const ExtAddress &aExtAddress, int8_t &aRss)
{
    otError error = OT_ERROR_NONE;

    otMacFilterEntry *entry = FindEntry(aExtAddress);

    // assign the default RssIn setting for all receiving messages first.
    aRss = mRssIn;

    // check AddressFilter.
    if (mAddressMode == OT_MAC_FILTER_ADDRESS_MODE_WHITELIST)
    {
        VerifyOrExit(entry != NULL && entry->mFiltered, error = OT_ERROR_ADDRESS_FILTERED);
    }
    else if (mAddressMode == OT_MAC_FILTER_ADDRESS_MODE_BLACKLIST)
    {
        VerifyOrExit(entry == NULL || !entry->mFiltered, error = OT_ERROR_ADDRESS_FILTERED);
    }

    // not override the default RssIn setting if no specific RssIn on the Extended Address.
    if (entry != NULL && entry->mRssIn != OT_MAC_FILTER_FIXED_RSS_DISABLED)
    {
        aRss = entry->mRssIn;
    }

exit:
    return error;
}
开发者ID:xiaom-GitHub,项目名称:openthread,代码行数:28,代码来源:mac_filter.cpp


示例7: ExitNow

otError Filter::AddRssIn(const ExtAddress *aExtAddress, int8_t aRss)
{
    otError error = OT_ERROR_NONE;

    // set the default RssIn for all received messages.
    if (aExtAddress == NULL)
    {
        mRssIn = aRss;
        ExitNow();
    }
    else
    {
        Entry *entry = FindEntry(*aExtAddress);

        if (entry == NULL)
        {
            VerifyOrExit((entry = FindAvailEntry()) != NULL, error = OT_ERROR_NO_BUFS);
            entry->mExtAddress = static_cast<const otExtAddress &>(*aExtAddress);
        }

        entry->mRssIn = aRss;
    }

exit:
    return error;
}
开发者ID:xiaom-GitHub,项目名称:openthread,代码行数:26,代码来源:mac_filter.cpp


示例8: unzip_file

static void* unzip_file(ZipArchiveHandle zip, const char* entry_name, unsigned* sz)
{
    ZipEntryName zip_entry_name(entry_name);
    ZipEntry zip_entry;
    if (FindEntry(zip, zip_entry_name, &zip_entry) != 0) {
        fprintf(stderr, "archive does not contain '%s'\n", entry_name);
        return 0;
    }

    *sz = zip_entry.uncompressed_length;

    uint8_t* data = reinterpret_cast<uint8_t*>(malloc(zip_entry.uncompressed_length));
    if (data == NULL) {
        fprintf(stderr, "failed to allocate %u bytes for '%s'\n", *sz, entry_name);
        return 0;
    }

    int error = ExtractToMemory(zip, &zip_entry, data, zip_entry.uncompressed_length);
    if (error != 0) {
        fprintf(stderr, "failed to extract '%s': %s\n", entry_name, ErrorCodeString(error));
        free(data);
        return 0;
    }

    return data;
}
开发者ID:Bliss-Elite,项目名称:platform_system_core,代码行数:26,代码来源:fastboot.cpp


示例9: FPUGetPiece

static mad_status       FPUGetPiece( unsigned piece,
                                const char **descript_p,
                                size_t *max_descript_p,
                                const mad_reg_info **reg,
                                mad_type_handle *disp_type,
                                size_t *max_value )
{
    unsigned    idx;

    if( !FindEntry( FPUList, piece, &idx, disp_type ) ) return( MS_FAIL );
    if( MADState->reg_state[FPU_REG_SET] & FT_HEX ) {
        switch( *disp_type ) {
        case AXPT_DOUBLE:
            *disp_type = AXPT_HDOUBLE;
            break;
        }
    }
    if( MADState->reg_state[FPU_REG_SET] & FT_G_FLOAT ) {
        switch( *disp_type ) {
        case AXPT_DOUBLE:
            *disp_type = AXPT_RG_FLOAT;
            break;
        }
    }
    *reg = &RegList[idx].info;
    *descript_p = (*reg)->name;
    *max_descript_p = 0;
    *max_value = 0;
    return( MS_OK );
}
开发者ID:Azarien,项目名称:open-watcom-v2,代码行数:30,代码来源:axpreg.c


示例10: unzip_to_file

static int unzip_to_file(ZipArchiveHandle zip, char* entry_name) {
    FILE* fp = tmpfile();
    if (fp == NULL) {
        fprintf(stderr, "failed to create temporary file for '%s': %s\n",
                entry_name, strerror(errno));
        return -1;
    }

    ZipEntryName zip_entry_name(entry_name);
    ZipEntry zip_entry;
    if (FindEntry(zip, zip_entry_name, &zip_entry) != 0) {
        fprintf(stderr, "archive does not contain '%s'\n", entry_name);
        return -1;
    }

    int fd = fileno(fp);
    int error = ExtractEntryToFile(zip, &zip_entry, fd);
    if (error != 0) {
        fprintf(stderr, "failed to extract '%s': %s\n", entry_name, ErrorCodeString(error));
        return -1;
    }

    lseek(fd, 0, SEEK_SET);
    return fd;
}
开发者ID:ppma,项目名称:fastboot,代码行数:25,代码来源:fastboot.cpp


示例11: _

bool wxExVCS::GetDir(wxWindow* parent)
{
  if (!Use())
  {
    return false;
  }
  
  const wxString message = _("Select VCS Folder");
  
  std::vector<wxExConfigItem> v;

  // See also vcsentry, same item is used there.
  v.push_back(wxExConfigItem(
    _("Base folder"), 
    CONFIG_COMBOBOXDIR, 
    wxEmptyString, 
    true,
    1005));
      
  if (wxExConfigFirstOf(_("Base folder")).empty()) 
  {
    if (
      parent != NULL && 
      wxExConfigDialog(parent, v, message).ShowModal() == wxID_CANCEL)
    {
      return false;
    }
  }
  else
  {
    m_Entry = FindEntry(wxExConfigFirstOf(_("Base folder")));
  
    if (m_Entry.GetName().empty())
    {
      if (
        parent != NULL &&
        wxExConfigDialog(parent, v, message).ShowModal() == wxID_CANCEL)
      {
        return false;
      }
    }
  }
  
  m_Entry = FindEntry(wxExConfigFirstOf(_("Base folder")));
  
  return !m_Entry.GetName().empty();
}
开发者ID:hfvw,项目名称:wxExtension,代码行数:47,代码来源:vcs.cpp


示例12: aout_info

// Печать заголовков файла, заданного именем
void aout_info(char *Name)
{
   char name83[11];
   Exec exec;

   Make83Name(Name, name83);
   DirEntry Entry;
   if (FindEntry(0, name83, &Entry) == (uint)-1)
   {
      printf("Cannot open file '%s'!\n", Name);
      return;
   }
   LoadPart(&Entry, &exec, 0, sizeof(Exec));


   printf("midmag\t= 0x%x\n",   exec.a_midmag);
   printf("text\t= %d\n",     exec.a_text);
   printf("data\t= %d\n",     exec.a_data);
   printf("bss\t= %d\n",      exec.a_bss);
   printf("syms\t= %d\n",     exec.a_syms);
   printf("entry\t= 0x%x\n",    exec.a_entry);
   printf("trsize\t= %d\n",   exec.a_trsize);
   printf("drsize\t= %d\n",   exec.a_drsize);

   printf("\nflags\t= 0x%x\n", N_FLAG(exec));
   printf("machine\t= ");
   switch (N_MID(exec))
   {
      case M_OLDSUN2:   printf("OldSun2"); break;
      case M_68010:     printf("m68010"); break;
      case M_68020:     printf("m68020"); break;
      case M_SPARC:     printf("sparc"); break;
      case M_386:       printf("386"); break;
      case M_MIPS1:     printf("mips1"); break;
      case M_MIPS2:     printf("mips2"); break;
      default:          printf("unknown?"); return;
   }
   printf("\n");
   if (N_MID(exec) != M_386)
   {
      printf("Only 386's binaries are supported\n");
      return;
   }

   printf("magic\t= ");
   switch (N_MAGIC(exec))
   {
      case OMAGIC:   printf("omagic"); break;
      case NMAGIC:   printf("nmagic"); break;
      case ZMAGIC:   printf("zmagic"); break;
      case QMAGIC:   printf("qmagic"); break;
      case CMAGIC:   printf("cmagic"); break;
      default:       printf("bad magic"); return;
   }


//   Relocation_Info rels[100];
// FIXME: добавить вывод relocation records
}
开发者ID:BackupTheBerlios,项目名称:helloos-svn,代码行数:60,代码来源:aout.c


示例13: MakeDir

int DeviceDir::MakeDir(const char name[], size_t length)
{
	if (FindEntry(name, length))
		return E_ENTRY_EXISTS;

	fEntryList.AddToTail(new DeviceDir(GetFileSystem(), name, length, this));
	return E_NO_ERROR;
}
开发者ID:FFalcon,项目名称:jbushOS,代码行数:8,代码来源:DevFS.cpp


示例14: FindEntry

int IniFile::GetEntryCompatibleValueI(LPCTSTR lpcszKey, LPCTSTR lpcszEntry1, LPCTSTR lpcszEntry2, int nDefault)
{
	size_t nEntry = FindEntry(lpcszKey, lpcszEntry1);
	if (nEntry != InvalidIndex)
		return GetValueI(lpcszKey, lpcszEntry1, nDefault);

	return GetValueI(lpcszKey, lpcszEntry2, nDefault);
}
开发者ID:3rdexp,项目名称:fxfile,代码行数:8,代码来源:IniFile.cpp


示例15:

bool C4GroupSet::LoadEntryString(const char *szEntryName, StdStrBuf * rBuf)
{
	// Load the entry from the first group that has it
	C4Group *pGroup;
	if ((pGroup = FindEntry(szEntryName)))
		return pGroup->LoadEntryString(szEntryName, rBuf);
	// Didn't find it
	return false;
}
开发者ID:Fulgen301,项目名称:openclonk,代码行数:9,代码来源:C4GroupSet.cpp


示例16: AddL

// ----------------------------------------------------------------------------
// CSIPCRRoutingEntry::AddL
// ----------------------------------------------------------------------------
//
void CSIPCRRoutingEntry::AddL( const CSIPCRRoutingEntry* aEntry )
    {        
	if (FindEntry(aEntry->UID())) 
	    {	    
	    User::Leave (KErrAlreadyExists);    
	    }
	    	        	   
    User::LeaveIfError(iServedClients.Append(aEntry));
    }
开发者ID:kuailexs,项目名称:symbiandump-mw1,代码行数:13,代码来源:CSIPCRRoutingEntry.cpp


示例17: DiscardShare

void DSession::DiscardShare(DSessionShare& aShare)
{
  if(iAttributes&EShared)
  {
    DSessionShare** share=FindEntry(*aShare.iClient);
    Mem::Move(share,share+1,(TUint8*)(iShares+--iClients)-(TUint8*)share);
  }
  else iPrimary=NULL;
}
开发者ID:flaithbheartaigh,项目名称:almalert,代码行数:9,代码来源:ekern_dsession.cpp


示例18: update

void DatabaseListModel::update(const QString& s)
{
    if(DatabaseListEntry* e = FindEntry(s))
    {
        QModelIndex m = createIndex(m_databases.indexOf(*e), DBLV_NAME, (void*) 0);
        QModelIndex n = createIndex(m_databases.indexOf(*e), DBLV_UTF8, (void*) 0);
        emit QAbstractItemModel::dataChanged(m, n);
    }
}
开发者ID:Kojirion,项目名称:ChessX,代码行数:9,代码来源:databaselistmodel.cpp


示例19: DJConfigureHostsEntry

//Does the platform-specific equivalent of this in nsswitch.conf:
// hosts: files dns
DWORD
DJConfigureHostsEntry(const char *testPrefix)
{
    DWORD ceError = ERROR_SUCCESS;
    NsswitchConf conf;
    DistroInfo distro;
    int line;
    const char *hostsByFile;
    const char *hostsByDns;
    int moduleIndex;

    if(testPrefix == NULL)
        testPrefix = "";

    memset(&distro, 0, sizeof(distro));
    memset(&conf, 0, sizeof(conf));

    GCE(ceError = DJGetDistroInfo(testPrefix, &distro));

    ceError = ReadNsswitchConf(&conf, testPrefix, TRUE);
    GCE(ceError);

    hostsByFile = GetNameOfHostsByFile(&conf, &distro);
    hostsByDns = GetNameOfHostsByDns(&conf, &distro);

    line = FindEntry(&conf, 0, "hosts");
    if(line == -1)
    {
        DJ_LOG_INFO("Adding hosts line");
        GCE(ceError = AddEntry(&conf, &distro, &line, "hosts"));
        GCE(ceError = InsertModule(&conf, &distro, line, 0, hostsByDns));
        GCE(ceError = InsertModule(&conf, &distro, line, 0, hostsByFile));
    }
    moduleIndex = FindModuleOnLine(&conf, line, hostsByFile);
    if(moduleIndex > 0)
    {
        /* The local module exists on the line, but it is not the first
         * entry. */
        GCE(ceError = RemoveModule(&conf, line, moduleIndex));
    }
    if(moduleIndex != 0)
    {
        GCE(ceError = InsertModule(&conf, &distro, line, 0, hostsByFile));
    }

    if(conf.modified)
        WriteNsswitchConfiguration(testPrefix, &conf);
    else
        DJ_LOG_INFO("nsswitch not modified");

cleanup:
    FreeNsswitchConfContents(&conf);
    DJFreeDistroInfo(&distro);

    return ceError;
}
开发者ID:FarazShaikh,项目名称:likewise-open,代码行数:58,代码来源:djnsswitch.c


示例20: FindEntry

LIB_COMPONENT* CMP_LIBRARY::FindComponent( const wxChar* aName )
{
    LIB_COMPONENT* component = NULL;
    LIB_ALIAS* entry = FindEntry( aName );

    if( entry != NULL )
        component = entry->GetComponent();

    return component;
}
开发者ID:peabody124,项目名称:kicad,代码行数:10,代码来源:class_library.cpp



注:本文中的FindEntry函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ FindField函数代码示例发布时间:2022-05-30
下一篇:
C++ FindDevice函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap