chiark / gitweb /
Install serialmgr and run_sympathy in examples directory (uncompressed)
[sympathy.git] / src / ipc.h
1 /* 
2  * ipc.h:
3  *
4  * Copyright (c) 2008 James McKenzie <sympathy@madingley.org>,
5  * All rights reserved.
6  *
7  */
8
9 /* 
10  * $Id: ipc.h,v 1.12 2008/03/10 11:49:33 james Exp $
11  */
12
13 /* 
14  * $Log: ipc.h,v $
15  * Revision 1.12  2008/03/10 11:49:33  james
16  * *** empty log message ***
17  *
18  * Revision 1.11  2008/03/07 14:13:40  james
19  * *** empty log message ***
20  *
21  * Revision 1.10  2008/03/07 13:16:02  james
22  * *** empty log message ***
23  *
24  * Revision 1.9  2008/03/07 12:37:04  james
25  * *** empty log message ***
26  *
27  * Revision 1.8  2008/03/03 06:04:42  james
28  * *** empty log message ***
29  *
30  * Revision 1.7  2008/03/02 10:37:56  james
31  * *** empty log message ***
32  *
33  * Revision 1.6  2008/02/28 11:27:48  james
34  * *** empty log message ***
35  *
36  * Revision 1.5  2008/02/23 11:48:37  james
37  * *** empty log message ***
38  *
39  * Revision 1.4  2008/02/22 17:07:00  james
40  * *** empty log message ***
41  *
42  * Revision 1.3  2008/02/15 23:52:12  james
43  * *** empty log message ***
44  *
45  * Revision 1.2  2008/02/15 03:32:07  james
46  * *** empty log message ***
47  *
48  * Revision 1.1  2008/02/14 12:17:42  james
49  * *** empty log message ***
50  *
51  */
52
53 #ifndef __IPC_H__
54 #define __IPC_H__
55
56 #define IPC_MAX_BUF 1024
57
58 #define IPC_MSG_TYPE_NOOP  0
59 #define IPC_MSG_TYPE_DEBUG 1
60 #define IPC_MSG_TYPE_INITIALIZE 2
61 #define IPC_MSG_TYPE_VT102 3
62 #define IPC_MSG_TYPE_HISTORY 4
63 #define IPC_MSG_TYPE_KEY 5
64 #define IPC_MSG_TYPE_TERM 6
65 #define IPC_MSG_TYPE_STATUS 7
66 #define IPC_MSG_TYPE_SETBAUD 8
67 #define IPC_MSG_TYPE_SENDBREAK 9
68 #define IPC_MSG_TYPE_SETFLOW 10
69 #define IPC_MSG_TYPE_SETANSI 11
70 #define IPC_MSG_TYPE_HANGUP 12
71 #define IPC_MSG_TYPE_SETSIZE 13
72 #define IPC_MSG_TYPE_RESET 14
73 #define IPC_MSG_TYPE_KILLME 15
74
75 typedef struct {
76   int32_t size;
77   int32_t type;
78   uint8_t payload[0];
79 } IPC_Msg_hdr;
80
81
82 typedef struct {
83   int32_t size;
84   int32_t type;
85 } IPC_Msg_noop;
86
87
88 typedef struct {
89   int32_t size;
90   int32_t type;
91   char msg[0];
92 } IPC_Msg_debug;
93
94 typedef struct {
95   int32_t size;
96   int32_t type;
97   char msg[0];
98 } IPC_Msg_initialize;
99
100 typedef struct {
101   int32_t size;
102   int32_t type;
103   History_ent history;
104 } IPC_Msg_history;
105
106 typedef struct {
107   int32_t size;
108   int32_t type;
109   int32_t len;
110   VT102 vt102;
111 } IPC_Msg_VT102;
112
113
114 typedef struct {
115   int32_t size;
116   int32_t type;
117   int32_t key;
118 } IPC_Msg_key;
119
120 typedef struct {
121   int32_t size;
122   int32_t type;
123   int32_t len;
124   uint8_t term[0];
125 } IPC_Msg_term;
126
127
128 typedef struct {
129   int32_t size;
130   int32_t type;
131   char status[0];
132 } IPC_Msg_status;
133
134 typedef struct {
135   int32_t size;
136   int32_t type;
137   int32_t baud;
138 } IPC_Msg_setbaud;
139
140
141 typedef struct {
142   int32_t size;
143   int32_t type;
144 } IPC_Msg_sendbreak;
145
146
147 typedef struct {
148   int32_t size;
149   int32_t type;
150   int32_t flow;
151 } IPC_Msg_setflow;
152
153
154 typedef struct {
155   int32_t size;
156   int32_t type;
157   int32_t ansi;
158 } IPC_Msg_setansi;
159
160
161 typedef struct {
162   int32_t size;
163   int32_t type;
164 } IPC_Msg_hangup;
165
166
167 typedef struct {
168   int32_t size;
169   int32_t type;
170   CRT_Pos winsize;
171 } IPC_Msg_setsize;
172
173
174 typedef struct {
175   int32_t size;
176   int32_t type;
177 } IPC_Msg_reset;
178
179
180 typedef struct {
181   int32_t size;
182   int32_t type;
183 } IPC_Msg_killme;
184
185
186
187 typedef union {
188   IPC_Msg_hdr hdr;
189   IPC_Msg_noop noop;
190   IPC_Msg_debug debug;
191   IPC_Msg_initialize initialize;
192   IPC_Msg_history history;
193   IPC_Msg_VT102 vt102;
194   IPC_Msg_key key;
195   IPC_Msg_term term;
196   IPC_Msg_status status;
197   IPC_Msg_setbaud setbaud;
198   IPC_Msg_sendbreak sendbreak;
199   IPC_Msg_setflow setflow;
200   IPC_Msg_setansi setansi;
201   IPC_Msg_hangup hangup;
202   IPC_Msg_setsize setsize;
203   IPC_Msg_reset reset;
204   IPC_Msg_killme killme;
205 } IPC_Msg;
206
207
208
209 #endif /* __IPC_H__ */