blob: 3c893b427a25b186aed543c43f144ac38810542a (
plain)
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
|
#ifndef _IVYCHANNEL_H
#define _IVYCHANNEL_H
#ifdef __cplusplus
extern "C" {
#endif
/* general Handle */
#ifdef WIN32
#include <windows.h>
#define HANDLE SOCKET
#else
#define HANDLE int
#endif
typedef struct _channel *Channel;
/* callback declenche par la gestion de boucle sur evenement exception sur le canal */
typedef void (*ChannelHandleDelete)( void *data );
/* callback declenche par la gestion de boucle sur donnees pretes sur le canal */
typedef void (*ChannelHandleRead)( Channel channel, HANDLE fd, void *data);
/* fonction appele par le bus pour initialisation */
typedef void (*ChannelInit)(void);
/* fonction appele par le bus pour mise en place des callback sur le canal */
typedef Channel (*ChannelSetUp)(
HANDLE fd,
void *data,
ChannelHandleDelete handle_delete,
ChannelHandleRead handle_read
);
/* fonction appele par le bus pour fermeture du canal */
typedef void (*ChannelClose)( Channel channel );
/* mise en place des fonction de gestion des canaux */
void BusSetChannelManagement( ChannelInit init_chan, ChannelSetUp setup_chan, ChannelClose close_chan );
#ifdef __cplusplus
}
#endif
#endif
|