1 // license:BSD-3-Clause
2 // copyright-holders:F.Ulivi
3 /***************************************************************************
4 
5     dipty.h
6 
7     Device PTY interface
8 
9 ***************************************************************************/
10 
11 #ifndef MAME_EMU_DIPTY_H
12 #define MAME_EMU_DIPTY_H
13 
14 class device_pty_interface : public device_interface
15 {
16 public:
17 	// construction/destruction
18 	device_pty_interface(const machine_config &mconfig, device_t &device);
19 	virtual ~device_pty_interface();
20 
21 	bool open();
22 	void close();
23 
24 	bool is_open() const;
25 
26 	ssize_t read(u8 *rx_chars , size_t count) const;
27 	void write(u8 tx_char) const;
28 
29 	bool is_slave_connected() const;
30 
31 	const char *slave_name() const;
32 
33 protected:
34 	osd_file::ptr m_pty_master;
35 	std::string m_slave_name;
36 	bool m_opened;
37 };
38 
39 // iterator
40 typedef device_interface_iterator<device_pty_interface> pty_interface_iterator;
41 
42 #endif // MAME_EMU_DIPTY_H
43