Esempio n. 1
0
static XmlNode sReadXmlNode(XmlParser& p, dword style)
{
	XmlNode m;
	if(p.IsTag()) {
		m.CreateTag(p.ReadTag());
		m.SetAttrsPick(p.PickAttrs());
		while(!p.End())
			if(!Ignore(p, style))
				m.Add() = sReadXmlNode(p, style);
		return m;
	}
	if(p.IsPI()) {
		m.CreatePI(p.ReadPI());
		return m;
	}
	if(p.IsDecl()) {
		m.CreateDecl(p.ReadDecl());
		return m;
	}
	if(p.IsComment()) {
		m.CreateComment(p.ReadComment());
		return m;
	}
	m.CreateText(p.ReadText());
	return m;
}
Esempio n. 2
0
XmlNode ParseXML(XmlParser& p, dword style)
{
	XmlNode r;
	while(!p.IsEof())
		if(!Ignore(p, style))
			r.Add() = sReadXmlNode(p, style);
	return r;
}
Esempio n. 3
0
static int
WALK_FUNC(scan_tree)
{
    char tmp[BUFSIZ];
    char *s = pathcat(tmp, path, name);
    Stat_t sb;

    if (RCS_DEBUG)
	PRINTF("++ %s%sscan (%s, %s, %s%d)\n",
	       R_opt ? "R " : "",
	       L_opt ? "L " : "",
	       path, name, (sp == 0) ? "no-stat, " : "", level);

    if (!quiet || n_opt)
	track_wd(path);

    if (sp == 0) {
	if (R_opt && (level > 0)) {
	    Ignore(name, " (no such file)");
	}
    } else if (isDIR(sp->st_mode)) {
	abspath(s);		/* get rid of "." and ".." names */
	if (ignore_dir(s))
	    readable = -1;
	else if (sameleaf(s, rcs_dir(NULL, NULL))) {
	    if (R_opt) {
		(void) walktree(strcpy(user_wd, path),
				name, scan_archive, "r", level);
	    }
	    readable = -1;
	} else {
#ifdef	S_IFLNK
	    if (!L_opt
		&& (lstat(s, &sb) < 0 || isLINK(sb.st_mode))) {
		Ignore(name, " (is a link)");
		readable = -1;
	    }
#endif
	}
    } else if (!isFILE(sp->st_mode)) {
	Ignore(name, RCS_DEBUG ? " (not a file)" : "");
	readable = -1;
    }
    return (readable);
}
Esempio n. 4
0
void Scanner::IgnoreWhiteSpaces()
{
    Ignore(
        [](char chr)
        {
            return chr == ' ' || chr == '\t';
        }
    );
}
Esempio n. 5
0
static void
win8_dict_add_to_session (EnchantDict *dict, const char *const word, size_t len)
{
	auto checker = static_cast<ISpellChecker*>(dict->user_data);
	wchar_t *wword = utf8_to_utf16 (word, len, FALSE);

	checker->Ignore (wword);
	g_free (wword);
}
Esempio n. 6
0
static JILError open_JCLFile(JCLFile* _this, const JILChar* pName, const JILChar* pText, const JILChar* pPath, JCLOption* pOptions)
{
	JILError err = JCL_No_Error;
	JCLString* pToken = NEW(JCLString);
	JILLong tokenID;
	JILLong loc;
	JCLFileToken* pft;
	// allocate members
	_this->mipName = NEW(JCLString);
	_this->mipText = NEW(JCLString);
	_this->mipPath = NEW(JCLString);
	_this->mipPackage = NEW(JCLString);
	_this->mipTokens = NEW(Array_JCLFileToken);
	_this->mipOptions = pOptions;
	_this->miLocator = 0;
	_this->miPass = 0;
	_this->miLine = 1;
	_this->miColumn = 0;
	_this->mipTokens->Grain(_this->mipTokens, 1024);
	// copy arguments
	JCLSetString(_this->mipName, pName);
	JCLSetString(_this->mipText, pText);
	JCLSetString(_this->mipPath, pPath);
	// pre-parse text
	for(;;)
	{
		if( JCLAtEnd(_this->mipText) )
			break;
		err = Ignore(_this);
		if( err || JCLAtEnd(_this->mipText) )
			break;
		err = GetToken(_this, pToken, &tokenID);
		if( err )
			break;
		loc = JCLGetLocator(_this->mipText);
		pft = _this->mipTokens->New(_this->mipTokens);
		pft->miLocation = loc;
		pft->miLine = _this->miLine;
		pft->miColumn = loc - _this->miColumn + 1;
		pft->miTokenID = tokenID;
		if( JCLGetLength(pToken) )
		{
			pft->mipToken = NEW(JCLString);
			pft->mipToken->Copy(pft->mipToken, pToken);
		}
	}
	if( err == JCL_ERR_End_Of_File )
		err = JCL_No_Error;
	DELETE(pToken);
	DELETE(_this->mipText);
	_this->mipText = NULL;
	_this->mipOptions = NULL;
	return err;
}
Esempio n. 7
0
static void
do_arg(const char *name)
{
#ifdef	S_IFLNK
    if (!L_opt) {
	Stat_t sb;
	if (lstat(name, &sb) >= 0 && isLINK(sb.st_mode)) {
	    Ignore(name, " (is a link)");
	    return;
	}
    }
#endif
    (void) walktree((char *) 0, name, scan_tree, "r", 0);
}
void
SVNListBase::HandleContextMenu
	(
	const JIndex index
	)
{
	if (index == kDiffEditedSelectedFilesCtxCmd)
		{
		JString rev;
		if (GetBaseRevision(&rev))
			{
			CompareEdited(rev);
			}
		}
	else if (index == kDiffCurrentSelectedFilesCtxCmd)
		{
		JString rev;
		GetBaseRevision(&rev);
		CompareCurrent(rev);
		}
	else if (index == kDiffPrevSelectedFilesCtxCmd)
		{
		JString rev;
		GetBaseRevision(&rev);
		ComparePrev(rev);
		}

	else if (index == kInfoLogSelectedFilesCtxCmd)
		{
		(GetDirector())->ShowInfoLog(this);
		}
	else if (index == kPropSelectedFilesCtxCmd)
		{
		(GetDirector())->ShowProperties(this);
		}

	else if (index == kIgnoreSelectionCtxCmd)
		{
		Ignore();
		}

	else if (index == kShowSelectedFilesCtxCmd)
		{
		ShowFiles();
		}
}
Esempio n. 9
0
Weapon::~Weapon()
{
    if (beams) {
        for (int i = 0; i < nbarrels; i++) {
            if (beams[i]) {
                Ignore(beams[i]);
                delete beams[i];
                beams[i] = 0;
            }
        }

        delete [] beams;
    }

    GRAPHIC_DESTROY(turret);
    GRAPHIC_DESTROY(turret_base);

    for (int i = 0; i < MAX_BARRELS; i++)
    GRAPHIC_DESTROY(visible_stores[i]);
}
Esempio n. 10
0
void
NetPlayer::SetShip(Ship* s)
{
	if (ship != s) {
		if (ship) {
			ship->EnableRepair(true);
			Ignore(ship);
		}

		ship = s;

		if (ship) {
			Observe(ship);
			ship->SetNetworkControl(this);
			ship->SetObjID(objid);

			iff = ship->GetIFF();

			// Turn off auto-repair.  All repair data should
			// come in over the network from the remote player:

			ship->EnableRepair(false);

			// Set all ship weapons back to manual fire control.
			// All trigger events should come over the network,
			// not from weapon auto aiming ai:

			ListIter<WeaponGroup> iter = ship->Weapons();
			while (++iter) {
				WeaponGroup* group = iter.value();

				ListIter<Weapon> w_iter = group->GetWeapons();
				while (++w_iter) {
					Weapon* weapon = w_iter.value();

					weapon->SetFiringOrders(Weapon::MANUAL);
				}
			}
		}
	}
}
Esempio n. 11
0
bool aimbot::DoStateCheck(CBaseEntity* pl)
{
	if (!pl->IsAlive())
		return 0;

	if (Ignore(pl))
		return 0;

	if (tf2())
	{
		if (pl->TF2_IsUbercharged())
			return 0;

		if (pl->TF2_HasCond(PlayerCond_Bonked))
			return 0;



		// TODO: Find better way to check if it's invulnerable

		//if (pl->TF2_GetClassNum() == Class_Demoman && pl->GetHealth() == 1 &&
		//	!strcmp(mdlinfo->GetModelName(pl->GetModel()), "models/bots/demo/bot_sentry_buster.mdl"))
		//
		//	return false;
	}

	if (MENU_SPAWPROT == 1 && ALPHA(pl->GetMDLColor()) == 128)
		return 0;

	if (MENU_SPAWPROT == 2 && pl->GetHealth() > 500)
		return 0;

	if (MENU_SPAWPROT == 3 && ALPHA(pl->GetMDLColor()) == 200)
		return 0;
	
	if (!MENU_STEAMBRO && pl->IsSteamFriend())
		return 0;

	return 1;
}
Esempio n. 12
0
/*ARGSUSED*/
static int
WALK_FUNC(scan_archive)
{
    char tmp[BUFSIZ];

    (void) level;

    if (!strcmp(user_wd, path))	/* account for initial argument */
	return (readable);
    if (!isFILE(sp->st_mode)
	|| !an_archive(name)) {
	Ignore(name, " (not an archive)");
	return (-1);
    }
    if (!strcmp(vcs_file((char *) 0, strcpy(tmp, name), FALSE), name))
	return (readable);

    set_wd(user_wd);
    Checkout(rcs2name(name, FALSE), pathcat(tmp, rcs_dir(NULL, NULL), name));
    set_wd(path);
    return (readable);
}
Esempio n. 13
0
 void ceefit_call_spec FIXTURE::DoCell(PTR<PARSE>& cell, int columnNumber)
 {
   Ignore(cell);
 }
