summaryrefslogtreecommitdiff
path: root/legacy/ecore/src/lib/ecore_ipc/Ecore_Ipc.h.in
blob: c322a90e3d6a579fe6e04096e2b9b3dd1115a348 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
#ifndef _ECORE_IPC_H
#define _ECORE_IPC_H

/**
 * @file Ecore_Ipc.h
 * @brief Ecore inter-process communication functions.
 */

#define HAVE_ECORE_IPC_OPENSSL @USE_OPENSSL@

#if HAVE_ECORE_IPC_OPENSSL
#include <openssl/ssl.h>
#endif

#ifdef __cplusplus
extern "C" {
#endif
   
#ifndef _ECORE_IPC_PRIVATE_H
   typedef void Ecore_Ipc_Server; /**< An IPC connection handle */
   typedef void Ecore_Ipc_Client; /**< An IPC connection handle */
#endif

   typedef enum _Ecore_Ipc_Type
     {
	ECORE_IPC_LOCAL_USER,
	  ECORE_IPC_LOCAL_SYSTEM,
	  ECORE_IPC_REMOTE_SYSTEM
#if HAVE_ECORE_IPC_OPENSSL
          ,ECORE_IPC_USE_SSL = 16
#endif
     } Ecore_Ipc_Type;
   
   typedef struct _Ecore_Ipc_Event_Client_Add  Ecore_Ipc_Event_Client_Add;
   typedef struct _Ecore_Ipc_Event_Client_Del  Ecore_Ipc_Event_Client_Del;
   typedef struct _Ecore_Ipc_Event_Server_Add  Ecore_Ipc_Event_Server_Add;
   typedef struct _Ecore_Ipc_Event_Server_Del  Ecore_Ipc_Event_Server_Del;
   typedef struct _Ecore_Ipc_Event_Client_Data Ecore_Ipc_Event_Client_Data;
   typedef struct _Ecore_Ipc_Event_Server_Data Ecore_Ipc_Event_Server_Data;
   
   struct _Ecore_Ipc_Event_Client_Add
     {
	Ecore_Ipc_Client *client;
     };
   
   struct _Ecore_Ipc_Event_Client_Del
     {
	Ecore_Ipc_Client *client;
     };
   
   struct _Ecore_Ipc_Event_Server_Add
     {
	Ecore_Ipc_Server *server;
     };
   
   struct _Ecore_Ipc_Event_Server_Del
     {
	Ecore_Ipc_Server *server;
     };
   
   struct _Ecore_Ipc_Event_Client_Data
     {
	Ecore_Ipc_Client *client;
	/* FIXME: this needs to become an ipc message */
	int               major;
	int               minor;
	int               ref;
	int               ref_to;
	int               response;
	void             *data;
	int               size;
     };
   
   struct _Ecore_Ipc_Event_Server_Data
     {
	Ecore_Ipc_Server *server;
	/* FIXME: this needs to become an ipc message */
	int               major;
	int               minor;
	int               ref;
	int               ref_to;
	int               response;
	void             *data;
	int               size;
     };
   
   extern int ECORE_IPC_EVENT_CLIENT_ADD;
   extern int ECORE_IPC_EVENT_CLIENT_DEL;
   extern int ECORE_IPC_EVENT_SERVER_ADD;
   extern int ECORE_IPC_EVENT_SERVER_DEL;
   extern int ECORE_IPC_EVENT_CLIENT_DATA;
   extern int ECORE_IPC_EVENT_SERVER_DATA;
   
   int               ecore_ipc_init(void);
   int               ecore_ipc_shutdown(void);
   
   /* FIXME: need to add protocol type parameter */
   Ecore_Ipc_Server *ecore_ipc_server_add(Ecore_Ipc_Type type, char *name, int port, const void *data);
   
   /* FIXME: need to add protocol type parameter */
   Ecore_Ipc_Server *ecore_ipc_server_connect(Ecore_Ipc_Type type, char *name, int port, const void *data);
   void             *ecore_ipc_server_del(Ecore_Ipc_Server *svr);
   void             *ecore_ipc_server_data_get(Ecore_Ipc_Server *svr);
   int               ecore_ipc_server_connected_get(Ecore_Ipc_Server *svr);
   /* FIXME: this needs to become an ipc message */
   int               ecore_ipc_server_send(Ecore_Ipc_Server *svr, int major, int minor, int ref, int ref_to, int response, void *data, int size);

   /* FIXME: this needs to become an ipc message */
   int               ecore_ipc_client_send(Ecore_Ipc_Client *cl, int major, int minor, int ref, int ref_to, int response, void *data, int size);
   Ecore_Ipc_Server *ecore_ipc_client_server_get(Ecore_Ipc_Client *cl);
   void             *ecore_ipc_client_del(Ecore_Ipc_Client *cl);
   void              ecore_ipc_client_data_set(Ecore_Ipc_Client *cl, const void *data);
   void             *ecore_ipc_client_data_get(Ecore_Ipc_Client *cl);
       
#ifdef __cplusplus
}
#endif

#endif