Class Library

java.lang.Object
   |
   +----Library

public class Library
extends Object
Convenience calls for using the Kernel. Each function in this class makes a system call. Sometimes, the arguments are manipulated to make their user representation more convenient.

Author:
Douglas Thain (thain@cs.wisc.edu)
See Also:
Kernel

Constructor Index

 o Library()

Method Index

 o exec(String, String[])
Perform SYSCALL_EXEC.
 o execAndWait(String, String[])
Perform SYSCALL_EXEC_AND_WAIT.
 o input()
Perform SYSCALL_INPUT.
 o output(String)
Perform SYSCALL_OUTPUT.

Constructors

 o Library
 public Library()

Methods

 o output
 public static int output(String s)
Perform SYSCALL_OUTPUT. Display text on the console.

Parameters:
s - A String to display
Returns:
Zero
 o input
 public static String input()
Perform SYSCALL_INPUT. Wait for the user to type some text and hit [return].

Returns:
A string containing input data, or null in case of end-of-file or error.
 o exec
 public static int exec(String command,
                        String args[])
Perform SYSCALL_EXEC. Launch the named program, and let it run in parallel to the current program.

Parameters:
command - The name of a Java class to execute.
args - The arguments to give the new program
Returns:
Zero, or ERROR_BAD_COMMAND.
 o execAndWait
 public static int execAndWait(String command,
                               String args[])
Perform SYSCALL_EXEC_AND_WAIT. Launch the named program, and wait for it to complete.

Parameters:
command - The name of a Java class to execute.
args - The arguments to give the new program
Returns:
Zero, ERROR_BAD_COMMAND, or ERROR_IN_CHILD.