itv_object_t *__itv_object_find_name(itv_object_t *p_this, const char *psz_name, int i_mode) { itv_object_t *p_found; if(p_this->psz_object_name && !strcmp(p_this->psz_object_name, psz_name)) { itv_object_hold(p_this); return p_this; } itv_lock(p_this->icore); if((i_mode & 0x000f) == FIND_ANYWHERE) { itv_object_t *p_root = p_this; /* Find the root */ while(p_root->parent != NULL && p_root != ITV_OBJECT(p_this->icore)) { p_root = p_root->parent; } p_found = FindObjectName(p_root, psz_name, (i_mode & ~0x000f) | FIND_CHILD); if(p_found == NULL && p_root != ITV_OBJECT(p_this->icore)) { p_found = FindObjectName(ITV_OBJECT(p_this->icore), psz_name, (i_mode & ~0x000f) | FIND_CHILD); } } else { p_found = FindObjectName(p_this, psz_name, i_mode); } itv_unlock(p_this->icore); return p_found; }
static itv_object_t *FindObjectName(itv_object_t *p_this, const char *psz_name, int i_mode) { int i; itv_object_t *p_tmp; switch(i_mode & 0x000f) { case FIND_PARENT: p_tmp = p_this->parent; if(p_tmp) { if(p_tmp->psz_object_name && !strcmp(p_tmp->psz_object_name, psz_name)) { itv_object_hold(p_tmp); return p_tmp; } else { return FindObjectName(p_tmp, psz_name, i_mode); } } break; case FIND_CHILD: for(i = itv_object_internals(p_this)->i_children; i--; ) { p_tmp = itv_object_internals(p_this)->pp_children[i]; if(p_tmp->psz_object_name && !strcmp(p_tmp->psz_object_name, psz_name)) { itv_object_hold(p_tmp); return p_tmp; } else if(itv_object_internals(p_tmp)->i_children) { p_tmp = FindObjectName(p_tmp, psz_name, i_mode); if(p_tmp) return p_tmp; } } break; case FIND_ANYWHERE: break; } return NULL; }
extern void ParseMicrosoft( void ) /********************************/ // read in Microsoft linker commands { char cmd[LINE_BUF_SIZE]; char *end; size_t len; bool first; bool more_objs; bool more_libs; /* Start with object files. */ mask_spc_chr = 0x1f; /* Replace spaces with another character. */ more_cmdline = !!*CmdFile->current; first = more_cmdline; is_new_line = true; do { more_objs = false; /* No more unless we discover otherwise. */ if( first ) len = GetLine( cmd, sizeof( cmd ), OPTION_SLOT ); else len = GetLine( cmd, sizeof( cmd ), OBJECT_SLOT ); if( !len ) break; end = LastStringChar( cmd ); if( *end == mask_spc_chr ) { more_objs = true; *end = '\0'; } TokenizeLine( cmd, mask_spc_chr, DoOneObject ); first = false; } while( more_objs ); /* Check for possible error conditions. */ if( OverlayLevel ) Error( "unmatched left parenthesis" ); FindObjectName(); /* This will report an error if no objects. */ mask_spc_chr = 0; /* Remove spaces in input. */ /* Get executable and map file name. */ GetNextInput( cmd, sizeof( cmd ), RUN_SLOT ); GetNextInput( cmd, sizeof( cmd ), MAP_SLOT ); mask_spc_chr = 0x1f; /* Replace spaces with another character. */ /* Get library file names. */ if( !is_term ) { do { GetLine( cmd, sizeof( cmd ), LIBRARY_SLOT ); more_libs = false; if( is_term || *cmd == '\0' ) break; end = LastStringChar( cmd ); if( *end == mask_spc_chr ) { more_libs = true; *end = '\0'; } TokenizeLine( cmd, mask_spc_chr, DoOneLib ); } while( more_libs ); } mask_spc_chr = 0; /* Remove spaces in input again. */ /* Get def file name and process it. */ GetNextInput( cmd, sizeof( cmd ), DEF_SLOT ); ProcessDefFile(); }
// 获取数据 _VARIANT& CScriptAdapterCSV::GetData(LPCSTR szName) { int nIndex = FindObjectName(szName); return GetData(nIndex); }