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