示例#1
0
文件: brkcode.c 项目: bencz/OrangeC
void SetBP(DEBUG_EVENT *dbe)
{
    BREAKPOINT **p = &activeProcess->breakpoints.next;
    if (hwndASM && GetFocus() == hwndASM)
    {
        int addr = SendMessage(hwndASM, WM_GETCURSORADDRESS, 0, 0);
        Tag(TAG_BP, 0, addr, 0, 0, 0, 0);
        if (uState == Running)
            allocBreakPoint(activeProcess->hProcess,  *p);
    }
    else
    {
        HWND hWnd = GetFocus();
        DWINFO *ptr = editWindows;
        while (ptr)
        {
            if (ptr->active && ptr->dwHandle == hWnd)
            {
                int addr, linenum;
                SendMessage(ptr->dwHandle, EM_GETSEL, (WPARAM) &linenum, 0);
                linenum = SendMessage(ptr->dwHandle, EM_EXLINEFROMCHAR, 0,
                    linenum) + 1;
                Tag(TAG_BP, ptr->dwName, linenum, 0, 0, 0, 0);
                break;
            }
            ptr = ptr->next;
        }
    }
    if (hwndASM)
        InvalidateRect(hwndASM, 0, 0);
}
示例#2
0
Tag Object::toTag() const
{
	if(isTag())
		return Tag(*this);
	else
		return Tag();
}
示例#3
0
void CRTDBItem::OnPoke()
  {
  Strng Tag, Cnv;
  TaggedObject::SplitTagCnv((char*)(const char*)m_strName, Tag, Cnv);
  
  CXM_ObjectTag  ObjTag(Tag(), TABOpt_AllInfoOnce);
  CXM_ObjectData ObjData;
  CXM_Route      Route;

  DWORD RetCode = pDdeExec->XReadTaggedItem(ObjTag, ObjData, Route);

  //LogNote(Tag(), 0, "DDE Poke: '%s' %s", pszItem, RetCode ? "Found" : "Not Found");
  if (RetCode==0)
    LogError(Tag(), 0, "DDE: Tag poke for '%s' not found", (const char*)m_strName);
  pDdeExec->StatsCnt[RetCode==0 ? 3 : 2]++;
  
  if (RetCode)
    {
    CPkDataItem * pPItem = ObjData.FirstItem();
    CCnvIndex iCnv = 0;
    if (pPItem->Contains(PDI_CnvInfo))
      iCnv = pPItem->CnvIndex();

    PkDataUnion DU;
    DU.SetTypeString(pPItem->Type(), (char*)(const char*)m_strData, iCnv, Cnv());
    CXM_ObjectData ObjData(0, 0, Tag(), 0, DU);
    flag Ok = (pDdeExec->XWriteTaggedItem(ObjData, Route)==TOData_OK);
    if (Ok)
      gs_Exec.m_Seq.NoteManSet(CExecSequence::VSS_DDE, Tag(), m_strData, Cnv());
    }
  }
 DynamicQuantity get(const input::Traits<Localization>& traits) const {
   if (traits.field(Tag()).range().second) {
     return dynamizer(*traits.field(Tag()).range().second);
   } else {
     throw std::runtime_error("Tried to read variable " + name + ", but it is not defined.");
   }
 }
 bool set( const input::Traits<Localization>& localization_traits, Localization& localization, const DynamicQuantity& value ) const {
   const typename Tag::ValueType parsed_value( dynamizer(value) );
   localization.field(Tag()) = parsed_value;
   const auto& traits = localization_traits.field(Tag());
   return (!traits.range().first || *traits.range().first <= parsed_value) &&
          (!traits.range().second || *traits.range().second >= parsed_value);
 }
示例#6
0
BOOL CRTDBTopic::CreateNewRequestItem(const char* pszItem)
  {
  Strng Tag, Cnv;
  TaggedObject::SplitTagCnv((char*)pszItem, Tag, Cnv);

  CXM_Route  ObjRoute; 
  CXM_ObjectTag ObjTag(Tag(), TABOpt_AllInfo);
  CXM_ObjectData ObjData(0);
 
  DWORD RetCode = pDdeExec->XReadTaggedItem(ObjTag, ObjData, ObjRoute);
  
  //LogNote(Tag(), 0, "DDE: '%s' %s", pszItem, RetCode ? "Found" : "Not Found");
  if (RetCode==0)
    LogError(Tag(), 0, "DDE: Tag request for '%s' not found", pszItem);
  pDdeExec->StatsCnt[RetCode==0 ? 3 : 1]++;

  if (RetCode) //This is a configured point so go and add the item
    {
    m_pServer->Lock();
    CPkDataItem * pPItem = ObjData.FirstItem();
    CRTDBItem* pItem = new CRTDBItem();
    pItem->iCnvIndex = pPItem->CnvIndex();
    pItem->Create(pszItem);
    AddItem(pItem);
    m_pServer->Release();
    pItem->SetDataOnly(pPItem->Value()->GetString("%i", "%g", pItem->iCnvIndex, Cnv()));
    pDdeExec->XBuildMyDataLists();
    return TRUE;
    }
  return FALSE;
  }
