/* * 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 */
// ----------------------------------------------------------------------------- // 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; }
// ----------------------------------------------------------------------------- // 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; }
// ----------------------------------------------------------------------------- // 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; }