1EVS_INITIALIZE(3) Corosync Cluster Engine Programmer's ManualEVS_INITIALIZE(3)
2
3
4
6 evs_initialize - Create a new connection to the EVS service
7
9 #include <corosync/evs.h>
10
11 int evs_initialize(evs_handle_t *handle, evs_callbacks_t *callbacks);
12
14 The evs_initialize function is used to initialize a connection to the
15 extended virtual synchrony API.
16
17 Each application may have several connections to the EVS API. Each
18 application uses the handle argument to uniquely identify the connec‐
19 tion. The handle argument is then used in other function calls to
20 identify the connection to be used for communication with the EVS ser‐
21 vice.
22
23 Every time an EVS event occurs, one of the callbacks specified by the
24 argument callbacks is called. The callback functions are described by
25 the following type definitions:
26
27 typedef void (*evs_deliver_fn_t) (
28 unsigned int nodeid,
29 const void *msg,
30 size_t msg_len);
31
32 typedef void (*evs_confchg_fn_t) (
33 unsigned int *member_list, size_t member_list_entries,
34 unsigned int *left_list, size_t left_list_entries,
35 unsigned int *joined_list, size_t joined_list_entries);
36
37 The callbacks argument is of the type:
38
39 typedef struct {
40 evs_deliver_fn_t evs_deliver_fn;
41 evs_confchg_fn_t evs_confchg_fn;
42 } evs_callbacks_t;
43
44 When a configuration change occurs or a message is to be delivered one
45 of the callbacks is called from the evs_dispatch() function. If a con‐
46 figuration change occurs, evs_confchg_fn is called. If a delivery of a
47 message occurs, evs_deliver_fn is called.
48
49
51 This call returns the EVS_OK value if successful, otherwise an error is
52 returned.
53
55 The errors are undocumented.
56
58 evs_overview(8), evs_finalize(3), evs_fd_get(3), evs_dispatch(3),
59 evs_join(3), evs_leave(3), evs_mcast_joined(3), evs_mcast_groups(3),
60 evs_mmembership_get(3) evs_context_get(3) evs_context_set(3)
61
62corosync Man Page 2004-08-31 EVS_INITIALIZE(3)