chiark / gitweb /
serialmgrd: Support recent versions of perl
[sympathy.git] / src / tty.h
1 /* 
2  * tty.h:
3  *
4  * Copyright (c) 2008 James McKenzie <sympathy@madingley.org>,
5  * All rights reserved.
6  *
7  */
8
9 /* 
10  * $Id: tty.h,v 1.16 2008/03/10 11:49:33 james Exp $
11  */
12
13 /* 
14  * $Log: tty.h,v $
15  * Revision 1.16  2008/03/10 11:49:33  james
16  * *** empty log message ***
17  *
18  * Revision 1.15  2008/03/07 12:37:04  james
19  * *** empty log message ***
20  *
21  * Revision 1.14  2008/03/03 06:04:42  james
22  * *** empty log message ***
23  *
24  * Revision 1.13  2008/03/02 10:37:56  james
25  * *** empty log message ***
26  *
27  * Revision 1.12  2008/02/28 16:57:52  james
28  * *** empty log message ***
29  *
30  * Revision 1.11  2008/02/23 11:48:37  james
31  * *** empty log message ***
32  *
33  * Revision 1.10  2008/02/22 23:39:27  james
34  * *** empty log message ***
35  *
36  * Revision 1.9  2008/02/22 19:12:05  james
37  * *** empty log message ***
38  *
39  * Revision 1.8  2008/02/15 23:52:12  james
40  * *** empty log message ***
41  *
42  * Revision 1.7  2008/02/14 10:36:18  james
43  * *** empty log message ***
44  *
45  * Revision 1.6  2008/02/14 10:34:30  james
46  * *** empty log message ***
47  *
48  * Revision 1.5  2008/02/13 09:12:21  james
49  * *** empty log message ***
50  *
51  * Revision 1.4  2008/02/13 01:08:18  james
52  * *** empty log message ***
53  *
54  * Revision 1.3  2008/02/09 15:47:28  james
55  * *** empty log message ***
56  *
57  * Revision 1.2  2008/02/07 00:43:27  james
58  * *** empty log message ***
59  *
60  * Revision 1.1  2008/02/06 20:26:58  james
61  * *** empty log message ***
62  *
63  */
64
65 #ifndef __TTY_H__
66 #define __TTY_H__
67
68
69 #define SYM_CHAR_RESET  (-1)
70
71 #define TTY_SIGNATURE \
72         char name[1024]; \
73         int blocked; \
74         CRT_Pos size; \
75         void (*close)(struct TTY_struct *); \
76         int (*recv)(struct TTY_struct *,void *buf,int len); \
77         int (*xmit)(struct TTY_struct *,void *buf,int len); \
78         int rfd; \
79         int wfd; \
80         int hanging_up; \
81         struct timeval hangup_clock; \
82         int displayed_length;
83
84
85 #define TTY_BITFREQ_LEN 10
86
87 typedef struct {
88   int in_dle;
89   int in_errmark;
90
91   int bitfreq[TTY_BITFREQ_LEN];
92   int biterrs;
93
94   struct timeval lasterr;
95   int guessed_baud;
96 } TTY_Parser;
97
98
99 typedef struct TTY_struct {
100   TTY_SIGNATURE;
101 } TTY;
102
103 typedef struct {
104   int lines;
105   int blocked;
106   struct termios termios;
107   int baud;
108 } TTY_Status;
109
110 #endif /* __TTY_H__ */