Fork Vasum on GitHub Official Vasum Wiki on Tizen.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
terminal.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2015 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License version 2.1 as published by the Free Software Foundation.
7  *
8  * This library is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11  * Lesser General Public License for more details.
12  *
13  * You should have received a copy of the GNU Lesser General Public
14  * License along with this library; if not, write to the Free Software
15  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16  */
17 
24 #ifndef LXCPP_TERMINAL_HPP
25 #define LXCPP_TERMINAL_HPP
26 
27 #include <termios.h>
28 
29 
30 namespace lxcpp {
31 
32 
42 int nullStdFDs();
43 
47 bool isatty(int fd);
48 
52 void tcgetattr(const int fd, struct termios *termios_p);
53 
57 void tcsetattr(const int fd, const int optional_actions, const struct termios *termios_p);
58 
62 void setupIOControlTTY(const int ttyFD);
63 
74 std::pair<int, std::string> openPty(bool rawMode);
75 
76 
77 } // namespace lxcpp
78 
79 
80 #endif // LXCPP_TERMINAL_HPP
void setupIOControlTTY(const int ttyFD)
Setups the passed fd as a new control and IO (in, out, err) terminal.
Definition: terminal.cpp:138
void tcgetattr(const int fd, struct termios *termios_p)
Get terminal attributes.
Definition: terminal.cpp:120
void tcsetattr(const int fd, const int optional_actions, const struct termios *termios_p)
Set terminal attributes.
Definition: terminal.cpp:129
int nullStdFDs()
Nullifies all standard file descriptors (stdin, stdout, stderr) replacing them with file descriptor t...
Definition: terminal.cpp:72
std::pair< int, std::string > openPty(bool rawMode)
This function creates a new pair of virtual character devices using a pseudtoreminal interface...
Definition: terminal.cpp:154
bool isatty(int fd)
Checks if a file descriptor is a terminal.
Definition: terminal.cpp:105