/*//////
//
// header for smsh.c package
//
*/

#ifndef _SMSH_H_
#define _SMSH_H_

#include	<stdio.h>
#include        <stdlib.h>
#include	<signal.h>
#include        <strings.h>
#include        <unistd.h>
#include        <sys/wait.h>
#include        <errno.h>
#include	"varlib.h"
#include        "splitline.h"

#define	MAXARG		20
#define	MAXCMDLEN	512
#define	DFL_PROMPT	"> "
#define	TRUE            1
#define	FALSE           0
#define	YES             1
#define	NO              0

#define	NORMAL          0
#define	NEEDTHEN        1
#define	NEEDELSE        2
#define	GOTTHEN         3
#define	GOTELSE         4
#define	NEEDFI          5

/* Error handling for fatal errors */
#define oops(errStr)  { perror(errStr); exit(1); }


/*
// stuff we'll be using
*/

void setup();
void readCmd(char *varname);
int  getKeyInput(char *buffer);
void cdCmd(char *pathname);
void fatal(char *errStr);
int  handleCommand(int argc, char *argv[]);
int  get_next_command( char *prompt, char *buffer, FILE *input_stream);
int  execute(char *argv[]);
void gracefulExit(int exitVal);

#endif /* _SMSH_ */
