1 /* Yash: yet another shell */
2 /* redir.h: manages file descriptors and provides functions for redirections */
3 /* (C) 2007-2008 magicant */
5 /* This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>. */
25 extern int xclose(int fd);
26 extern int xdup2(int oldfd, int newfd);
28 extern void init_shellfds(void);
29 extern void clear_shellfds(bool leavefds);
30 extern int copy_as_shellfd(int fd);
31 extern FILE *reopen_with_shellfd(FILE *f, const char *mode);
32 extern void open_ttyfd(void);
33 extern int get_ttyfd(void) __attribute__((pure));
35 typedef struct savefd_T savefd_T;
38 extern bool open_redirections(const struct redir_T *r, struct savefd_T **save);
39 extern void undo_redirections(savefd_T *save);
40 extern void clear_savefd(savefd_T *save);
41 extern void maybe_redirect_stdin_to_devnull(void);
47 /* vim: set ts=8 sts=4 sw=4 noet: */