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