示例#7
0
Tags::Tags(string str) {
    bool read_tag_mode = false;
    size_t str_size = str.size();
    string tag = "";
    for (size_t c = 0; c < str_size; c++) {
        if (str[c] == '@') {
            if (read_tag_mode) {
                tags.push_back(Tag(tag));
            }
            else {
                name = tag;
                read_tag_mode = true;
            }

            tag = "";
        }
        else {
            tag += str[c];
        }
    }

    if (tag.size()) {
        if (read_tag_mode) {
            tags.push_back(Tag(tag));
        }
        else {
            name = tag;
        }
    }
}
示例#8
0
void CActuator::FixIOTags()
  {
  int N=m_DataBlk.GetSize()*1+1;
  m_IOAreas.SetSize(N);
  int j=0;
  for (int i=0; i<m_DataBlk.GetSize(); i++)
    {
    CActuatorBlk * pT = m_DataBlk[i];
    if (!pT->m_sID())
      pT->m_sID.Set("A%i",i);
    pT->m_sIDInput.Set("%s.%s.Rqd", Tag(), pT->m_sID());
    pT->m_sIDOutput.Set("%s.%s.Out", Tag(), pT->m_sID());
    pT->m_sTagInput.Set("%s.Cfg.[%i].%s", Tag(), i, "Rqd");
    pT->m_sTagOutput.Set("%s.Cfg.[%i].%s", Tag(), i, "Out");

    IOAreaRec & AV= m_IOAreas[j];
    AV=BaseActuatorIOArea;
    AV.SetIODesc(pT->m_sIDInput());
    AV.SetIOName(IONames[j]());
    AV.m_Id=CtrlIOId(j);
    j++;   

    //IOAreaRec & AR= m_IOAreas[j];
    //AR=BaseActuatorIOArea;
    //AR.pDesc=pT->m_sIORaw();
    //AR.pName=IONames[j]();
    //AR.Id=j;
    //j++;
    }
  m_IOAreas[j]=BaseActuatorIOArea;
  
  AttachIOAreas(&m_IOAreas[0], NULL, NULL, false);
  StructureChanged(this);
  }
