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