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 
48 
49 extern const char *pseudo_terminal_device_root_name;
50 
51 
52 #if defined(__cplusplus)
53 extern "C"
54 {
55 #endif
56 
57 SPAN_DECLARE(logging_state_t *) pseudo_terminal_get_logging_state(pseudo_terminal_state_t *s);
58 
59 SPAN_DECLARE(int) pseudo_terminal_check_termios(pseudo_terminal_state_t *pty);
60 
61 SPAN_DECLARE(int) pseudo_terminal_release(pseudo_terminal_state_t *s);
62 
63 SPAN_DECLARE(int) pseudo_terminal_free(pseudo_terminal_state_t *s);
64 
65 SPAN_DECLARE(int) pseudo_terminal_restart(pseudo_terminal_state_t *s);
66 
67 SPAN_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 ------------------------------------------------------------*/
Definition: private/logging.h:33
Definition: pseudo_terminals.h:33