Skip to content
shell.h 903 B
Newer Older
Seblu's avatar
Seblu committed
/*
** shell.h for 42sh in /home/seblu/devel/c/42sh
**
** Made by Seblu
** Login   <seblu@epita.fr>
**
** Started on  Sun Jul 16 20:03:53 2006 Seblu
** Last update Fri Aug 25 07:45:07 2006 Seblu
Seblu's avatar
Seblu committed
*/

#ifndef SHELL_H_
# define SHELL_H_

# include <errno.h>
# include <stdlib.h>
# include "../common/constant.h"
Seblu's avatar
Seblu committed
# include "../alias/alias.h"
# include "../option/option.h"
Seblu's avatar
Seblu committed

Seblu's avatar
Seblu committed
typedef struct s_shell
Seblu's avatar
Seblu committed
{
Seblu's avatar
Seblu committed
/*   struct s_var		*vars; */
/*   struct s_func		*funcs; */
/*   struct s_history		*history; */
Seblu's avatar
Seblu committed
  ts_aliases		*aliases;
  ts_options		*options;
Seblu's avatar
Seblu committed
  char			*name;
  int			status;
Seblu's avatar
Seblu committed
} ts_shell;

Seblu's avatar
Seblu committed
ts_shell		*shell_init(const char *argv0);
Seblu's avatar
Seblu committed
void			shell_destroy(ts_shell *sh);
Seblu's avatar
Seblu committed

const char		*get_prompt(te_prompt pty);

/*!
** Show a prompt on stderr is current shell is a plug on a tty
**
** @param pty prompt type (PS1, PS2, PS4)
*/
void			show_prompt(te_prompt pty);
Seblu's avatar
Seblu committed

Seblu's avatar
Seblu committed
extern ts_shell		*shell;
Seblu's avatar
Seblu committed

#endif /* !SHELL_H_ */