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
|
#ifndef DOXYGEN_SHOULD_SKIP_THIS
struct OSyncEngine {
/** The real opensync group **/
OSyncGroup *group;
void (* conflict_callback) (OSyncEngine *, OSyncMapping *, void *);
void *conflict_userdata;
void (* changestat_callback) (OSyncEngine *, OSyncChangeUpdate *, void *);
void *changestat_userdata;
void (* mebstat_callback) (OSyncMemberUpdate *, void *);
void *mebstat_userdata;
void (* engstat_callback) (OSyncEngine *, OSyncEngineUpdate *, void *);
void *engstat_userdata;
void (* mapstat_callback) (OSyncMappingUpdate *, void *);
void *mapstat_userdata;
void *(* plgmsg_callback) (OSyncEngine *, OSyncClient *, const char *, void *, void *);
void *plgmsg_userdata;
/** A list of connected clients **/
GList *clients;
/** The g_main_loop of this engine **/
GMainLoop *syncloop;
GMainContext *context;
/** The incoming queue of this engine **/
OSyncQueue *commands_from_self;
OSyncQueue *commands_to_self;
GCond* syncing;
GMutex* syncing_mutex;
GCond* info_received;
GMutex* info_received_mutex;
GCond* started;
GMutex* started_mutex;
//The normal flags
OSyncFlag *fl_running; //Is the syncengine running?
OSyncFlag *fl_sync; //Do we want to sync data or do we just want info?
OSyncFlag *fl_stop; //Do we want to stop the engine?
//The combined flags
OSyncFlag *cmb_connected; //Did all client connect or error?
OSyncFlag *cmb_sent_changes; //Did all clients sent changes?
OSyncFlag *cmb_entries_mapped; //Do we have unmapped entries?
OSyncFlag *cmb_synced; //Are all mappings synced?
OSyncFlag *cmb_finished; //Are all clients done and disconnected?
OSyncFlag *cmb_chkconflict;
OSyncFlag *cmb_read_all;
OSyncFlag *cmb_multiplied;
OSyncFlag *cmb_committed_all;
OSyncFlag *cmb_committed_all_sent;
osync_bool man_dispatch;
osync_bool allow_sync_alert;
OSyncMappingTable *maptable;
osync_bool is_initialized;
osync_bool committed_all_sent;
OSyncError *error;
GThread *thread;
int wasted;
int alldeciders;
osync_bool slowsync;
};
#endif
void send_client_changed(OSyncEngine *engine, OSyncClient *client);
void send_mappingentry_changed(OSyncEngine *engine, OSyncMappingEntry *entry);
void send_mapping_changed(OSyncEngine *engine, OSyncMapping *mapping);
void send_get_change_data(OSyncEngine *sender, OSyncMappingEntry *entry);
void send_commit_change(OSyncEngine *sender, OSyncMappingEntry *entry);
void send_connect(OSyncClient *target, OSyncEngine *sender);
void send_get_changes(OSyncClient *target, OSyncEngine *sender, osync_bool data);
void send_sync_done(OSyncClient *target, OSyncEngine *sender);
void send_disconnect(OSyncClient *target, OSyncEngine *sender);
void send_read_change(OSyncEngine *sender, OSyncMappingEntry *entry);
void send_engine_changed(OSyncEngine *engine);
void send_committed_all(OSyncClient *target, OSyncEngine *sender);
|