spandsp 3.0.0
pseudo_terminals.h
1/*
2 * SpanDSP - a series of DSP components for telephony
3 *
4 * pseudo_terminals.h - pseudo terminal handling.
5 *
6 * Written by Steve Underwood <steveu@coppice.org>
7 *
8 * Copyright (C) 2012 Steve Underwood
9 *
10 * All rights reserved.
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License version 2, as
14 * published by the Free Software Foundation.
15 *
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 */
25
26#if !defined(_SPANDSP_PSEUDO_TERMINALS_H_)
27#define _SPANDSP_PSEUDO_TERMINALS_H_
28
29#if !defined(HAVE_POSIX_OPENPT) && !defined(HAVE_DEV_PTMX) && !defined(WIN32)
30#define USE_OPENPTY 1
31#endif
32
34{
35 int slot;
36 int master_fd;
37 int slave_fd;
38 const char *stty;
39 char *devlink;
40 int block_read;
41 int block_write;
42 bool dtr;
43 struct termios termios;
44 logging_state_t logging;
45};
46
47typedef struct pseudo_terminal_state_s pseudo_terminal_state_t;
48
49extern const char *pseudo_terminal_device_root_name;
50
51
52#if defined(__cplusplus)
53extern "C"
54{
55#endif
56
57SPAN_DECLARE(logging_state_t *) pseudo_terminal_get_logging_state(pseudo_terminal_state_t *s);
58
59SPAN_DECLARE(int) pseudo_terminal_check_termios(pseudo_terminal_state_t *pty);
60
61SPAN_DECLARE(int) pseudo_terminal_release(pseudo_terminal_state_t *s);
62
63SPAN_DECLARE(int) pseudo_terminal_free(pseudo_terminal_state_t *s);
64
65SPAN_DECLARE(int) pseudo_terminal_restart(pseudo_terminal_state_t *s);
66
67SPAN_DECLARE(pseudo_terminal_state_t *) pseudo_terminal_init(pseudo_terminal_state_t *s);
68
69#if defined(__cplusplus)
70}
71#endif
72
73#endif
74/*- End of file ------------------------------------------------------------*/
struct logging_state_s logging_state_t
Definition logging.h:72
Definition pseudo_terminals.h:34