/*
  Shell.h, Copyright  (c) by George Fankhauser,
  Swiss Federal Institute of Technology,
  Computer Engineering and Networks Laboratory.
 
  TOPSY -- A Teachable Operating System.
         Implementation of a tiny and simple
         micro kernel for teaching purposes.
 
  For further information, please visit http://www.tik.ee.ethz.ch/~topsy
 
  This software is provided under the terms of the GNU General Public Licence.
 
  A full copy of the GNU GPL is provided in the file COPYING found in the 
  development root of Topsy.
*/
/*
	File:                  $Source: /home/ruf/cvs_Topsy/cvs/Topsy/User/Shell.h,v $
 	Author(s):             George Fankhauser
 	Affiliation:           ETH Zuerich, TIK
 	Version:               $Revision: 2924 $
 	Creation Date:         
 	Last Date of Change:   $Date: 2007-03-19 18:35:40 +0100 (Mon, 19 Mär 2007) $      by: $Author: baderma $
*/
#ifndef __SHELL_H__
#define __SHELL_H__

#include "Topsy.h"
#include "Syscall.h"

typedef struct ShellFunction_t
{
  char* name;
  ThreadMainFunction function;
  ThreadArg arg;
}
ShellFunction;


#define SHELL_INVALID	0
#define SHELL_START	1
#define SHELL_EXIT	2
#define SHELL_KILL	3
#define SHELL_INFO	4
#define SHELL_HELP	5
#define SHELL_PS	6
#define SHELL_NULL	7

#define BACKGRCOMMAND       '&'

char* commandNames[] = {
                         "invalid command\n",
                         "start", "exit", "kill", "info", "help", "ps", "\n"
                       };

void shell(ThreadArg arg);

#define WELCOME "\nTopsy Shell 3.0 (c) 1998, ETH Zurich, TIK\n($Id: Shell.h 2924 2007-03-19 17:35:40Z baderma $)\nType 'start licence' to print the licence terms governing your use of this product.\n\n"
#define EXITMESSAGE "exiting shell...\n"
#define PROMPT "> "
#define HELP "\
    start <function> <arg>   start a new thread\n\
    exit                     leave this shell  \n\
    kill <id>                kill a thread     \n\
    ps                       print thread status\n\
    help                     show this helptext\n"

#endif