Esempio n. 14
0
bool cTable0Handler::FixEpgBugs(cEvent *Event)
{
  return Ignore(Event);
}
Esempio n. 15
0
bool cTable0Handler::SetVps(cEvent *Event, time_t Vps)
{
  return Ignore(Event);
}
Esempio n. 16
0
bool cTable0Handler::SetParentalRating(cEvent *Event, int ParentalRating)
{
  return Ignore(Event);
}
Esempio n. 17
0
bool cTable0Handler::SetContents(cEvent *Event, uchar *Contents)
{
  return Ignore(Event);
}
Esempio n. 18
0
bool cTable0Handler::SetTitle(cEvent *Event, const char *Title)
{
  return Ignore(Event);
}
Esempio n. 19
0
 void f()     {Ignore();}
Esempio n. 20
0
bool cTable0Handler::SetStartTime(cEvent *Event, time_t StartTime)
{
  return Ignore(Event);
}
Esempio n. 21
0
bool cTable0Handler::SetEventID(cEvent *Event, tEventID EventID)
{
  return Ignore(Event);
}
Esempio n. 22
0
  // This method differs from the Java version in that we must go towards STRING for value comparisons versus using
  // TypeAdapter.equals() which works on Object's.  Here the CELLADAPTER is used to parse and filter values as well
  // as convey return data from method invocations.
  void ceefit_call_spec FIXTURE::Check(PTR<PARSE>& cell, PTR<CELLADAPTER>& aAdapter, PTR<FIXTURE>& target)
  {
      PTR<FIXTURE> targetPtr(target);
      if(targetPtr == null)
      {
        targetPtr = this;      // set the default fixture target to this...
      }

      STRING text(cell->Text());

      if(aAdapter == null)
      {
        Ignore(cell);
      }
      else if(text.IsEqual(""))
      {
        try
        {
          STRING aTemp;

          if(aAdapter->IsMethod())
          {
            PTR<CELLADAPTER> result;

            aAdapter->Invoke(result, targetPtr);
            result->ReadFromFixtureVar(aTemp);
          }
          else // if(aAdpater->IsField())
          {
            if(targetPtr == this)
            {
              aAdapter->ReadFromFixtureVar(aTemp);
            }
            else
            {
              aAdapter->ReadFromFixtureVar(aTemp, targetPtr);
            }
          }

          Info(cell, aTemp);
        }
        catch(FAILURE* failure)
        {
          Info(cell, "error");

          delete failure;
        }
        catch(EXCEPTION* e)
        {
          Info(cell, "error");

          delete e;
        }
        catch(...)
        {
          Info(cell, "error");
        }
      }
      else if (text.IsEqual("error"))
      {
        try
        {
          STRING aTemp;
          PTR<CELLADAPTER> aResult;

          aAdapter->Invoke(aResult, targetPtr);

          aResult->ReadFromFixtureVar(aTemp);
          Wrong(cell, aTemp);
        }
        catch(FITFAILED* fitFailed)
        {
          Right(cell);

          delete fitFailed;
        }
        catch(FITASSERTIONFAILED* fitAssertionFailed)
        {
          Right(cell);

          delete fitAssertionFailed;
        }
        catch(EXCEPTION* e)
        {
          Right(cell);

          delete e;
        }
        catch(...)
        {
          Right(cell);
        }
      }
      else
      {
        PTR<CELLADAPTER> callResults;
        PTR<CELLADAPTER> checkValueCell;

        try
        {
          STRING result;
          STRING checkValue;

          if(aAdapter->IsField())
          {
            // The "callResults" is the field we are comparing
            if(targetPtr == this) 
            {
              callResults = aAdapter;
            }
            else
            {
              PTR<FIXTURE> notNeeded;
              callResults = targetPtr->FindField(notNeeded, aAdapter->GetName());

              if(callResults == null) 
              {
                throw new EXCEPTION(STRING("Field not found in FIXTURE:  ") + aAdapter->GetName());
              }
            }

            aAdapter->NewInstanceParse(targetPtr.GetPointer(), checkValueCell, text);
          }
          else // if(aAdapter->IsMethod())
          {
            aAdapter->Invoke(callResults, targetPtr);
            callResults->NewInstanceParse(targetPtr.GetPointer(), checkValueCell, text);
          }

          // checkValueCell must exactly equal result for the test to pass
          if (checkValueCell->IsEqual(*callResults))   // note:  this calls through to CELLCOMPARABLE implementations if available
          {
            Right(cell);
          }
          else
          {
            callResults->ReadFromFixtureVar(result);
            Wrong(cell, result);
          }
        }
        catch (EXCEPTION* e)
        {
          Exception(cell, e);
        }
        catch(...)
        {
          EXCEPTION* systemException = new EXCEPTION("System generated exception or unknown user exception type (exceptions thrown from a FIXTURE class should extend CEEFIT::EXCEPTION.)");

          Exception(cell, systemException);
        }
      }
  }
