lxcpp: Terminal preparation part 1 (host)
[platform/core/security/vasum.git] / libs / lxcpp / terminal-config.hpp
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
18 /**
19  * @file
20  * @author  Lukasz Pawelczyk (l.pawelczyk@samsumg.com)
21  * @brief   Terminal configuration
22  */
23
24 #ifndef LXCPP_TERMINAL_CONFIG_HPP
25 #define LXCPP_TERMINAL_CONFIG_HPP
26
27 #include "config/config.hpp"
28 #include "config/fields.hpp"
29
30 #include <vector>
31 #include <string>
32
33
34 namespace lxcpp {
35
36
37 struct TerminalConfig {
38     config::FileDescriptor masterFD;
39     std::string ptsName;
40
41     TerminalConfig()
42         : masterFD(-1)
43     {}
44
45     TerminalConfig(const int masterFD, const std::string &ptsName)
46         : masterFD(masterFD),
47           ptsName(ptsName)
48     {}
49
50     CONFIG_REGISTER
51     (
52         masterFD,
53         ptsName
54     )
55 };
56
57 struct TerminalsConfig {
58     int count;
59     std::vector<TerminalConfig> PTYs;
60
61     TerminalsConfig(const int count = 1)
62         : count(count)
63     {}
64
65     CONFIG_REGISTER
66     (
67         count,
68         PTYs
69     )
70 };
71
72
73 } //namespace lxcpp
74
75
76 #endif // LXCPP_TERMINAL_CONFIG_HPP