ftp.nice.ch/pub/next/tools/archiver/JumpBack.4.s.tar.gz#/JumpBack_4/Subprocess.h

This is Subprocess.h in view mode; [Download] [Up]

/*
	Subprocess.h	(v10)
	by Charles L. Oei
	pty support by Joe Freeman
	with encouragement from Kristofer Younger
	Subprocess Example, Release 2.0
	NeXT Computer, Inc.
*/

#import <objc/Object.h>
#import <stdio.h>

/*
    This subprocess object sends/receives data to/from any UNIX
    subprocess asynchronously (via vfork/pipe).
    Its delegate, if any, will receive the following messages:

	- subprocessDone;
	    // sent when the subprocess exits
    
	- subprocessOutput:(char *)buffer;
	    // sent whenever there is data on the standard output pipe;
	    // buffer is only valid until next call
	
	- subprocessError:(const char *)errorString;
	    // sent when an error occurs;
	    // if it ever happens, it's usually only at startup time
*/

@interface Subprocess:Object
{
    FILE *fpToChild;
    int fromChild;
    int childPid;
    id delegate;
}

+ new:(const char *)subprocessString;
    // a cover for the below withDelegate:nil, andPtySupport:NO, andStdErr:YES

+ new:(const char *)subprocessString
    withDelegate:theDelegate
    andPtySupport:(BOOL)wantsPty
    andStdErr:(BOOL)wantsStdErr;
    // optional requests for pseudo terminal support and
    // redirecting the standard error stream thru standard output

- send:(const char *)string withNewline:(BOOL)wantNewline;
    // send the string optionally followed by a new line
- send:(const char *)string;
    // sends the string followed by a new line
    // shorthand for above withNewline:YES
- terminateInput;
    // sends an end-of-file (EOF) to the subprocess
    // (and closes input pipe to child)
- terminate:sender;
    // forces the subprocess to terminate (w/ SIGTERM)

- setDelegate:anObject;
- delegate;

@end

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