chiark / gitweb /
Change James's email address
[sympathy.git] / src / ansi.h
1 /* 
2  * ansi.h:
3  *
4  * Copyright (c) 2008 James McKenzie <sympathy@madingley.org>,
5  * All rights reserved.
6  *
7  */
8
9 /* 
10  * $Id: ansi.h,v 1.20 2008/03/10 11:49:32 james Exp $
11  */
12
13 /* 
14  * $Log: ansi.h,v $
15  * Revision 1.20  2008/03/10 11:49:32  james
16  * *** empty log message ***
17  *
18  * Revision 1.19  2008/03/07 12:37:04  james
19  * *** empty log message ***
20  *
21  * Revision 1.18  2008/03/06 21:34:09  james
22  * *** empty log message ***
23  *
24  * Revision 1.17  2008/03/06 21:33:02  james
25  * *** empty log message ***
26  *
27  * Revision 1.16  2008/03/06 16:49:05  james
28  * *** empty log message ***
29  *
30  * Revision 1.15  2008/03/03 06:04:42  james
31  * *** empty log message ***
32  *
33  * Revision 1.14  2008/03/02 10:37:56  james
34  * *** empty log message ***
35  *
36  * Revision 1.13  2008/02/24 00:42:53  james
37  * *** empty log message ***
38  *
39  * Revision 1.12  2008/02/23 11:48:37  james
40  * *** empty log message ***
41  *
42  * Revision 1.11  2008/02/20 20:16:07  james
43  * *** empty log message ***
44  *
45  * Revision 1.10  2008/02/20 19:44:37  james
46  * @@
47  *
48  * Revision 1.9  2008/02/20 19:36:06  james
49  * @@
50  *
51  * Revision 1.8  2008/02/20 19:25:09  james
52  * *** empty log message ***
53  *
54  * Revision 1.7  2008/02/13 16:57:29  james
55  * *** empty log message ***
56  *
57  * Revision 1.6  2008/02/13 01:08:18  james
58  * *** empty log message ***
59  *
60  * Revision 1.5  2008/02/07 12:16:04  james
61  * *** empty log message ***
62  *
63  * Revision 1.4  2008/02/07 00:43:27  james
64  * *** empty log message ***
65  *
66  * Revision 1.3  2008/02/07 00:39:13  james
67  * *** empty log message ***
68  *
69  * Revision 1.2  2008/02/06 11:30:37  james
70  * *** empty log message ***
71  *
72  * Revision 1.1  2008/02/03 23:31:25  james
73  * *** empty log message ***
74  *
75  */
76
77 #ifndef __ANSI_H__
78 #define __ANSI_H__
79
80 #define ANSI_INVAL -1
81
82 #define ANSI_ESCAPE_BUF_LEN 10
83 #define ANSI_ESCAPE_TIMEOUT     100000 /* in ms */
84
85 typedef struct {
86   int in_escape;
87   struct timeval last_escape;
88   char escape_buf[ANSI_ESCAPE_BUF_LEN];
89   int escape_ptr;
90 } ANSI_Parser;
91
92 struct CRT_struct;
93 struct Context_struct;
94
95 typedef struct ANSI_struct {
96   ANSI_Parser parser;
97
98   TTY *terminal;
99   int eof;
100
101
102   CRT crt;
103   CRT_Pos pos;
104   CRT_Pos size;
105   int hide_cursor;
106   int attr;
107   int color;
108
109   int utf8;
110
111   int history_ptr;
112   FILE *file;
113
114   int (*dispatch) (struct ANSI_struct *, struct Context_struct *);
115   int (*update) (struct ANSI_struct *, struct Context_struct *);
116   int (*one_shot) (struct ANSI_struct *, struct CRT_struct *);
117   int (*reset) (struct ANSI_struct *, struct CRT_struct *);
118   int (*set_title) (struct ANSI_struct *, char *);
119   void (*terminal_reset) (struct ANSI_struct *);
120   void (*close) (struct ANSI_struct *);
121 } ANSI;
122
123
124 #endif /* __ANSI_H__ */