AuthorizationResultPtr OAuth2Response::parseAuthorizeResponse(const String& webAuthenticationResult, CallStatePtr/* callState*/)
{
    Logger::info(Tag(), "parseAuthorizeResponse");
    Logger::hidden(Tag(), "webAuthenticationResult: " + webAuthenticationResult);

    AuthorizationResultPtr parseResult = nullptr;

    QUrl url(webAuthenticationResult.data());
    if (url.hasQuery())
    {
        QUrlQuery query = QUrlQuery(url);
        if( query.hasQueryItem(OAuthConstants::oAuthReservedClaim().Code.data()) )
        {
            parseResult = std::make_shared<AuthorizationResult>(query.queryItemValue(OAuthConstants::oAuthReservedClaim().Code.data()).toStdString());
        }
        else if( query.hasQueryItem(OAuthConstants::oAuthReservedClaim().Error.data()) )
        {
            String error = query.queryItemValue(OAuthConstants::oAuthReservedClaim().Error.data()).toStdString();
            String errorDesc = query.hasQueryItem(OAuthConstants::oAuthReservedClaim().ErrorDescription.data())
                ? query.queryItemValue(OAuthConstants::oAuthReservedClaim().ErrorDescription.data(), QUrl::FullyDecoded).toStdString()
                : "";
            parseResult = std::make_shared<AuthorizationResult>(
                error,
                StringUtils::replaceAll(errorDesc, '+', ' '));
        }
        else
        {
            parseResult = std::make_shared<AuthorizationResult>(
                Constants::rmsauthError().AuthenticationFailed,
                Constants::rmsauthErrorMessage().AuthorizationServerInvalidResponse);
        }
    }

    return parseResult;
}
示例#10
0
Tag Sequence::getTag(unsigned int index) const
{
	if (index < value_.size())
	{
		return Tag(value_.at(index));
	}

	return Tag();
}
示例#11
0
inline T cyl_bessel_j_prime_imp(T v, T x, const Policy& pol)
{
   static const char* const function = "boost::math::cyl_bessel_j_prime<%1%>(%1%,%1%)";
   BOOST_MATH_STD_USING
   //
   // Prevent complex result:
   //
   if (x < 0 && floor(v) != v)
      return boost::math::policies::raise_domain_error<T>(
         function,
         "Got x = %1%, but function requires x >= 0", x, pol);
   //
   // Special cases for x == 0:
   //
   if (x == 0)
   {
      if (v == 1)
         return 0.5;
      else if (v == -1)
         return -0.5;
      else if (floor(v) == v || v > 1)
         return 0;
      else return boost::math::policies::raise_domain_error<T>(
         function,
         "Got x = %1%, but function is indeterminate for this order", x, pol);
   }
   //
   // Special case for large x: use asymptotic expansion:
   //
   if (boost::math::detail::asymptotic_bessel_derivative_large_x_limit(v, x))
      return boost::math::detail::asymptotic_bessel_j_derivative_large_x_2(v, x);
   //
   // Special case for small x: use Taylor series:
   //
   if ((abs(x) < 5) || (abs(v) > x * x / 4))
   {
      bool inversed = false;
      if (floor(v) == v && v < 0)
      {
         v = -v;
         if (itrunc(v, pol) & 1)
            inversed = true;
      }
      T r = boost::math::detail::bessel_j_derivative_small_z_series(v, x, pol);
      return inversed ? T(-r) : r;
   }
   //
   // Special case for v == 0:
   //
   if (v == 0)
      return -boost::math::detail::cyl_bessel_j_imp<T>(1, x, Tag(), pol);
   //
   // Default case:
   //
   return boost::math::detail::bessel_j_derivative_linear(v, x, Tag(), pol);
}
示例#12
0
void Pet::fromJson(nlohmann::json& val)
{
    if(val.find("id") != val.end())
    {
        setId(val.at("id"));
    }
    if(val.find("category") != val.end())
    {
        if(!val["category"].is_null())
        {
            Category newItem(Category());
            newItem.fromJson(val["category"]);
            setCategory( newItem );
        }
        
    }
    setName(val.at("name"));
    {
        m_PhotoUrls.clear();
        nlohmann::json jsonArray;
                for( auto& item : val["photoUrls"] )
        {
            m_PhotoUrls.push_back(item);
            
        }
    }
    {
        m_Tags.clear();
        nlohmann::json jsonArray;
        if(val.find("tags") != val.end())
        {
        for( auto& item : val["tags"] )
        {
            
            if(item.is_null())
            {
                m_Tags.push_back( Tag(nullptr) );
            }
            else
            {
                Tag newItem(Tag());
                newItem.fromJson(item);
                m_Tags.push_back( newItem );
            }
            
        }
        }
    }
    if(val.find("status") != val.end())
    {
        setStatus(val.at("status"));
        
    }
    
}
示例#13
0
void TypeMap::registerMapping(const char *tag, const char *ns, const char *classname, NodeHandler *handler) {
	tags[Tag(tag, ns)] = classname;

	std::pair<RawTagMap::iterator,bool> itp;
	itp = tagsWithoutNs.insert(RawTagMap::value_type(tag, classname));

	// Tag exists already -> set invalid classname
	if ( !itp.second ) itp.first->second.clear();

	classes[classname] = Tag(tag, ns);
	handlers[classname] = new TypeNameHandler(handler, classname);
}
示例#14
0
	bool ArrayType::Equal(const Type* other) const
	{
		if(	getArchType() != other->getArchType())
			return false;

		return Tag() == other->Tag();
	}
