这篇教程C++ ELEMENTS函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中ELEMENTS函数的典型用法代码示例。如果您正苦于以下问题:C++ ELEMENTS函数的具体用法?C++ ELEMENTS怎么用?C++ ELEMENTS使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了ELEMENTS函数的27个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: sum_latency/* * sum_latency -- * Sum latency for a set of threads. */static voidsum_latency(WTPERF *wtperf, size_t field_offset, TRACK *total){ WTPERF_THREAD *thread; TRACK *trk; int64_t i; u_int j; memset(total, 0, sizeof(*total)); for (i = 0, thread = wtperf->workers; thread != NULL && i < wtperf->workers_cnt; ++i, ++thread) { trk = (TRACK *)((uint8_t *)thread + field_offset); for (j = 0; j < ELEMENTS(trk->us); ++j) { total->ops += trk->us[j]; total->us[j] += trk->us[j]; } for (j = 0; j < ELEMENTS(trk->ms); ++j) { total->ops += trk->ms[j]; total->ms[j] += trk->ms[j]; } for (j = 0; j < ELEMENTS(trk->sec); ++j) { total->ops += trk->sec[j]; total->sec[j] += trk->sec[j]; } }}
开发者ID:DINKIN,项目名称:mongo,代码行数:32,
示例2: find_charset_map/** * find_charset_map: * @charset: An 8bit charset. * * Find charset -> UCS-2 map. * * Returns: Pointer to the map, #NULL when not found. **/static const EncaUnicodeMap*find_charset_map(int charset){ static int charset_id[ELEMENTS(UNICODE_MAP)]; static int charset_id_initialized = 0; size_t i; if (charset < 0) return NULL; if (!charset_id_initialized) { for (i = 0; i < ELEMENTS(UNICODE_MAP); i++) { charset_id[i] = enca_name_to_charset(UNICODE_MAP[i].name); assert(charset_id[i] != ENCA_CS_UNKNOWN); } charset_id_initialized = 1; } for (i = 0; i < ELEMENTS(UNICODE_MAP); i++) { if (charset_id[i] == charset) return UNICODE_MAP + i; } return NULL;}
开发者ID:ShiftMediaProject,项目名称:enca,代码行数:33,
示例3: pt_sanitycheck/*===========================================================================* * pt_sanitycheck * *===========================================================================*/PUBLIC void pt_sanitycheck(pt_t *pt, char *file, int line){ /* Basic pt sanity check. */ int i; int slot; MYASSERT(pt); MYASSERT(pt->pt_dir); MYASSERT(pt->pt_dir_phys); for(slot = 0; slot < ELEMENTS(vmproc); slot++) { if(pt == &vmproc[slot].vm_pt) break; } if(slot >= ELEMENTS(vmproc)) { vm_panic("pt_sanitycheck: passed pt not in any proc", NO_NUM); } MYASSERT(usedpages_add(pt->pt_dir_phys, I386_PAGE_SIZE) == OK); for(i = proc_pde; i < I386_VM_DIR_ENTRIES; i++) { if(pt->pt_pt[i]) { if(!(pt->pt_dir[i] & I386_VM_PRESENT)) { printf("slot %d: pt->pt_pt[%d] = 0x%lx, but pt_dir entry 0x%lx/n", slot, i, pt->pt_pt[i], pt->pt_dir[i]); } MYASSERT(pt->pt_dir[i] & I386_VM_PRESENT); MYASSERT(usedpages_add(I386_VM_PFA(pt->pt_dir[i]), I386_PAGE_SIZE) == OK); } else { MYASSERT(!(pt->pt_dir[i] & I386_VM_PRESENT)); } }}
开发者ID:michalwojciech,项目名称:cs170s10proj2,代码行数:38,
示例4: ASSERTvoid CServerSession::RunSession( SOCKET sock ){ char buf[MAXCMDBUF]; CNcpMessage* pMsg = (CNcpMessage*)buf; //initialize the state and socket. ASSERT( m_sock==0 ); m_sock = sock; m_state = NCPS_CLOSED; while( true ) { pMsg->Recv( m_sock, ELEMENTS(buf) ); if( m_state==NCPS_CLOSED ) { if( pMsg->GetCmd()!=CM_LOGON ) { pMsg->Init( CM_ACK ); pMsg->SetRet( E_UNKNOWN ); pMsg->Send( m_sock ); continue; } } PumpMessage( pMsg, ELEMENTS(buf) ); if( m_state==NCPS_CLOSED )break; }}
开发者ID:EISALab,项目名称:MIIGAgroundwater,代码行数:27,
示例5: smtp_tree_words_condsuint8_tsmtp_tree_words_conds (struct pkt_desc * const pkt){ /* conditions data */ /* last element HAS to be empty == "/0", it is termination */ static const char *const mc_words_smtp[] = { "SMTP", "smtp", "" }; /* no need for ESMTP */ static const char *const mc_words_mail[] = { "mail", "MAIL", "Mail", "" }; static const char *const mc_words_server[] = { "Postfix", "Sendmail", "postffix", "sendmail", "" }; static const char *const mc_words_os[] = { "GNU", "Debian", "debian", "windows", "Windows", "" }; static const char *const *const mc_words[] = { mc_words_smtp, mc_words_mail, mc_words_server, mc_words_os }; uint8_t conds = 0; size_t i; for (i = 0; i < ELEMENTS (mc_words); ++i) { size_t j; for (j = 0; mc_words[i][j][0] != '/0'; ++j) { if (memmem (OFFSETED (pkt), REMAINING (pkt), mc_words[i][j], strlen (mc_words[i][j]))) { BIT_SET (conds, (ELEMENTS (mc_words) - 1) - i); break; } } } return conds;}
开发者ID:jwrona,项目名称:protoident,代码行数:35,
示例6: DoPassiveint CClientSession::DoGetFile( const char* strSrc, const char* strDst ){ char buf[MAXPATH+sizeof(CNcpMessage)]; CNcpMessage* pMsg = (CNcpMessage*)buf; //step 1. request passive mode to get the data channel address short dataport=0; int nRet = DoPassive( &dataport ); if( FAILED(nRet) )return nRet; //step 2. send the put file command. pMsg->Init( CM_GETFILE ); strcpy( pMsg->GetData(), strSrc ); pMsg->SetDataSize( strlen(strSrc)+1 ); pMsg->Send( m_sock ); //wait for the return code and check it if( !pMsg->Recv( m_sock, ELEMENTS(buf) ) ) { return E_BROKEN; //broken connection } ASSERT( pMsg->IsAck() ); if( pMsg->IsFailed() ) { return pMsg->GetRet(); } //step 3. now the server agrees on the file transfer, connect the data channel and send file SOCKADDR_IN addr; socklen_t nlen = sizeof(SOCKADDR_IN); GetPeerName( m_sock, (SOCKADDR*)&addr, &nlen ); addr.sin_port = htons( dataport ); SOCKET sockdata; //import, must retry the socket initilization a few times. int i; for( i=0; i<MAXRETRY; i++ ) { sockdata = Socket( PF_INET, SOCK_STREAM, 0 ); ASSERT( sockdata!=INVALID_SOCKET ); if( ::connect( sockdata, (SOCKADDR*)&addr, sizeof(SOCKADDR_IN) )==0 )break; closesocket( sockdata ); } if( i>=MAXRETRY )throw new CSockException(); int nLen = RecvFileEx( sockdata, strDst, m_nFileMode ); closesocket( sockdata ); //step 4. exchange the error code. pMsg->Init( CM_ACK, nLen ); pMsg->Send( m_sock ); //wait for the return code and check it if( !pMsg->Recv( m_sock, ELEMENTS(buf) ) ) { return E_BROKEN; //broken connection } ASSERT( pMsg->IsAck() ); return pMsg->GetRet();}
开发者ID:EISALab,项目名称:MIIGAgroundwater,代码行数:60,
示例7: secdel/****************************************************************************** * Securely delete the given file. This involves overwriting it with various * bits, truncating it, and then unlinking it. Return non-zero if there is * an error during this process. */int secdel(const char* filename) { static unsigned char buf[256]; static unsigned char bytes[]={0xaa,0x55}; struct stat sb; unsigned char ch; unsigned long fsize; /* (size of file) / 256 */ int f,i,j,rc; if ((f=open(filename,O_RDWR))<0) return errno; if (fstat(f,&sb)) return errno; fsize=sb.st_size/sizeof(buf)+1; for(i=0;i<=ELEMENTS(bytes);++i) { if (i<ELEMENTS(bytes)) memset(buf,bytes[i],sizeof(buf)); else { srand(time(NULL)); /* In case sranddev() fails. */ /*sranddev(); not supported on Linux */ for(j=0;j<ELEMENTS(buf);++j) buf[j]=(unsigned char)(rand()&0xff); } for(j=0;j<fsize;++j) write(f,(void*)buf,sizeof(buf)); } close(f); /* Truncate this file to 0 bytes. */ f=open(filename,O_RDWR|O_TRUNC); close(f); /* Remove this file from the filesystem. */ rc=unlink(filename); return rc;} /* int secdel(const char* filename) */
开发者ID:jeffclough,项目名称:handy,代码行数:38,
示例8: detachedModeMcSatipPluginSetup::cSatipPluginSetup(): detachedModeM(SatipConfig.GetDetachedMode()), deviceCountM(0), operatingModeM(SatipConfig.GetOperatingMode()), ciExtensionM(SatipConfig.GetCIExtension()), eitScanM(SatipConfig.GetEITScan()), numDisabledSourcesM(SatipConfig.GetDisabledSourcesCount()), numDisabledFiltersM(SatipConfig.GetDisabledFiltersCount()){ debug1("%s", __PRETTY_FUNCTION__); operatingModeTextsM[cSatipConfig::eOperatingModeOff] = tr("off"); operatingModeTextsM[cSatipConfig::eOperatingModeLow] = tr("low"); operatingModeTextsM[cSatipConfig::eOperatingModeNormal] = tr("normal"); operatingModeTextsM[cSatipConfig::eOperatingModeHigh] = tr("high"); for (unsigned int i = 0; i < ELEMENTS(cicamsM); ++i) cicamsM[i] = SatipConfig.GetCICAM(i); for (unsigned int i = 0; i < ELEMENTS(ca_systems_table); ++i) cicamTextsM[i] = ca_systems_table[i].description; if (numDisabledSourcesM > MAX_DISABLED_SOURCES_COUNT) numDisabledSourcesM = MAX_DISABLED_SOURCES_COUNT; for (int i = 0; i < MAX_DISABLED_SOURCES_COUNT; ++i) disabledSourcesM[i] = SatipConfig.GetDisabledSources(i); if (numDisabledFiltersM > SECTION_FILTER_TABLE_SIZE) numDisabledFiltersM = SECTION_FILTER_TABLE_SIZE; for (int i = 0; i < SECTION_FILTER_TABLE_SIZE; ++i) { disabledFilterIndexesM[i] = SatipConfig.GetDisabledFilters(i); disabledFilterNamesM[i] = tr(section_filter_table[i].description); } SetMenuCategory(mcSetupPlugins); Setup(); SetHelp(trVDR("Button$Scan"), NULL, tr("Button$Devices"), trVDR("Button$Info"));}
开发者ID:paluseb,项目名称:vdr-plugin-satip,代码行数:32,
示例9: strcpybool CServerSession::OnSoftLink( CNcpMessage* pMsg, int nBufSize ){ char path_src[MAXPATH], path_lnk[MAXPATH]; //parse the parameters string strSrc = pMsg->GetData(); string strLnk = pMsg->GetData()+strSrc.size()+1; if( IsAbsDir( strSrc.c_str() ) ) { strcpy( path_src, strSrc.c_str() ); } else { strcpy( path_src, m_strCurDir.c_str() ); CatDir( path_src, strSrc.c_str(), path_src, ELEMENTS(path_src) ); } if( IsAbsDir( strLnk.c_str() ) ) { strcpy( path_lnk, strLnk.c_str() ); } else { strcpy( path_lnk, m_strCurDir.c_str() ); CatDir( path_lnk, strLnk.c_str(), path_lnk, ELEMENTS(path_lnk) ); } int nRet = 0;#ifdef _WIN32 nRet = E_NOSUPT;#else symlink( path_src, path_lnk ); nRet = S_OK;#endif //send back the return code. pMsg->Init( CM_ACK, nRet ); pMsg->Send( m_sock ); return SUCCEEDED(nRet);}
开发者ID:EISALab,项目名称:MIIGAgroundwater,代码行数:35,
示例10: Currentvoid cSatipPluginSetup::Setup(void){ int current = Current(); Clear(); helpM.Clear(); Add(new cMenuEditStraItem(tr("Operating mode"), &operatingModeM, ELEMENTS(operatingModeTextsM), operatingModeTextsM)); helpM.Append(tr("Define the used operating mode for all SAT>IP devices:/n/noff - devices are disabled/nlow - devices are working at the lowest priority/nnormal - devices are working within normal parameters/nhigh - devices are working at the highest priority")); if (operatingModeM) { Add(new cMenuEditBoolItem(tr("Enable CI extension"), &ciExtensionM)); helpM.Append(tr("Define whether a CI extension shall be used./n/nThis setting enables integrated CI/CAM handling found in some SAT>IP hardware (e.g. Digital Devices OctopusNet).")); for (unsigned int i = 0; ciExtensionM && i < ELEMENTS(cicamsM); ++i) { Add(new cMenuEditStraItem(*cString::sprintf(" %s #%d", tr("CI/CAM"), i + 1), &cicamsM[i], ELEMENTS(cicamTextsM), cicamTextsM)); helpM.Append(tr("Define a desired CAM type for the CI slot./n/nThe '---' option lets SAT>IP hardware do the auto-selection.")); } Add(new cMenuEditBoolItem(tr("Enable EPG scanning"), &eitScanM)); helpM.Append(tr("Define whether the EPG background scanning shall be used./n/nThis setting disables the automatic EIT scanning functionality for all SAT>IP devices.")); Add(new cMenuEditIntItem(tr("Disabled sources"), &numDisabledSourcesM, 0, MAX_DISABLED_SOURCES_COUNT, tr("none"))); helpM.Append(tr("Define number of sources to be disabled./n/nSAT>IP servers might not have all satellite positions available and such sources can be blacklisted here.")); for (int i = 0; i < numDisabledSourcesM; ++i) { Add(new cSatipEditSrcItem(*cString::sprintf(" %s %d", trVDR("Source"), i + 1), &disabledSourcesM[i])); helpM.Append(tr("Define a source to be blacklisted.")); } Add(new cMenuEditIntItem(tr("Disabled filters"), &numDisabledFiltersM, 0, SECTION_FILTER_TABLE_SIZE, tr("none"))); helpM.Append(tr("Define number of section filters to be disabled./n/nCertain section filters might cause some unwanted behaviour to VDR such as time being falsely synchronized. By blacklisting the filters here, useful section data can be left intact for VDR to process.")); for (int i = 0; i < numDisabledFiltersM; ++i) { Add(new cMenuEditStraItem(*cString::sprintf(" %s %d", tr("Filter"), i + 1), &disabledFilterIndexesM[i], SECTION_FILTER_TABLE_SIZE, disabledFilterNamesM)); helpM.Append(tr("Define an ill-behaving filter to be blacklisted.")); } } Add(new cMenuEditStraItem(tr("Transport mode"), &transportModeM, ELEMENTS(transportModeTextsM), transportModeTextsM)); helpM.Append(tr("Define which transport mode shall be used./n/nUnicast, Multicast, RTP-over-TCP")); Add(new cOsdItem(tr("Active SAT>IP servers:"), osUnknown, false)); helpM.Append(""); detachedModeM = SatipConfig.GetDetachedMode(); if (!detachedModeM) { cSatipServers *servers = cSatipDiscover::GetInstance()->GetServers(); deviceCountM = servers->Count(); for (cSatipServer *s = servers->First(); s; s = servers->Next(s)) { Add(new cSatipServerItem(s)); helpM.Append(""); } } SetCurrent(Get(current)); Display();}
开发者ID:rofafor,项目名称:vdr-plugin-satip,代码行数:56,
示例11: TermState_Failstatic void TermState_Fail(TermState *state){ assert(state->alt_stack_pos>0); --state->alt_stack_pos; assert(state->alt_stack_pos<(int)ELEMENTS(state->alt_stack)); state->proc = state->alt_stack[state->alt_stack_pos]; assert(state->alt_stack_pos<(int)ELEMENTS(state->bufpos_stack)); state->bufpos = state->bufpos_stack[state->alt_stack_pos]; assert(state->alt_stack_pos<(int)ELEMENTS(state->cont_stack_pos_stack)); state->cont_stack_pos = state->cont_stack_pos_stack[state->alt_stack_pos];}
开发者ID:wosigh,项目名称:terminal,代码行数:11,
示例12: TermState_PushAlternativestatic void TermState_PushAlternative(TermState *state,TermStateProc *proc){ assert(state->alt_stack_pos<(int)ELEMENTS(state->bufpos_stack)); state->bufpos_stack[state->alt_stack_pos] = TermState_PrevBufPos(state,state->bufpos); assert(state->alt_stack_pos<(int)ELEMENTS(state->alt_stack)); state->alt_stack[state->alt_stack_pos] = proc; assert(state->alt_stack_pos<(int)ELEMENTS(state->cont_stack_pos_stack)); state->cont_stack_pos_stack[state->alt_stack_pos] = state->cont_stack_pos; ++state->alt_stack_pos;}
开发者ID:wosigh,项目名称:terminal,代码行数:11,
示例13: new_ronnyGShell * new_ronny(GShell *ronny,int Setup){ if (!ronny) ronny = new GShell; ronny->Make(ELEMENTS(ronny_points),(Point*) ronny_points, ELEMENTS(ronny_faces),ronny_faces); if (Setup) { ronny->ComputeFaceNormals(); ronny->ComputeVertexNormals(); ronny->ComputeBounds(); } return (ronny);}
开发者ID:deepmatrix,项目名称:blaxxun-cc3d,代码行数:12,
示例14: MCS_list_registryvoid MCS_list_registry(MCExecPoint& p_context){ char *t_full_key; t_full_key = p_context . getsvalue() . clone(); p_context . clear(); char *t_root_key; t_root_key = t_full_key; char *t_child_key; t_child_key = strchr(t_full_key, '//'); if (t_child_key != NULL) *t_child_key++ = '/0'; else t_child_key = NULL; uint2 i; MCString s = t_root_key; for (i = 0 ; i < ELEMENTS(Regkeys) ; i++) if (s == Regkeys[i].token) break; HKEY t_key; if (i >= ELEMENTS(Regkeys) || RegOpenKeyExA(Regkeys[i] . key, t_child_key, 0, KEY_READ, &t_key) != ERROR_SUCCESS) { MCresult -> sets("bad key"); delete t_full_key; return; } DWORD t_index; t_index = 0; for(;;) { LONG t_result; char t_name[256]; DWORD t_name_length; t_name_length = 256; t_result = RegEnumKeyExA(t_key, t_index, t_name, &t_name_length, NULL, NULL, NULL, NULL); if (t_result == ERROR_NO_MORE_ITEMS) break; p_context . concatchars(t_name, t_name_length, EC_RETURN, t_index == 0); t_index += 1; } RegCloseKey(t_key); delete t_full_key;}
开发者ID:Bjoernke,项目名称:livecode,代码行数:49,
示例15: GetModuleFileNamebool CServerSession::OnLogOn( CNcpMessage* pMsg, int nBufSize ){ char path[MAXPATH]; //parse parameters int nFileMode = pMsg->GetRet(); string strUser = (char*)pMsg->GetData(); string strPass = (char*)( pMsg->GetData()+strUser.size()+1 ); //get home path#ifdef _WIN32 GetModuleFileName( NULL, path, ELEMENTS(path) ); char* p = strrchr( path, '//' ); if( p!=NULL )*p = '/0';#else getcwd( path, ELEMENTS(path) );#endif CatDir( path, strUser.c_str(), path, ELEMENTS(path) ); //now path is the current home path. //make home directory if necessary int nRet = S_OK; if( !IsDirExist(path) ) { if( MkDir( path )!=0 ) { nRet = E_ACCES; } } m_strHomeDir = path; m_strCurDir = m_strHomeDir; m_nFileMode = nFileMode; if( SUCCEEDED(nRet) && !IsDirExist(m_strHomeDir.c_str()) ) { nRet = E_NOUSER; } pMsg->Init( CM_ACK, nRet ); pMsg->Send( m_sock ); //switch established if( SUCCEEDED(nRet) ) { m_state = NCPS_ESTABLISHED; if( strcmp( strUser.c_str(), "root" )==0 )m_bRootUsr = true; ASSERT( m_pServApp ); //lock the same user logon from other hosts. m_pLocker = m_pServApp->GetSessionLocker( strUser.c_str() ); m_pLocker->Lock(); } return SUCCEEDED(nRet);}
开发者ID:EISALab,项目名称:MIIGAgroundwater,代码行数:48,
示例16: gethostnamebool CHostSet::Add( IN_ADDR addrHost, bool bIsAlive ){ char buf[MAXLINE]; //get local host address gethostname( buf, ELEMENTS(buf) ); hostent* phent = gethostbyname( buf ); IN_ADDR addrloc; bcopy( phent->h_addr, &addrloc, sizeof(IN_ADDR) ); //force not using local host. avoid treat local host as a computation node if( !IsUseLocalHost() ){ if( addrloc.S_un.S_addr==addrHost.S_un.S_addr )return false; }// CHostObject* pHostObj = new CHostObject( addrHost, this );// if( m_trHosts.Search( pHostObj )==NULL ){ if( m_trHosts.SearchByKey( addrHost )==NULL ){ CHostObject* pHostObj = new CHostObject( addrHost, this ); m_trHosts.Insert( pHostObj ); if( bIsAlive ){ m_trAliveHosts.Insert( pHostObj ); ReleaseSemaphore( m_smAlives ); }else{ m_trDeadHosts.Insert( pHostObj ); } return true; }// delete pHostObj; return false;}
开发者ID:EISALab,项目名称:MIIGAgroundwater,代码行数:32,
示例17: TermState_Continuestatic void TermState_Continue(TermState *state){ assert(state->cont_stack_pos>0); --state->cont_stack_pos; assert(state->cont_stack_pos<(int)ELEMENTS(state->cont_stack)); state->proc = state->cont_stack[state->cont_stack_pos];}
开发者ID:wosigh,项目名称:terminal,代码行数:7,
示例18: TRACE/// <summary>Return the list of supported geometry types. For example, if a client wanted to know if a provider supported/// multi-polygons, it would call GetGeometryTypes and check if the MultiPolygon type was listed.</summary>/// <param name="length">Output the number of geometry types.</param> /// <returns>Returns the list of geometry types</returns> FdoGeometryType* SuperMapGeometryCapabilities::GetGeometryTypes (FdoInt32& length){ TRACE(_T("调用 SuperMapGeometryCapabilities::GetGeometryTypes()... /n")); static const FdoGeometryType geomTypes[] = { FdoGeometryType_Point, FdoGeometryType_LineString, FdoGeometryType_Polygon, FdoGeometryType_MultiPoint, FdoGeometryType_MultiLineString, // 支持多点、多线 FdoGeometryType_MultiPolygon, FdoGeometryType_MultiGeometry /*shp FdoGeometryType_Point, FdoGeometryType_LineString, FdoGeometryType_Polygon, FdoGeometryType_MultiPoint, FdoGeometryType_MultiLineString, */ }; length = ELEMENTS(geomTypes); return ((FdoGeometryType *)geomTypes);}
开发者ID:SuperMap,项目名称:Fdo_SuperMap,代码行数:31,
示例19: checkCASystembool checkCASystem(unsigned int cicamP, int caidP){ // always skip the first row if ((cicamP > 0) && (cicamP < ELEMENTS(ca_systems_table))) return ((caidP >= ca_systems_table[cicamP].start) && (caidP <= ca_systems_table[cicamP].end)); return false;}
开发者ID:nafets227,项目名称:vdr-plugin-satip,代码行数:7,
示例20: funcload////////////////////////////////////////////////////////////////////////////////// funcload()//// This function is called to define all function names in the ADS// function table. Each named function will be callable from lisp or// invokable from another ADS application.//static intfuncload(){ unsigned short i; AvErrorCode retval; static int sbInitialized = FALSE; // AVLIB: we must call av_loadlib() to assure that Render.arx // is loaded. // if (!sbInitialized) { retval = av_loadlib(); if (retval != AvRetNorm) { acdbFail("Library initialization failed./n"); return RTERROR; } sbInitialized = TRUE; } // call acedDefun() for each function name // in gFunctionTable for (i = 0; i < ELEMENTS(gFunctionTable); i++) { if (acedDefun(gFunctionTable[i].name, (short)i) != RTNORM) return RTERROR; } return RTNORM;}
开发者ID:Bohr27,项目名称:ObjectARXCore,代码行数:36,
示例21: whileunsigned int cSatipConfig::GetDisabledSourcesCount(void) const{ unsigned int n = 0; while ((n < ELEMENTS(disabledSourcesM) && (disabledSourcesM[n] != cSource::stNone))) n++; return n;}
开发者ID:paluseb,项目名称:vdr-plugin-satip,代码行数:7,
示例22: Initstatic voidInit(void){ const char *extensions[3] = { "GL_ARB_depth_texture", "GL_ARB_texture_cube_map", "GL_EXT_framebuffer_object" }; int i; for (i = 0; i < ELEMENTS(extensions); i++) { if (!glutExtensionSupported(extensions[i])) { printf("Sorry, this demo requires %s/n", extensions[i]); exit(1); } } glEnable(GL_DEPTH_TEST); glEnable(GL_LIGHTING); glEnable(GL_LIGHT0); GenerateCylinders(); printf("GL_RENDERER = %s/n", (char *) glGetString(GL_RENDERER));}
开发者ID:JoakimSoderberg,项目名称:mesademos,代码行数:25,
示例23: pt_bind/*===========================================================================* * pt_bind * *===========================================================================*/PUBLIC int pt_bind(pt_t *pt, struct vmproc *who){ int slot, ispt; u32_t phys; /* Basic sanity checks. */ vm_assert(who); vm_assert(who->vm_flags & VMF_INUSE); vm_assert(pt); slot = who->vm_slot; vm_assert(slot >= 0); vm_assert(slot < ELEMENTS(vmproc)); vm_assert(slot < I386_VM_PT_ENTRIES); phys = pt->pt_dir_phys & I386_VM_ADDR_MASK; vm_assert(pt->pt_dir_phys == phys); /* Update "page directory pagetable." */ page_directories[slot] = phys | I386_VM_PRESENT|I386_VM_WRITE;#if 0 printf("VM: slot %d has pde val 0x%lx/n", slot, page_directories[slot]);#endif /* Tell kernel about new page table root. */ return sys_vmctl(who->vm_endpoint, VMCTL_I386_SETCR3, pt ? pt->pt_dir_phys : 0);}
开发者ID:michalwojciech,项目名称:cs170s10proj2,代码行数:31,
示例24: nameToFactorGLenumnameToFactor(string& name) { for (unsigned int i = 0; i < ELEMENTS(factorNames); ++i) if (factorNames[i].name == name) return factorNames[i].token; assert(0); return GL_ZERO;} // nameToFactor
开发者ID:blaztinn,项目名称:piglit,代码行数:8,
示例25: operatingModeMcSatipConfig::cSatipConfig(void): operatingModeM(eOperatingModeLow), traceModeM(eTraceModeNormal), ciExtensionM(0), eitScanM(1), useBytesM(1), detachedModeM(false), disableServerQuirksM(false), useSingleModelServersM(false){ for (unsigned int i = 0; i < ELEMENTS(cicamsM); ++i) cicamsM[i] = 0; for (unsigned int i = 0; i < ELEMENTS(disabledSourcesM); ++i) disabledSourcesM[i] = cSource::stNone; for (unsigned int i = 0; i < ELEMENTS(disabledFiltersM); ++i) disabledFiltersM[i] = -1;}
开发者ID:paluseb,项目名称:vdr-plugin-satip,代码行数:17,
示例26: ELEMENTS/* doMenu itemsAbout Hypercard..., New Stack..., Open Stack..., Close Stack, Save ACopy..., Compact Stack, Protect Stack..., Delete Stack..., PageSetup..., Print Field..., Print Card, Print Stack..., Print Report...,Quit Hypercard, Undo, Cut, Copy, Paste, New Card, Delete Card, CutCard, Copy Card, Text Style..., Background, Icon..., Back, Home, Help,recent, First, Prev, Next, Last, Find..., Message, Scroll, NextWindow, Button Info..., Field Info..., Card Info..., Bkgnd Info...,Stack Info..., Bring Closer, Send Farther, New Button, New Field, NewBackground, Plain, Bold, Italic, Underline, Outline, Shadow, Condense,Extend, Group, Other..., Select, Select All, Fill, Invert, Pickup,Darken, Lighten, Trace Edges, Rotate Left, Rotate Right, FlipVertical, Flip Horizontal, Opaque, Transparent, Keep, Revert, grid,Fatbits, Power Keys, Line Size..., brush Shape..., Edit pattern...,Polygon Sides..., Draw filled, Draw centered, Draw multiple, Rotate,Slant, distort, Perspective, Import Paint..., Export Paint..., NewIcon, Close Icon Editor, Duplicate Icon, Cut Icon, Copy Icon, Erase,Frame, Gray, Mirror Horizontal, Mirror Vertical, Rotate 90, Shadow,Delete Report, Cut Report, Copy Report, Report Items..., ReportName..., New Report, New Item, Item Info..., Close Script, SaveScript, Revert To Saved, Print Script, Find Again, Find Selection,Scroll To Selection, Replace..., Replace Again, Comment, Uncomment,Set Checkpoint, Step, Step Into, Trace, Go, Trace Delay..., Abort,Variable Watcher, Message Watcher*/const char *MCDoMenu::lookup(const MCString &s){ uint2 size = ELEMENTS(domenu_table); while(size--) if (s == domenu_table[size].token) return domenu_table[size].command; return NULL;}
开发者ID:Bjoernke,项目名称:livecode,代码行数:33,
示例27: PrintNetfEntryvoid PrintNetfEntry( NETF_ENTRY* pentry ){ time_t mtime = pentry->fstat.nfs_mtime; struct tm* newtime = localtime( &(mtime) ); char buf[_MAX_LINE]; strftime( buf, ELEMENTS(buf), "%m/%d/%y %I:%M %p", newtime ); cout<<buf<<"/t"<<pentry->fname<<"/t"<<pentry->fstat.nfs_size<<endl;}
开发者ID:EISALab,项目名称:AMGAgroundwater,代码行数:8,
注:本文中的ELEMENTS函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ ELEMENTSOF函数代码示例 C++ ELEM函数代码示例 |