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