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.1  2008/02/14 12:17:42  james
16  * *** empty log message ***
17  *
18  */
19
20 #ifndef __IPC_H__
21 #define __IPC_H__
22
23 #define IPC_MAX_BUF 1024
24
25 #define IPC_MSG_TYPE_NOOP  0
26 #define IPC_MSG_TYPE_DEBUG 1
27 #define IPC_MSG_TYPE_HISTORY 2
28 #define IPC_MSG_TYPE_VT102 3
29 #define IPC_MSG_TYPE_KEY 4
30 #define IPC_MSG_TYPE_TERM 5
31 #define IPC_MSG_TYPE_STATUS 6
32
33 typedef struct
34 {
35   int32_t size;
36   int32_t type;
37   uint8_t payload[0];
38 } IPC_Msg_hdr;
39
40
41 typedef struct
42 {
43   int32_t size;
44   int32_t type;
45 } IPC_Msg_noop;
46
47
48 typedef struct
49 {
50   int32_t size;
51   int32_t type;
52   char msg[0];
53 } IPC_Msg_debug;
54
55 typedef struct 
56 {
57   int32_t size;
58   int32_t type;
59   History_ent history;
60 } IPC_Msg_history;
61
62 typedef struct 
63 {
64   int32_t size;
65   int32_t type;
66   int32_t len;
67   VT102 vt102;
68 } IPC_Msg_VT102;
69
70
71 typedef struct 
72 {
73   int32_t size;
74   int32_t type;
75   int32_t key;
76 } IPC_Msg_key;
77
78 typedef struct 
79 {
80   int32_t size;
81   int32_t type;
82   int32_t len;
83   uint8_t term[0];
84 } IPC_Msg_term;
85
86
87 typedef struct 
88 {
89   int32_t size;
90   int32_t type;
91   char  status[0];
92 } IPC_Msg_status;
93
94
95
96 typedef union 
97 {
98 IPC_Msg_hdr hdr;
99 IPC_Msg_noop noop;
100 IPC_Msg_debug debug;
101 IPC_Msg_history history;
102 IPC_Msg_VT102 vt102;
103 IPC_Msg_key key;
104 IPC_Msg_term term;
105 IPC_Msg_status status;
106 } IPC_Msg;
107
108
109
110 #endif /* __IPC_H__ */