Example #1
0
/*
 * ScanAsm - scan an asm file
 */
void ScanAsm( void )
{
    char        buff[MAX_STR];
    char        token[MAX_STR];
    char        *buffptr;
    int         i;

    while( GetString( buff, sizeof( buff ) ) ) {

        buffptr = buff;
        while( isspace( *buffptr ) ) {
            buffptr++;
        }
        if( *buffptr == '\0' ) {
            continue;
        }
        i = 0;
        while( IsTokenChar( *(unsigned char *)buffptr ) ) {
            token[i++] = *buffptr++;
        }
        if( i == 0 ) {
            continue;
        }
        token[i] = '\0';
        while( isspace( *buffptr ) ) {
            buffptr++;
        }
        if( MyStricmp( &buffptr, "proc" ) ) {
            continue;
        }
        RecordCurrentLineData();
        AddTag( token );
    }

} /* ScanAsm */
Example #2
0
// -----------------------------------------------------------------------------
// SdpUtil::IsTokenCharWithOptionalSlash
// Checks if all the possible two elements divided by slash are valid tokens
// -----------------------------------------------------------------------------
//
TBool SdpUtil::IsTokenCharWithOptionalSlash(const TDesC8& aValue)
	{
	TInt lineEndPosition = aValue.Locate('/');

	if ( lineEndPosition != KErrNotFound )
		{
		TPtrC8 firstToken( aValue.Left( lineEndPosition ) );
		if( !IsTokenChar( firstToken ) ||
		    !IsTokenChar( aValue.Mid( lineEndPosition + 1 ) ) )
			{
			return EFalse;
			}
		}
	else
		{
		return IsTokenChar( aValue );
		}
	return ETrue;
	}
Example #3
0
// -----------------------------------------------------------------------------
// SdpUtil::IsTokenChar
// Checks if all the elements on the string are valid tokens
// -----------------------------------------------------------------------------
//
TBool SdpUtil::IsTokenChar(
    const TDesC8& aValue )
	{	
    TLex8 lex( aValue );
	while( !lex.Eos() )
		{
		TChar ch = lex.Get();
		lex.Inc();

		if( ch == '\r' ||ch == '\n' || ch == '\0' || !IsTokenChar( ch ) )
			{
			return EFalse;
			}
		}
	return ETrue;
	}
Example #4
0
// -----------------------------------------------------------------------------
// SdpUtil::IsTokenCharWithSpacesL
// Checks if all the elements on the string are valid tokens
// -----------------------------------------------------------------------------
//
TBool SdpUtil::IsTokenCharWithSpacesL(
    const TDesC8& aValue )
	{
	TLex8 lex( aValue );
	lex.SkipSpace();

	if( lex.Remainder().Length() == 0 )
		{
		User::Leave( KErrArgument );
		}

	while ( !lex.Eos() )
		{
		if ( !IsTokenChar( lex.NextToken() ) )
			{
			return EFalse;
			}
		lex.SkipSpace();
		}
	return ETrue;
	}