示例#15
0
void PnlPlnrUsgDetail::DpchEngData::readXML(
			xmlXPathContext* docctx
			, string basexpath
			, bool addbasetag
		) {
	clear();

	bool basefound;

	if (addbasetag)
		basefound = checkUclcXPaths(docctx, basexpath, basexpath, "DpchEngPlnrUsgDetailData");
	else
		basefound = checkXPath(docctx, basexpath);

	if (basefound) {
		if (extractStringUclc(docctx, basexpath, "scrJref", "", scrJref)) add(SCRJREF);
		if (contiac.readXML(docctx, basexpath, true)) add(CONTIAC);
		if (continf.readXML(docctx, basexpath, true)) add(CONTINF);
		if (statapp.readXML(docctx, basexpath, true)) add(STATAPP);
		if (statshr.readXML(docctx, basexpath, true)) add(STATSHR);
		if (tag.readXML(docctx, basexpath, true)) add(TAG);
	} else {
		contiac = ContIac();
		continf = ContInf();
		statapp = StatApp();
		statshr = StatShr();
		tag = Tag();
	};
};
示例#16
0
/* readonly attribute nsIDOMSVGSVGElement ownerSVGElement; */
NS_IMETHODIMP
nsSVGElement::GetOwnerSVGElement(nsIDOMSVGSVGElement * *aOwnerSVGElement)
{
  *aOwnerSVGElement = nsnull;

  nsIContent* ancestor = nsSVGUtils::GetParentElement(this);

  while (ancestor && ancestor->GetNameSpaceID() == kNameSpaceID_SVG) {
    nsIAtom* tag = ancestor->Tag();
    if (tag == nsGkAtoms::foreignObject) {
      // SVG in a foreignObject must have its own <svg> (nsSVGOuterSVGFrame).
      // Leave *aOwnerSVGElement nulled out, but don't throw.
      return NS_OK;
    }
    if (tag == nsGkAtoms::svg) {
      *aOwnerSVGElement = static_cast<nsSVGSVGElement*>(ancestor);
      NS_ADDREF(*aOwnerSVGElement);
      return NS_OK;
    }
    ancestor = nsSVGUtils::GetParentElement(ancestor);
  }

  // we don't have a parent SVG element...

  // are _we_ the outermost SVG element? If yes, return nsnull, but don't fail
  if (Tag() == nsGkAtoms::svg) {
    return NS_OK;
  }
  
  // no owner found and we aren't the outermost SVG element either.
  // this situation can e.g. occur during content tree teardown. 
  return NS_ERROR_FAILURE;
}
示例#17
0
Tags::Tags(const char* chartags) {
    const std::string tags(chartags);
    std::vector<std::string> strings = splitString(tags, ',');
    for (auto& strings_it : strings) {
        addTag(Tag(trim(strings_it)));
    }
}
void AcquireTokenInteractiveHandler::sendAuthorizeRequest()
{
    Logger::info(Tag(), "sendAuthorizeRequest");
    String authorizationUri = createAuthorizationUri(includeFormsAuthParams());
    String resultUri = webUi_->authenticate(authorizationUri, redirectUri_);
    authorizationResult_ = OAuth2Response::parseAuthorizeResponse(resultUri, callState_);
}
String AcquireTokenInteractiveHandler::createAuthorizationUriAsync(const Guid& correlationId)
{
    Logger::info(Tag(), "createAuthorizationUriAsync");
    callState_->correlationId(correlationId);
    authenticator_->updateFromTemplateAsync(callState_);
    return createAuthorizationUri(false);
}
示例#20
0
 // needed?
 Tag find( const std::string& name ) const {
     TagMap::const_iterator it = m_tags.find( name );
     if( it == m_tags.end() )
         return Tag();
     else
         return it->second;
 }
示例#21
0
int CActuator::DeleteTag(pchar pDelTag)
  {
  BOOL FoundOne = FALSE;
  for (int i=0; i<m_DataBlk.GetSize(); i++)
    {
    if (m_DataBlk[i]->m_OutputVar.ContainsTag(pDelTag))
      FoundOne = TRUE;
    }
  if (FoundOne)
    {
    LogNote(Tag(), 0, "Delete tag '%s' affects Actuater model '%s'.", pDelTag, Tag());
    PreStartCheck();
    bAboutToStart = 0;
    }
  return FlwNode::DeleteTag(pDelTag);
  }
    bool string_compare(Char const* attr, Char const* lit, CharEncoding ce, Tag tag)
    {
        Char ch_attr = *attr;
        Char ch_lit = spirit::char_class::convert<CharEncoding>::to(Tag(), *lit);

        while (!!ch_lit && !!ch_attr)
        {
            if (ch_attr != ch_lit)
                return false;

            ch_attr = *++attr;
            ch_lit = spirit::char_class::convert<CharEncoding>::to(Tag(), *++lit);
        }

        return true;
    }
示例#23
0
 /**
  * TODO(skonefal): SerenityConfig should have const methods inside.
  *                 Currently, it cannot be passed as const.
  */
 explicit SeniorityStrategy(SerenityConfig _config)
     : RevocationStrategy(Tag(QOS_CONTROLLER, NAME)) {
   initialize();
   if (_config.hasKey(STARTING_SEVERITY_KEY)) {
      severity = _config.getD(STARTING_SEVERITY_KEY);
   }
 }
