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