2009-02-05 21:28:18 +03:00
|
|
|
/** \file subshell.h
|
|
|
|
* \brief Header: concurrent shell support
|
|
|
|
*/
|
|
|
|
|
2010-11-10 14:09:42 +03:00
|
|
|
#ifndef MC__SUBSHELL_H
|
|
|
|
#define MC__SUBSHELL_H
|
|
|
|
|
|
|
|
/*** typedefs(not structures) and defined constants **********************************************/
|
1998-02-27 07:54:42 +03:00
|
|
|
|
2010-11-10 14:09:42 +03:00
|
|
|
/*** enums ***************************************************************************************/
|
|
|
|
|
|
|
|
/* State of the subshell; see subshell.c for an explanation */
|
|
|
|
|
|
|
|
enum subshell_state_enum
|
2010-11-22 14:45:18 +03:00
|
|
|
{
|
|
|
|
INACTIVE,
|
|
|
|
ACTIVE,
|
|
|
|
RUNNING_COMMAND
|
|
|
|
};
|
2010-11-10 14:09:42 +03:00
|
|
|
|
2013-05-26 10:11:06 +04:00
|
|
|
/* For the 'how' argument to various functions */
|
2010-11-10 14:09:42 +03:00
|
|
|
enum
|
2010-11-22 14:45:18 +03:00
|
|
|
{
|
|
|
|
QUIETLY,
|
|
|
|
VISIBLY
|
|
|
|
};
|
2010-11-10 14:09:42 +03:00
|
|
|
|
|
|
|
/*** structures declarations (and typedefs of structures)*****************************************/
|
|
|
|
|
|
|
|
/*** global variables defined in .c file *********************************************************/
|
|
|
|
|
1998-02-27 07:54:42 +03:00
|
|
|
extern enum subshell_state_enum subshell_state;
|
|
|
|
|
|
|
|
/* Holds the latest prompt captured from the subshell */
|
2013-01-01 19:53:11 +04:00
|
|
|
extern GString *subshell_prompt;
|
1998-02-27 07:54:42 +03:00
|
|
|
|
2010-11-22 14:45:18 +03:00
|
|
|
extern gboolean update_subshell_prompt;
|
|
|
|
|
2010-11-10 14:09:42 +03:00
|
|
|
/*** declarations of public functions ************************************************************/
|
1998-02-27 07:54:42 +03:00
|
|
|
|
|
|
|
void init_subshell (void);
|
2011-11-26 16:46:54 +04:00
|
|
|
int invoke_subshell (const char *command, int how, vfs_path_t ** new_dir);
|
2013-01-01 19:41:14 +04:00
|
|
|
gboolean read_subshell_prompt (void);
|
2010-11-22 14:45:18 +03:00
|
|
|
void do_update_prompt (void);
|
2012-10-29 16:38:28 +04:00
|
|
|
gboolean exit_subshell (void);
|
2013-04-11 10:34:40 +04:00
|
|
|
void do_subshell_chdir (const vfs_path_t * vpath, gboolean update_prompt);
|
1998-02-27 07:54:42 +03:00
|
|
|
void subshell_get_console_attributes (void);
|
|
|
|
void sigchld_handler (int sig);
|
|
|
|
|
2010-11-10 14:09:42 +03:00
|
|
|
/*** inline functions ****************************************************************************/
|
2010-11-22 14:45:18 +03:00
|
|
|
|
2010-11-10 14:09:42 +03:00
|
|
|
#endif /* MC__SUBSHELL_H */
|