summaryrefslogtreecommitdiff
path: root/legacy/ecore/src/lib/ecore_ipc/Ecore_Ipc.h
blob: ecb9c1c2207f9d91b69625d71f3859f216a1d652 (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
120
121
122
123
124
125
126
127
128
129
130
131
132
#ifndef _ECORE_IPC_H
#define _ECORE_IPC_H

#ifdef EAPI
#undef EAPI
#endif
#ifdef WIN32
# ifdef BUILDING_DLL
#  define EAPI __declspec(dllexport)
# else
#  define EAPI __declspec(dllimport)
# endif
#else
# ifdef GCC_HASCLASSVISIBILITY
#  define EAPI __attribute__ ((visibility("default")))
# else
#  define EAPI
# endif
#endif

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

#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,
          ECORE_IPC_USE_SSL = 16
     } 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;
   
   EAPI int               ecore_ipc_init(void);
   EAPI int               ecore_ipc_shutdown(void);
   
   /* FIXME: need to add protocol type parameter */
   EAPI 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 */
   EAPI Ecore_Ipc_Server *ecore_ipc_server_connect(Ecore_Ipc_Type type, char *name, int port, const void *data);
   EAPI void             *ecore_ipc_server_del(Ecore_Ipc_Server *svr);
   EAPI void             *ecore_ipc_server_data_get(Ecore_Ipc_Server *svr);
   EAPI int               ecore_ipc_server_connected_get(Ecore_Ipc_Server *svr);
   /* FIXME: this needs to become an ipc message */
   EAPI 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 */
   EAPI int               ecore_ipc_client_send(Ecore_Ipc_Client *cl, int major, int minor, int ref, int ref_to, int response, void *data, int size);
   EAPI Ecore_Ipc_Server *ecore_ipc_client_server_get(Ecore_Ipc_Client *cl);
   EAPI void             *ecore_ipc_client_del(Ecore_Ipc_Client *cl);
   EAPI void              ecore_ipc_client_data_set(Ecore_Ipc_Client *cl, const void *data);
   EAPI void             *ecore_ipc_client_data_get(Ecore_Ipc_Client *cl);
   
   EAPI int               ecore_ipc_ssl_available_get(void);
   /* FIXME: need to add a callback to "ok" large ipc messages greater than */
   /*        a certain size (seurity/DOS attack safety) */
   
#ifdef __cplusplus
}
#endif

#endif