Beispiel #1
0
void GetPrototype(FILE* Handle, funcdef* Function) {
	char Line[MAX_STRING];
	int i;
	fseek(Handle, 0L, SEEK_SET);
	while(!feof(Handle)) {
		fgets(Line, MAX_STRING, Handle);
		if(InString(Line, Function->Name)) {
			for(i=strlen(Line)-1; i>=0; i--) {
				if(Line[i]==';') {
					Line[i]='\0';
					strcpy(Function->Prototype, Line);
					return;
				}
			}
		}
	}
	fprintf(stderr, "Prototype not found for function '%s'\n", Function->Name);
} 
Beispiel #2
0
void    DoFreeIn( void ) {
//==================

    ftnfile     *fcb;
    char        ch;

    fcb = IOCB->fileinfo;
    FreeIOType();
    while( IOCB->typ != PT_NOTYPE ) {
        CheckEor();
        Blanks();
        RptNum();
        if( fcb->col >= fcb->len ) {
            while( IOCB->rptnum-- > 0 ) {
                FreeIOType();
                if( IOCB->typ == PT_NOTYPE ) break;
            }
        } else {
            ch = fcb->buffer[ fcb->col ];
            if( ch == '/' ) break;
            switch( ch ) {
            case ',':
            case ' ':
                for(;;) {
                    FreeIOType();
                    if( IOCB->typ == PT_NOTYPE ) break;
                    if( IOCB->rptnum-- <= 1 ) break;
                }
                fcb->col++;
                break;
            case '\'':
                InString();
                BumpComma();
                break;
            case '(':
                InCplx();
                BumpComma();
                break;
            case 't':
            case 'T':
            case 'f':
            case 'F':
                InLog();
                BumpComma();
                break;
            case '-':
            case '+':
            case '0':
            case '1':
            case '2':
            case '3':
            case '4':
            case '5':
            case '6':
            case '7':
            case '8':
            case '9':
                InNumber();
                BumpComma();
                break;
            case '.':
                ch = toupper( fcb->buffer[ fcb->col + 1 ] );
                if( ( ch != 'T' ) && ( ch != 'F' ) ) {
                    InNumber();
                } else {
                    fcb->col++;
                    InLog();
                }
                BumpComma();
                break;
            default:
                FreeIOErr( IO_BAD_CHAR );
                break;
            }
        }
    }
}
void FMarginStructCustomization::OnMarginTextCommitted( const FText& InText, ETextCommit::Type InCommitType )
{
	FString InString( InText.ToString() );

	bool bError = false;

	if( InCommitType != ETextCommit::OnCleared )
	{
		TArray<float> PropertyValues;

		while( InString.Len() > 0 && !bError )
		{
			FString LeftString;
			const bool bSuccess = InString.Split( TEXT( "," ), &LeftString, &InString );

			if( !InString.IsEmpty() && ((bSuccess && !LeftString.IsEmpty()) || !bSuccess) )
			{
				if( !bSuccess )
				{
					LeftString = InString;
					InString.Empty();
				}

				LeftString = LeftString.Trim().TrimTrailing();

				if( LeftString.IsNumeric() )
				{
					float Value;
					TTypeFromString<float>::FromString( Value, *LeftString );
					PropertyValues.Add( bIsMarginUsingUVSpace ? FMath::Clamp( Value, 0.0f, 1.0f ) : FMath::Max( Value, 0.0f ) );
				}
				else
				{
					bError = true;
				}
			}
			else
			{
				bError = true;
			}
		}

		
		if( !bError )
		{

			FMargin NewMargin;
			// Update the property values
			if( PropertyValues.Num() == 1 )
			{
				// Uniform margin
				NewMargin = FMargin( PropertyValues[0] );
			}
			else if( PropertyValues.Num() == 2 )
			{
				// Uniform on the two axes
				NewMargin = FMargin( PropertyValues[0], PropertyValues[1] );
			}
			else if( PropertyValues.Num() == 4 )
			{
				NewMargin.Left = PropertyValues[0];
				NewMargin.Top = PropertyValues[1];
				NewMargin.Right = PropertyValues[2];
				NewMargin.Bottom = PropertyValues[3];
			}
			else
			{
				bError = true;
			}


			if( !bError )
			{
				if (bIsMarginUsingUVSpace)
				{
					if (NewMargin.Left + NewMargin.Right > 1.0f)
					{
						NewMargin.Left = 1.0f - NewMargin.Right;
					}

					if (NewMargin.Top + NewMargin.Bottom > 1.0f)
					{
						NewMargin.Top = 1.0f - NewMargin.Bottom;
					}
				}

				TArray<void*> RawData;
				StructPropertyHandle->AccessRawData( RawData );

				{
					FScopedTransaction Transaction( FText::Format( NSLOCTEXT("FMarginStructCustomization", "SetMarginProperty", "Edit {0}"), FText::FromString( StructPropertyHandle->GetPropertyDisplayName() ) ) );
					StructPropertyHandle->NotifyPreChange();

					for (void* Data : RawData)
					{
						*(FMargin*)Data = NewMargin;
					}

					StructPropertyHandle->NotifyPostChange();
				}

				MarginEditableTextBox->SetError( FString() );
			}
		}

		if( bError )
		{
			MarginEditableTextBox->SetError( NSLOCTEXT( "UnrealEd", "InvalidMarginText", "Valid Margin formats are:\nUniform Margin; eg. 0.5\nHorizontal / Vertical Margins; eg. 2, 3\nLeft / Top / Right / Bottom Margins; eg. 0.2, 1, 1.5, 3" ) );
		}
	}
}