Partially revert "VFS: (vfs_s_subclass): make the derived class from vfs_class."
[midnight-commander.git] / src / subshell / proxyfunc.c
bloba8151936166ac9c236d5f79281fa8f5a41606731
1 /*
2 Proxy functions for getting access to public variables into 'filemanager' module.
4 Copyright (C) 2015-2018
5 Free Software Foundation, Inc.
7 Written by:
8 Slava Zanko <slavazanko@gmail.com>, 2015.
10 This file is part of the Midnight Commander.
12 The Midnight Commander is free software: you can redistribute it
13 and/or modify it under the terms of the GNU General Public License as
14 published by the Free Software Foundation, either version 3 of the License,
15 or (at your option) any later version.
17 The Midnight Commander is distributed in the hope that it will be useful,
18 but WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 GNU General Public License for more details.
22 You should have received a copy of the GNU General Public License
23 along with this program. If not, see <http://www.gnu.org/licenses/>.
26 #include <config.h>
27 #include <sys/wait.h>
29 #include "lib/global.h"
30 #include "lib/widget.h"
32 #include "src/setup.h" /* quit */
33 #include "src/filemanager/midnight.h" /* current_panel */
34 #include "src/consaver/cons.saver.h" /* handle_console() */
36 #include "internal.h"
38 /*** global variables ****************************************************************************/
40 /* path to X clipboard utility */
42 /*** file scope macro definitions ****************************************************************/
44 /*** file scope type declarations ****************************************************************/
46 /*** file scope variables ************************************************************************/
48 /* --------------------------------------------------------------------------------------------- */
49 /*** file scope functions ************************************************************************/
50 /* --------------------------------------------------------------------------------------------- */
52 /* --------------------------------------------------------------------------------------------- */
53 /*** public functions ****************************************************************************/
54 /* --------------------------------------------------------------------------------------------- */
56 const vfs_path_t *
57 subshell_get_cwd_from_current_panel (void)
59 return current_panel->cwd_vpath;
62 /* --------------------------------------------------------------------------------------------- */
64 void
65 subshell_handle_cons_saver (void)
67 #ifdef __linux__
68 int status;
69 pid_t pid;
71 pid = waitpid (cons_saver_pid, &status, WUNTRACED | WNOHANG);
72 waitpid (cons_saver_pid, &status, WUNTRACED | WNOHANG);
74 if (pid == cons_saver_pid)
77 if (WIFSTOPPED (status))
78 /* Someone has stopped cons.saver - restart it */
79 kill (pid, SIGCONT);
80 else
82 /* cons.saver has died - disable console saving */
83 handle_console (CONSOLE_DONE);
84 mc_global.tty.console_flag = '\0';
88 #endif /* __linux__ */
91 /* --------------------------------------------------------------------------------------------- */
93 int
94 subshell_get_mainloop_quit (void)
96 return quit;
99 /* --------------------------------------------------------------------------------------------- */
101 void
102 subshell_set_mainloop_quit (const int param_quit)
104 quit = param_quit;
107 /* --------------------------------------------------------------------------------------------- */