1998-01-19 15:20:15 +00:00
|
|
|
/* Interface for NSTask for GNUstep
|
|
|
|
Copyright (C) 1998 Free Software Foundation, Inc.
|
|
|
|
|
|
|
|
Written by: Richard Frith-Macdonald <richard@brainstorm.co.uk>
|
|
|
|
Date: 1998
|
|
|
|
|
|
|
|
This file is part of the GNUstep Base Library.
|
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU Library General Public
|
|
|
|
License as published by the Free Software Foundation; either
|
|
|
|
version 2 of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
This library is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
Library General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Library General Public
|
|
|
|
License along with this library; if not, write to the Free
|
|
|
|
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __NSTask_h_GNUSTEP_BASE_INCLUDE
|
|
|
|
#define __NSTask_h_GNUSTEP_BASE_INCLUDE
|
|
|
|
|
1998-12-20 21:27:47 +00:00
|
|
|
#include <base/preface.h>
|
1998-01-19 15:20:15 +00:00
|
|
|
#include <Foundation/NSObject.h>
|
|
|
|
#include <Foundation/NSString.h>
|
|
|
|
#include <Foundation/NSArray.h>
|
|
|
|
#include <Foundation/NSDictionary.h>
|
|
|
|
#include <Foundation/NSFileHandle.h>
|
|
|
|
|
|
|
|
@interface NSTask : NSObject
|
|
|
|
{
|
1998-12-16 20:32:59 +00:00
|
|
|
NSString *currentDirectoryPath;
|
|
|
|
NSString *launchPath;
|
|
|
|
NSArray *arguments;
|
|
|
|
NSDictionary *environment;
|
|
|
|
id standardError;
|
|
|
|
id standardInput;
|
|
|
|
id standardOutput;
|
|
|
|
int taskId;
|
|
|
|
int terminationStatus;
|
|
|
|
BOOL hasLaunched;
|
|
|
|
BOOL hasTerminated;
|
|
|
|
BOOL hasCollected;
|
|
|
|
BOOL hasNotified;
|
1998-01-19 15:20:15 +00:00
|
|
|
}
|
|
|
|
|
1998-12-16 20:32:59 +00:00
|
|
|
+ (NSTask*) launchedTaskWithLaunchPath: (NSString*)path
|
|
|
|
arguments: (NSArray*)args;
|
1998-01-19 15:20:15 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Querying task parameters.
|
|
|
|
*/
|
|
|
|
- (NSArray*) arguments;
|
|
|
|
- (NSString*) currentDirectoryPath;
|
|
|
|
- (NSDictionary*) environment;
|
|
|
|
- (NSString*) launchPath;
|
1998-12-16 20:32:59 +00:00
|
|
|
- (id) standardError;
|
|
|
|
- (id) standardInput;
|
|
|
|
- (id) standardOutput;
|
1998-01-19 15:20:15 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Setting task parameters.
|
|
|
|
*/
|
1998-12-16 20:32:59 +00:00
|
|
|
- (void) setArguments: (NSArray*)args;
|
|
|
|
- (void) setCurrentDirectoryPath: (NSString*)path;
|
|
|
|
- (void) setEnvironment: (NSDictionary*)env;
|
|
|
|
- (void) setLaunchPath: (NSString*)path;
|
|
|
|
- (void) setStandardError: (id)hdl;
|
|
|
|
- (void) setStandardInput: (id)hdl;
|
|
|
|
- (void) setStandardOutput: (id)hdl;
|
1998-01-19 15:20:15 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Obtaining task state
|
|
|
|
*/
|
|
|
|
- (BOOL) isRunning;
|
|
|
|
- (int) terminationStatus;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Handling a task.
|
|
|
|
*/
|
|
|
|
- (void) interrupt;
|
|
|
|
- (void) launch;
|
|
|
|
- (void) terminate;
|
|
|
|
- (void) waitUntilExit;
|
|
|
|
@end
|
|
|
|
|
|
|
|
extern NSString* NSTaskDidTerminateNotification;
|
|
|
|
|
|
|
|
#endif /* __NSTask_h_GNUSTEP_BASE_INCLUDE */
|