2004-12-03 22:17:46 +03:00
|
|
|
#ifndef MC_SUBSHELL_H
|
|
|
|
#define MC_SUBSHELL_H
|
1998-02-27 07:54:42 +03:00
|
|
|
|
|
|
|
/* Used to distinguish between a normal MC termination and */
|
|
|
|
/* one caused by typing `exit' or `logout' in the subshell */
|
|
|
|
#define SUBSHELL_EXIT 128
|
|
|
|
|
|
|
|
#ifdef HAVE_SUBSHELL_SUPPORT
|
|
|
|
|
1998-04-08 01:53:41 +04:00
|
|
|
/* If using a subshell for evaluating commands this is true */
|
|
|
|
extern int use_subshell;
|
|
|
|
|
1998-02-27 07:54:42 +03:00
|
|
|
/* File descriptor of the pseudoterminal used by the subshell */
|
|
|
|
extern int subshell_pty;
|
|
|
|
|
|
|
|
/* State of the subshell; see subshell.c for an explanation */
|
|
|
|
enum subshell_state_enum {INACTIVE, ACTIVE, RUNNING_COMMAND};
|
|
|
|
extern enum subshell_state_enum subshell_state;
|
|
|
|
|
|
|
|
/* Holds the latest prompt captured from the subshell */
|
|
|
|
extern char *subshell_prompt;
|
|
|
|
|
|
|
|
/* For the `how' argument to various functions */
|
|
|
|
enum {QUIETLY, VISIBLY};
|
|
|
|
|
|
|
|
/* Exported functions */
|
|
|
|
void init_subshell (void);
|
|
|
|
int invoke_subshell (const char *command, int how, char **new_dir);
|
2002-08-15 10:53:44 +04:00
|
|
|
int read_subshell_prompt (void);
|
1998-02-27 07:54:42 +03:00
|
|
|
void resize_subshell (void);
|
|
|
|
int exit_subshell (void);
|
2001-01-21 13:27:21 +03:00
|
|
|
void do_subshell_chdir (const char *directory, int update_prompt, int reset_prompt);
|
1998-02-27 07:54:42 +03:00
|
|
|
void subshell_get_console_attributes (void);
|
|
|
|
void sigchld_handler (int sig);
|
|
|
|
|
1998-04-08 01:53:41 +04:00
|
|
|
#else
|
1998-04-08 23:37:06 +04:00
|
|
|
#define use_subshell 0
|
1998-04-08 01:53:41 +04:00
|
|
|
#endif /* not HAVE_SUBSHELL_SUPPORT */
|
|
|
|
|
2004-12-03 22:17:46 +03:00
|
|
|
#endif
|