示例#24
0
void CrdFmncAct::DpchEngData::readXML(
			xmlXPathContext* docctx
			, string basexpath
			, bool addbasetag
		) {
	clear();

	bool basefound;

	if (addbasetag)
		basefound = checkUclcXPaths(docctx, basexpath, basexpath, "DpchEngFmncActData");
	else
		basefound = checkXPath(docctx, basexpath);

	if (basefound) {
		if (extractStringUclc(docctx, basexpath, "scrJref", "", scrJref)) add(SCRJREF);
		if (continf.readXML(docctx, basexpath, true)) add(CONTINF);
		if (feedFSge.readXML(docctx, basexpath, true)) add(FEEDFSGE);
		if (statapp.readXML(docctx, basexpath, true)) add(STATAPP);
		if (statshr.readXML(docctx, basexpath, true)) add(STATSHR);
		if (tag.readXML(docctx, basexpath, true)) add(TAG);
	} else {
		continf = ContInf();
		feedFSge.clear();
		statapp = StatApp();
		statshr = StatShr();
		tag = Tag();
	};
};
示例#25
0
DBDAT* DbaseGetData( char* path, char* keyword )
    {
    DBDAT* dbdat = DbaseLookup( path, Tag( keyword ) ) ;
    if( !dbdat )
	IOerror( IO_WARN, "DbaseGetData", "no value found for %s in %s", keyword, path ) ;
    return dbdat ;
    }
 inline bool 
 generate_to(OutputIterator& sink, Attribute const& p, CharEncoding, Tag)
 {
     *sink = spirit::char_class::convert<CharEncoding>::to(Tag(), p);
     ++sink;
     return detail::sink_is_good(sink);
 }
示例#27
0
template<> bool Config<const char *>::Set(const char *newval)
{ 
  if( m_current == newval )
    return true;
  if( m_current && newval && 0==strcmp(newval, m_current) )
    return true;

  if( !Locked() && Valid(newval) ){
    size_t len;
    char *tmp;
    if( m_current ){
      delete []m_current;
      m_current = (const char *)0;
    }
    if( newval ){
      len = strlen(newval);
      if( MaxLen() && len > MaxLen() ) len = MaxLen();
      if( !(tmp = new char[len + 1]) ) return false;
      strncpy(tmp, newval, len);
      tmp[len] = '\0';
      m_current = tmp;
    }
    Handler();
    if(*cfg_verbose)
      CONSOLE.Debug("Config: %s = \"%s\"", Tag(), m_current ? m_current : "");
    return true;
  }
  return false;
}
示例#28
0
    void dispatch_ifaddr(Tag, struct nlmsghdr * nlmsg)
    {
        if (nlmsg->nlmsg_type != RTM_NEWADDR)
            return;

        auto ifa = reinterpret_cast<struct ::ifaddrmsg *>(NLMSG_DATA(nlmsg));
        std::size_t len = RTM_PAYLOAD(nlmsg);
        switch(ifa->ifa_family) {
            case AF_INET:
                dispatch_ifaddr_v4(Tag(), ifa, len);
                break;
            case AF_INET6:
                dispatch_ifaddr_v6(Tag(), ifa, len);
                break;
        }
    }
示例#29
0
 UtilizationThresholdFilter(
     Consumer<ResourceUsage>* _consumer,
     double_t _utilizationThreshold = utilization::DEFAULT_THRESHOLD,
     const Tag& _tag = Tag(UNDEFINED, "utilizationFilter"))
     : tag(_tag), Producer<ResourceUsage>(_consumer),
       utilizationThreshold(_utilizationThreshold),
       previousSamples(new ExecutorSet) {}
bool Wiinnertag::CreateExample(const string &filepath)
{
	if(filepath.size() == 0)
		return false;

	CreateSubfolder(filepath.c_str());

	string fullpath = filepath;
	if(fullpath[fullpath.size()-1] != '/')
		fullpath += '/';
	fullpath += "Wiinnertag.xml";

	TiXmlDocument xmlDoc;

	TiXmlDeclaration declaration("1.0", "UTF-8", "");
	xmlDoc.InsertEndChild(declaration);

	TiXmlElement Tag("Tag");
	Tag.SetAttribute("URL", "http://www.wiinnertag.com/wiinnertag_scripts/update_sign.php?key={KEY}&game_id={ID6}");
	Tag.SetAttribute("Key", "1234567890");
	xmlDoc.InsertEndChild(Tag);

	xmlDoc.SaveFile(fullpath);

	return true;
}