Esempio n. 23
0
bool cTable0Handler::SetShortText(cEvent *Event, const char *ShortText)
{
  return Ignore(Event);
}
Esempio n. 24
0
bool cTable0Handler::SetDescription(cEvent *Event, const char *Description)
{
  return Ignore(Event);
}
Esempio n. 25
0
bool cTable0Handler::SetDuration(cEvent *Event, int Duration)
{
  return Ignore(Event);
}
Esempio n. 26
0
static JILError GetStrLiteral(JCLFile* _this, JCLString* string)
{
	JILError err = JCL_ERR_End_Of_File;
	JILLong c, q, p;
	char* pDummy;
	JCLString* pTemp = NULL;
	JILBool bEscape = JILTrue;

	JCLClear(string);
	// skip the start quote
	p = q = JCLGetCurrentChar(_this->mipText);
	if( p == '/' || p == '@' )
	{
		// un-escaped string literal
		bEscape = JILFalse;
		JCLSeekForward(_this->mipText, 1);
		q = JCLGetCurrentChar(_this->mipText);
	}
	JCLSeekForward(_this->mipText, 1);
	// seek toward end quote
	while( !JCLAtEnd(_this->mipText) )
	{
		c = JCLGetCurrentChar(_this->mipText);
		if( bEscape && c == '\\' )			// escape character?
		{
			// get next character
			JCLSeekForward(_this->mipText, 1);
			if( JCLAtEnd(_this->mipText) )
				goto error;
			c = JCLGetCurrentChar(_this->mipText);
			switch( c )
			{
				case 'a':	// alert (bell)
					JCLAppend(string, "\a");
					JCLSeekForward(_this->mipText, 1);
					break;
				case 'b':	// backspace
					JCLAppend(string, "\b");
					JCLSeekForward(_this->mipText, 1);
					break;
				case 'e':	// escape
					JCLAppend(string, "\x1B");
					JCLSeekForward(_this->mipText, 1);
					break;
				case 'f':	// formfeed
					JCLAppend(string, "\f");
					JCLSeekForward(_this->mipText, 1);
					break;
				case 'n':	// newline
					JCLAppend(string, "\n");
					JCLSeekForward(_this->mipText, 1);
					break;
				case 'r':	// return
					JCLAppend(string, "\r");
					JCLSeekForward(_this->mipText, 1);
					break;
				case 't':	// tab
					JCLAppend(string, "\t");
					JCLSeekForward(_this->mipText, 1);
					break;
				case 'v':	// vertical tab
					JCLAppend(string, "\v");
					JCLSeekForward(_this->mipText, 1);
					break;
				case '\'':	// single quotation mark
					JCLAppend(string, "\'");
					JCLSeekForward(_this->mipText, 1);
					break;
				case '\"':	// double quotation mark
					JCLAppend(string, "\"");
					JCLSeekForward(_this->mipText, 1);
					break;
				case '\\':	// backslash
					JCLAppend(string, "\\");
					JCLSeekForward(_this->mipText, 1);
					break;
				case 'x':	// ASCII character in hexadecimal
					// skip the x
					JCLSeekForward(_this->mipText, 1);
					if( JCLAtEnd(_this->mipText) )
						goto error;
					pTemp = NEW(JCLString);
					JCLSpanIncluding(_this->mipText, kHexDigitChars, pTemp);
					c = strtol(JCLGetString(pTemp), &pDummy, 16);
					DELETE( pTemp );
					pTemp = NULL;
					if( sizeof(JILChar) == 1 && c > 255 )
					{
						err = JCL_ERR_Character_Value_Too_Large;
						goto error;
					}
					JCLAppendChar(string, c);
					break;
				case '0':	// ASCII character in octal
					pTemp = NEW(JCLString);
					JCLSpanIncluding(_this->mipText, kOctDigitChars, pTemp);
					c = strtol(JCLGetString(pTemp), &pDummy, 8);
					DELETE( pTemp );
					pTemp = NULL;
					if( sizeof(JILChar) == 1 && c > 255 )
					{
						err = JCL_ERR_Character_Value_Too_Large;
						goto error;
					}
					JCLAppendChar(string, c);
					break;
			}
		}
		else if( c == q )		// end quote?
		{
			if( bEscape )
			{
				// skip end quote
				JCLSeekForward(_this->mipText, 1);
				// ignore whitespace
				err = Ignore(_this);
				if( err )
					goto error;
				// check what's next
				c = JCLGetCurrentChar(_this->mipText);
				// another quote?
				if( c == q )
				{
					bEscape = JILTrue;
					// skip quote and continue
					JCLSeekForward(_this->mipText, 1);
				}
				else if( (c == '/' || c == '@') && JCLGetChar(_this->mipText, JCLGetLocator(_this->mipText) + 1) == q )
				{
					p = c;
					bEscape = JILFalse;
					// skip quote and continue
					JCLSeekForward(_this->mipText, 2);
				}
				else
				{
					// we're done
					err = JCL_No_Error;
					break;
				}
			}
			else
			{
				if( p == '@' || JCLGetChar(_this->mipText, JCLGetLocator(_this->mipText) + 1) == '/' )
				{
					// skip quote
					JCLSeekForward(_this->mipText, (p == '@') ? 1 : 2);
					// ignore whitespace
					err = Ignore(_this);
					if( err )
						goto error;
					// check what's next
					c = JCLGetCurrentChar(_this->mipText);
					// another quote?
					if( c == q )
					{
						bEscape = JILTrue;
						// skip quote and continue
						JCLSeekForward(_this->mipText, 1);
					}
					else if( (c == '/' || c == '@') && JCLGetChar(_this->mipText, JCLGetLocator(_this->mipText) + 1) == q )
					{
						p = c;
						bEscape = JILFalse;
						// skip quote and continue
						JCLSeekForward(_this->mipText, 2);
					}
					else
					{
						// we're done
						err = JCL_No_Error;
						break;
					}
				}
				else
				{
					JCLAppendChar(string, c);
					JCLSeekForward(_this->mipText, 1);
				}
			}
		}
		else					// any other character
		{
			JCLAppendChar(string, c);
			JCLSeekForward(_this->mipText, 1);
		}
	}
error:
	DELETE( pTemp );
	return err;
}