ftp.nice.ch/pub/next/science/mathematics/workbench/Workbench.3.0.s.tar.gz#/Workbench/Output.m

This is Output.m in view mode; [Download] [Up]

// Output.m
// By Charles G. Fleming, Educational Computing Services, Allegheny College.
// Copyright 1993, Allegheny College.
// You may freely copy, distribute and reuse this code. 
// Allegheny College and the author disclaim any warranty of any kind, 
// expressed or implied, as to its fitness for any particular use.

#import "Output.h"

@implementation Output

- setInputText:anObject
{
	inputText = anObject;
	return self;
}
	
- transfer:sender
{
	int textLength;
	char *textBuffer;
	
	textLength = [outputText textLength];
	textBuffer = (char *)malloc(textLength + 1);
	
	[outputText getSubstring:textBuffer start:0 length:textLength+1];
	[inputText setText:textBuffer];
	[outputText setText:""];
	free(textBuffer);
    return self;
}

- (BOOL)writeDataToStream:(NXStream *)stream
{
	[outputText writeText:stream];
	return YES;
}	
@end

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.