Added OSYNC_TEST_EXPORT to export symbols in test mode - required for windows port
[opensync.git] / opensync / engine / opensync_engine_private.h
blobda6381eda854b4ef8c8c89e63244ac007c6ad869
1 /*
2 * libopensync - A synchronization engine for the opensync framework
3 * Copyright (C) 2004-2005 Armin Bauer <armin.bauer@opensync.org>
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 #ifndef OPENSYNC_ENGINE_PRIVATE_H_
22 #define OPENSYNC_ENGINE_PRIVATE_H_
24 typedef enum {
25 OSYNC_ENGINE_SOLVE_DUPLICATE,
26 OSYNC_ENGINE_SOLVE_CHOOSE,
27 OSYNC_ENGINE_SOLVE_IGNORE,
28 OSYNC_ENGINE_SOLVE_USE_LATEST
29 } OSyncEngineSolveType;
31 typedef struct OSyncEngineCommand {
32 OSyncEngineCmd cmd;
33 OSyncMappingEngine *mapping_engine;
34 OSyncChange *master;
35 OSyncEngineSolveType solve_type;
36 OSyncMember *member;
37 } OSyncEngineCommand;
39 struct OSyncEngine {
40 int ref_count;
41 /** The opensync group **/
42 OSyncGroup *group;
43 OSyncArchive *archive;
45 char *engine_path;
46 char *plugin_dir;
47 char *format_dir;
48 #ifdef OPENSYNC_UNITTESTS
49 char *schema_dir;
50 #endif /* OPENSYNC_UNITTESTS */
51 OSyncFormatEnv *formatenv;
52 OSyncPluginEnv *pluginenv;
54 OSyncEngineState state;
56 osync_conflict_cb conflict_callback;
57 void *conflict_userdata;
59 osync_status_change_cb changestat_callback;
60 void *changestat_userdata;
62 osync_status_member_cb mebstat_callback;
63 void *mebstat_userdata;
65 osync_status_engine_cb engstat_callback;
66 void *engstat_userdata;
68 osync_status_mapping_cb mapstat_callback;
69 void *mapstat_userdata;
71 //void *(* plgmsg_callback) (OSyncEngine *, OSyncClient *, const char *, void *, void *);
72 //void *plgmsg_userdata;
74 /** The g_main_loop of this engine **/
75 OSyncThread *thread;
76 GMainContext *context;
78 GAsyncQueue *command_queue;
79 GSourceFuncs *command_functions;
80 GSource *command_source;
82 GCond* syncing;
83 GMutex* syncing_mutex;
85 GCond* started;
86 GMutex* started_mutex;
88 /** proxies contains a list of all OSyncClientProxy objects **/
89 GList *proxies;
91 /** object_engines contains a list of all OSyncObjEngine objects **/
92 GList *object_engines;
94 osync_bool man_dispatch;
95 osync_bool allow_sync_alert;
97 OSyncError *error;
99 int proxy_connects;
100 int proxy_disconnects;
101 int proxy_get_changes;
102 int proxy_written;
103 int proxy_sync_done;
104 int proxy_errors;
106 int obj_errors;
107 int obj_connects;
108 int obj_disconnects;
109 int obj_get_changes;
110 int obj_written;
111 int obj_sync_done;
113 osync_bool busy;
115 GHashTable *internalFormats;
116 GHashTable *internalSchemas;
117 /** converter_paths contains a hash of all OSyncFormatConverterPath objects **/
118 GHashTable *converterPathes;
121 #endif /* OPENSYNC_ENGINE_PRIVATE_H_ */